vendor: 8,890 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/swaps-DXoOOAs0.js","assets/index-B53orcYr.js","assets/send-DOZxm0pc.js","assets/ui-B17x4kg1.js","assets/email-C_TVSKW8.js"])))=>i.map(i=>d[i]); 2var Sle=Object.defineProperty;var _le=(n,e,t)=>e in n?Sle(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ts=(n,e,t)=>_le(n,typeof e!="symbol"?e+"":e,t);function Cle(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in n)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();function xo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Vx(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var lk={exports:{}},sA={};/** 3 * @license React 4 * react-jsx-runtime.production.js 5 * 6 * Copyright (c) Meta Platforms, Inc. and affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var yz;function Tle(){if(yz)return sA;yz=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:n,type:r,key:o,ref:i!==void 0?i:null,props:s}}return sA.Fragment=e,sA.jsx=t,sA.jsxs=t,sA}var bz;function Ile(){return bz||(bz=1,lk.exports=Tle()),lk.exports}var S=Ile(),uk={exports:{}};function Nle(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wX={exports:{}},Js=wX.exports={},gf,mf;function _D(){throw new Error("setTimeout has not been defined")}function CD(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?gf=setTimeout:gf=_D}catch{gf=_D}try{typeof clearTimeout=="function"?mf=clearTimeout:mf=CD}catch{mf=CD}})();function yX(n){if(gf===setTimeout)return setTimeout(n,0);if((gf===_D||!gf)&&setTimeout)return gf=setTimeout,setTimeout(n,0);try{return gf(n,0)}catch{try{return gf.call(null,n,0)}catch{return gf.call(this,n,0)}}}function Rle(n){if(mf===clearTimeout)return clearTimeout(n);if((mf===CD||!mf)&&clearTimeout)return mf=clearTimeout,clearTimeout(n);try{return mf(n)}catch{try{return mf.call(null,n)}catch{return mf.call(this,n)}}}var Qp=[],z2=!1,Ay,i6=-1;function Mle(){!z2||!Ay||(z2=!1,Ay.length?Qp=Ay.concat(Qp):i6=-1,Qp.length&&bX())}function bX(){if(!z2){var n=yX(Mle);z2=!0;for(var e=Qp.length;e;){for(Ay=Qp,Qp=[];++i6<e;)Ay&&Ay[i6].run();i6=-1,e=Qp.length}Ay=null,z2=!1,Rle(n)}}Js.nextTick=function(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Qp.push(new vX(n,e)),Qp.length===1&&!z2&&yX(bX)};function vX(n,e){this.fun=n,this.array=e}vX.prototype.run=function(){this.fun.apply(null,this.array)};Js.title="browser";Js.browser=!0;Js.env={};Js.argv=[];Js.version="";Js.versions={};function Ag(){}Js.on=Ag;Js.addListener=Ag;Js.once=Ag;Js.off=Ag;Js.removeListener=Ag;Js.removeAllListeners=Ag;Js.emit=Ag;Js.prependListener=Ag;Js.prependOnceListener=Ag;Js.listeners=function(n){return[]};Js.binding=function(n){throw new Error("process.binding is not supported")};Js.cwd=function(){return"/"};Js.chdir=function(n){throw new Error("process.chdir is not supported")};Js.umask=function(){return 0};var kle=wX.exports;const Ji=Nle(kle);var pr={},vz;function Ole(){if(vz)return pr;vz=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=f&&z[f]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,b={};function E(z,B,C){this.props=z,this.context=B,this.refs=b,this.updater=C||w}E.prototype.isReactComponent={},E.prototype.setState=function(z,B){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,B,"setState")},E.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function T(){}T.prototype=E.prototype;function N(z,B,C){this.props=z,this.context=B,this.refs=b,this.updater=C||w}var I=N.prototype=new T;I.constructor=N,y(I,E.prototype),I.isPureReactComponent=!0;var H=Array.isArray,L={H:null,A:null,T:null,S:null,V:null},U=Object.prototype.hasOwnProperty;function K(z,B,C,M,Z,J){return C=J.ref,{$$typeof:n,type:z,key:B,ref:C!==void 0?C:null,props:J}}function Y(z,B){return K(z.type,B,void 0,void 0,void 0,z.props)}function k(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function j(z){var B={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(C){return B[C]})}var V=/\/+/g;function W(z,B){return typeof z=="object"&&z!==null&&z.key!=null?j(""+z.key):B.toString(36)}function $(){}function A(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then($,$):(z.status="pending",z.then(function(B){z.status==="pending"&&(z.status="fulfilled",z.value=B)},function(B){z.status==="pending"&&(z.status="rejected",z.reason=B)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function _(z,B,C,M,Z){var J=typeof z;(J==="undefined"||J==="boolean")&&(z=null);var ae=!1;if(z===null)ae=!0;else switch(J){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(z.$$typeof){case n:case e:ae=!0;break;case d:return ae=z._init,_(ae(z._payload),B,C,M,Z)}}if(ae)return Z=Z(z),ae=M===""?"."+W(z,0):M,H(Z)?(C="",ae!=null&&(C=ae.replace(V,"$&/")+"/"),_(Z,B,C,"",function(xe){return xe})):Z!=null&&(k(Z)&&(Z=Y(Z,C+(Z.key==null||z&&z.key===Z.key?"":(""+Z.key).replace(V,"$&/")+"/")+ae)),B.push(Z)),1;ae=0;var we=M===""?".":M+":";if(H(z))for(var he=0;he<z.length;he++)M=z[he],J=we+W(M,he),ae+=_(M,B,C,J,Z);else if(he=m(z),typeof he=="function")for(z=he.call(z),he=0;!(M=z.next()).done;)M=M.value,J=we+W(M,he++),ae+=_(M,B,C,J,Z);else if(J==="object"){if(typeof z.then=="function")return _(A(z),B,C,M,Z);throw B=String(z),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ae}function R(z,B,C){if(z==null)return z;var M=[],Z=0;return _(z,M,"","",function(J){return B.call(C,J,Z++)}),M}function P(z){if(z._status===-1){var B=z._result;B=B(),B.then(function(C){(z._status===0||z._status===-1)&&(z._status=1,z._result=C)},function(C){(z._status===0||z._status===-1)&&(z._status=2,z._result=C)}),z._status===-1&&(z._status=0,z._result=B)}if(z._status===1)return z._result.default;throw z._result}var q=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(B))return}else if(typeof Ji=="object"&&typeof Ji.emit=="function"){Ji.emit("uncaughtException",z);return}console.error(z)};function F(){}
vendor: 27,220 bytes, lines 10-41
10return pr.Children={map:R,forEach:function(z,B,C){R(z,function(){B.apply(this,arguments)},C)},count:function(z){var B=0;return R(z,function(){B++}),B},toArray:function(z){return R(z,function(B){return B})||[]},only:function(z){if(!k(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},pr.Component=E,pr.Fragment=t,pr.Profiler=i,pr.PureComponent=N,pr.StrictMode=r,pr.Suspense=c,pr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,pr.__COMPILER_RUNTIME={__proto__:null,c:function(z){return L.H.useMemoCache(z)}},pr.cache=function(z){return function(){return z.apply(null,arguments)}},pr.cloneElement=function(z,B,C){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var M=y({},z.props),Z=z.key,J=void 0;if(B!=null)for(ae in B.ref!==void 0&&(J=void 0),B.key!==void 0&&(Z=""+B.key),B)!U.call(B,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&B.ref===void 0||(M[ae]=B[ae]);var ae=arguments.length-2;if(ae===1)M.children=C;else if(1<ae){for(var we=Array(ae),he=0;he<ae;he++)we[he]=arguments[he+2];M.children=we}return K(z.type,Z,void 0,void 0,J,M)},pr.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:s,_context:z},z},pr.createElement=function(z,B,C){var M,Z={},J=null;if(B!=null)for(M in B.key!==void 0&&(J=""+B.key),B)U.call(B,M)&&M!=="key"&&M!=="__self"&&M!=="__source"&&(Z[M]=B[M]);var ae=arguments.length-2;if(ae===1)Z.children=C;else if(1<ae){for(var we=Array(ae),he=0;he<ae;he++)we[he]=arguments[he+2];Z.children=we}if(z&&z.defaultProps)for(M in ae=z.defaultProps,ae)Z[M]===void 0&&(Z[M]=ae[M]);return K(z,J,void 0,void 0,null,Z)},pr.createRef=function(){return{current:null}},pr.forwardRef=function(z){return{$$typeof:a,render:z}},pr.isValidElement=k,pr.lazy=function(z){return{$$typeof:d,_payload:{_status:-1,_result:z},_init:P}},pr.memo=function(z,B){return{$$typeof:u,type:z,compare:B===void 0?null:B}},pr.startTransition=function(z){var B=L.T,C={};L.T=C;try{var M=z(),Z=L.S;Z!==null&&Z(C,M),typeof M=="object"&&M!==null&&typeof M.then=="function"&&M.then(F,q)}catch(J){q(J)}finally{L.T=B}},pr.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},pr.use=function(z){return L.H.use(z)},pr.useActionState=function(z,B,C){return L.H.useActionState(z,B,C)},pr.useCallback=function(z,B){return L.H.useCallback(z,B)},pr.useContext=function(z){return L.H.useContext(z)},pr.useDebugValue=function(){},pr.useDeferredValue=function(z,B){return L.H.useDeferredValue(z,B)},pr.useEffect=function(z,B,C){var M=L.H;if(typeof C=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return M.useEffect(z,B)},pr.useId=function(){return L.H.useId()},pr.useImperativeHandle=function(z,B,C){return L.H.useImperativeHandle(z,B,C)},pr.useInsertionEffect=function(z,B){return L.H.useInsertionEffect(z,B)},pr.useLayoutEffect=function(z,B){return L.H.useLayoutEffect(z,B)},pr.useMemo=function(z,B){return L.H.useMemo(z,B)},pr.useOptimistic=function(z,B){return L.H.useOptimistic(z,B)},pr.useReducer=function(z,B,C){return L.H.useReducer(z,B,C)},pr.useRef=function(z){return L.H.useRef(z)},pr.useState=function(z){return L.H.useState(z)},pr.useSyncExternalStore=function(z,B,C){return L.H.useSyncExternalStore(z,B,C)},pr.useTransition=function(){return L.H.useTransition()},pr.version="19.1.1",pr}var xz;function TC(){return xz||(xz=1,uk.exports=Ole()),uk.exports}var X=TC();const Qn=xo(X),xX=Cle({__proto__:null,default:Qn},[X]);var dk={exports:{}},oA={},hk={exports:{}},fk={};/** 11 * @license React 12 * scheduler.production.js 13 * 14 * Copyright (c) Meta Platforms, Inc. and affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var Ez;function Ple(){return Ez||(Ez=1,function(n){function e(R,P){var q=R.length;R.push(P);e:for(;0<q;){var F=q-1>>>1,z=R[F];if(0<i(z,P))R[F]=P,R[q]=z,q=F;else break e}}function t(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var P=R[0],q=R.pop();if(q!==P){R[0]=q;e:for(var F=0,z=R.length,B=z>>>1;F<B;){var C=2*(F+1)-1,M=R[C],Z=C+1,J=R[Z];if(0>i(M,q))Z<z&&0>i(J,M)?(R[F]=J,R[Z]=q,F=Z):(R[F]=M,R[C]=q,F=C);else if(Z<z&&0>i(J,q))R[F]=J,R[Z]=q,F=Z;else break e}}return P}function i(R,P){var q=R.sortIndex-P.sortIndex;return q!==0?q:R.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var c=[],u=[],d=1,f=null,m=3,w=!1,y=!1,b=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function H(R){for(var P=t(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=R)r(u),P.sortIndex=P.expirationTime,e(c,P);else break;P=t(u)}}function L(R){if(b=!1,H(R),!y)if(t(c)!==null)y=!0,U||(U=!0,W());else{var P=t(u);P!==null&&_(L,P.startTime-R)}}var U=!1,K=-1,Y=5,k=-1;function j(){return E?!0:!(n.unstable_now()-k<Y)}function V(){if(E=!1,U){var R=n.unstable_now();k=R;var P=!0;try{e:{y=!1,b&&(b=!1,N(K),K=-1),w=!0;var q=m;try{t:{for(H(R),f=t(c);f!==null&&!(f.expirationTime>R&&j());){var F=f.callback;if(typeof F=="function"){f.callback=null,m=f.priorityLevel;var z=F(f.expirationTime<=R);if(R=n.unstable_now(),typeof z=="function"){f.callback=z,H(R),P=!0;break t}f===t(c)&&r(c),H(R)}else r(c);f=t(c)}if(f!==null)P=!0;else{var B=t(u);B!==null&&_(L,B.startTime-R),P=!1}}break e}finally{f=null,m=q,w=!1}P=void 0}}finally{P?W():U=!1}}}var W;if(typeof I=="function")W=function(){I(V)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,A=$.port2;$.port1.onmessage=V,W=function(){A.postMessage(null)}}else W=function(){T(V,0)};function _(R,P){K=T(function(){R(n.unstable_now())},P)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(R){R.callback=null},n.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<R?Math.floor(1e3/R):5},n.unstable_getCurrentPriorityLevel=function(){return m},n.unstable_next=function(R){switch(m){case 1:case 2:case 3:var P=3;break;default:P=m}var q=m;m=P;try{return R()}finally{m=q}},n.unstable_requestPaint=function(){E=!0},n.unstable_runWithPriority=function(R,P){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var q=m;m=R;try{return P()}finally{m=q}},n.unstable_scheduleCallback=function(R,P,q){var F=n.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?F+q:F):q=F,R){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=q+z,R={id:d++,callback:P,priorityLevel:R,startTime:q,expirationTime:z,sortIndex:-1},q>F?(R.sortIndex=q,e(u,R),t(c)===null&&R===t(u)&&(b?(N(K),K=-1):b=!0,_(L,q-F))):(R.sortIndex=z,e(c,R),y||w||(y=!0,U||(U=!0,W()))),R},n.unstable_shouldYield=j,n.unstable_wrapCallback=function(R){var P=m;return function(){var q=m;m=P;try{return R.apply(this,arguments)}finally{m=q}}}}(fk)),fk}var Az;function Dle(){return Az||(Az=1,hk.exports=Ple()),hk.exports}var pk={exports:{}},Ma={};/** 19 * @license React 20 * react-dom.production.js 21 * 22 * Copyright (c) Meta Platforms, Inc. and affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */var Sz;function Ble(){if(Sz)return Ma;Sz=1;var n=TC();function e(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var r={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(c,u,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:f==null?null:""+f,children:c,containerInfo:u,implementation:d}}var o=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Ma.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ma.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return s(c,u,null,d)},Ma.flushSync=function(c){var u=o.T,d=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=u,r.p=d,r.d.f()}},Ma.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(c,u))},Ma.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Ma.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,f=a(d,u.crossOrigin),m=typeof u.integrity=="string"?u.integrity:void 0,w=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?r.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:m,fetchPriority:w}):d==="script"&&r.d.X(c,{crossOrigin:f,integrity:m,fetchPriority:w,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Ma.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=a(u.as,u.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(c)},Ma.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,f=a(d,u.crossOrigin);r.d.L(c,d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Ma.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=a(u.as,u.crossOrigin);r.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(c)},Ma.requestFormReset=function(c){r.d.r(c)},Ma.unstable_batchedUpdates=function(c,u){return c(u)},Ma.useFormState=function(c,u,d){return o.H.useFormState(c,u,d)},Ma.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ma.version="19.1.1",Ma}var _z;function EX(){if(_z)return pk.exports;_z=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),pk.exports=Ble(),pk.exports}var Cz;function Lle(){if(Cz)return oA;Cz=1;/** 27 * @license React 28 * react-dom-client.production.js 29 * 30 * Copyright (c) Meta Platforms, Inc. and affiliates. 31 * 32 * This source code is licensed under the MIT license found in the 33 * LICENSE file in the root directory of this source tree. 34 */var n=Dle(),e=TC(),t=EX();function r(l){var h="https://react.dev/errors/"+l;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+l+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function s(l){var h=l,p=l;if(l.alternate)for(;h.return;)h=h.return;else{l=h;do h=l,(h.flags&4098)!==0&&(p=h.return),l=h.return;while(l)}return h.tag===3?p:null}function o(l){if(l.tag===13){var h=l.memoizedState;if(h===null&&(l=l.alternate,l!==null&&(h=l.memoizedState)),h!==null)return h.dehydrated}return null}function a(l){if(s(l)!==l)throw Error(r(188))}function c(l){var h=l.alternate;if(!h){if(h=s(l),h===null)throw Error(r(188));return h!==l?null:l}for(var p=l,x=h;;){var O=p.return;if(O===null)break;var G=O.alternate;if(G===null){if(x=O.return,x!==null){p=x;continue}break}if(O.child===G.child){for(G=O.child;G;){if(G===p)return a(O),l;if(G===x)return a(O),h;G=G.sibling}throw Error(r(188))}if(p.return!==x.return)p=O,x=G;else{for(var se=!1,me=O.child;me;){if(me===p){se=!0,p=O,x=G;break}if(me===x){se=!0,x=O,p=G;break}me=me.sibling}if(!se){for(me=G.child;me;){if(me===p){se=!0,p=G,x=O;break}if(me===x){se=!0,x=G,p=O;break}me=me.sibling}if(!se)throw Error(r(189))}}if(p.alternate!==x)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?l:h}function u(l){var h=l.tag;if(h===5||h===26||h===27||h===6)return l;for(l=l.child;l!==null;){if(h=u(l),h!==null)return h;l=l.sibling}return null}var d=Object.assign,f=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),N=Symbol.for("react.consumer"),I=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function W(l){return l===null||typeof l!="object"?null:(l=V&&l[V]||l["@@iterator"],typeof l=="function"?l:null)}var $=Symbol.for("react.client.reference");function A(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===$?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case y:return"Fragment";case E:return"Profiler";case b:return"StrictMode";case L:return"Suspense";case U:return"SuspenseList";case k:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case w:return"Portal";case I:return(l.displayName||"Context")+".Provider";case N:return(l._context.displayName||"Context")+".Consumer";case H:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case K:return h=l.displayName||null,h!==null?h:A(l.type)||"Memo";case Y:h=l._payload,l=l._init;try{return A(l(h))}catch{}}return null}var _=Array.isArray,R=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},F=[],z=-1;function B(l){return{current:l}}function C(l){0>z||(l.current=F[z],F[z]=null,z--)}function M(l,h){z++,F[z]=l.current,l.current=h}var Z=B(null),J=B(null),ae=B(null),we=B(null);function he(l,h){switch(M(ae,h),M(J,l),M(Z,null),h.nodeType){case 9:case 11:l=(l=h.documentElement)&&(l=l.namespaceURI)?Yi(l):0;break;default:if(l=h.tagName,h=h.namespaceURI)h=Yi(h),l=ts(h,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}C(Z),M(Z,l)}function xe(){C(Z),C(J),C(ae)}function Se(l){l.memoizedState!==null&&M(we,l);var h=Z.current,p=ts(h,l.type);h!==p&&(M(J,l),M(Z,p))}function Re(l){J.current===l&&(C(Z),C(J)),we.current===l&&(C(we),bm._currentValue=q)}var et=Object.prototype.hasOwnProperty,Me=n.unstable_scheduleCallback,Fe=n.unstable_cancelCallback,ht=n.unstable_shouldYield,Dt=n.unstable_requestPaint,At=n.unstable_now,Wt=n.unstable_getCurrentPriorityLevel,yn=n.unstable_ImmediatePriority,Yt=n.unstable_UserBlockingPriority,Jt=n.unstable_NormalPriority,bn=n.unstable_LowPriority,Kt=n.unstable_IdlePriority,En=n.log,Xe=n.unstable_setDisableYieldValue,at=null,rt=null;function lt(l){if(typeof En=="function"&&Xe(l),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(at,l)}catch{}}var yt=Math.clz32?Math.clz32:ee,oe=Math.log,Q=Math.LN2;function ee(l){return l>>>=0,l===0?32:31-(oe(l)/Q|0)|0}var fe=256,Ee=4194304;function Te(l){var h=l&42;if(h!==0)return h;switch(l&-l){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:return 64;case 128:return 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 l&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function De(l,h,p){var x=l.pendingLanes;if(x===0)return 0;var O=0,G=l.suspendedLanes,se=l.pingedLanes;l=l.warmLanes;var me=x&134217727;return me!==0?(x=me&~G,x!==0?O=Te(x):(se&=me,se!==0?O=Te(se):p||(p=me&~l,p!==0&&(O=Te(p))))):(me=x&~G,me!==0?O=Te(me):se!==0?O=Te(se):p||(p=x&~l,p!==0&&(O=Te(p)))),O===0?0:h!==0&&h!==O&&(h&G)===0&&(G=O&-O,p=h&-h,G>=p||G===32&&(p&4194048)!==0)?h:O}function vt(l,h){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&h)===0}function jt(l,h){switch(l){case 1:case 2:case 4:case 8:case 64:return h+250;case 16:case 32: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 h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kt(){var l=fe;return fe<<=1,(fe&4194048)===0&&(fe=256),l}function dn(){var l=Ee;return Ee<<=1,(Ee&62914560)===0&&(Ee=4194304),l}function Ut(l){for(var h=[],p=0;31>p;p++)h.push(l);return h}function _n(l,h){l.pendingLanes|=h,h!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function vn(l,h,p,x,O,G){var se=l.pendingLanes;l.pendingLanes=p,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=p,l.entangledLanes&=p,l.errorRecoveryDisabledLanes&=p,l.shellSuspendCounter=0;var me=l.entanglements,_e=l.expirationTimes,We=l.hiddenUpdates;for(p=se&~p;0<p;){var ct=31-yt(p),gt=1<<ct;me[ct]=0,_e[ct]=-1;var Ze=We[ct];if(Ze!==null)for(We[ct]=null,ct=0;ct<Ze.length;ct++){var He=Ze[ct];He!==null&&(He.lane&=-536870913)}p&=~gt}x!==0&&Xn(l,x,0),G!==0&&O===0&&l.tag!==0&&(l.suspendedLanes|=G&~(se&~h))}function Xn(l,h,p){l.pendingLanes|=h,l.suspendedLanes&=~h;var x=31-yt(h);l.entangledLanes|=h,l.entanglements[x]=l.entanglements[x]|1073741824|p&4194090}function kn(l,h){var p=l.entangledLanes|=h;for(l=l.entanglements;p;){var x=31-yt(p),O=1<<x;O&h|l[x]&h&&(l[x]|=h),p&=~O}}function tr(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;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:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function Cn(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function de(){var l=P.p;return l!==0?l:(l=window.event,l===void 0?32:jT(l.type))}function te(l,h){var p=P.p;try{return P.p=l,h()}finally{P.p=p}}var re=Math.random().toString(36).slice(2),ye="__reactFiber$"+re,Ce="__reactProps$"+re,ke="__reactContainer$"+re,Ye="__reactEvents$"+re,Bn="__reactListeners$"+re,Rn="__reactHandles$"+re,mn="__reactResources$"+re,or="__reactMarker$"+re;function gn(l){delete l[ye],delete l[Ce],delete l[Ye],delete l[Bn],delete l[Rn]}function Rr(l){var h=l[ye];if(h)return h;for(var p=l.parentNode;p;){if(h=p[ke]||p[ye]){if(p=h.alternate,h.child!==null||p!==null&&p.child!==null)for(l=IT(l);l!==null;){if(p=l[ye])return p;l=IT(l)}return h}l=p,p=l.parentNode}return null}function ga(l){if(l=l[ye]||l[ke]){var h=l.tag;if(h===5||h===6||h===13||h===26||h===27||h===3)return l}return null}function Kr(l){var h=l.tag;if(h===5||h===26||h===27||h===6)return l.stateNode;throw Error(r(33))}function Yr(l){var h=l[mn];return h||(h=l[mn]={hoistableStyles:new Map,hoistableScripts:new Map}),h}function ki(l){l[or]=!0}var Sl=new Set,uu={};function ma(l,h){Ja(l,h),Ja(l+"Capture",h)}function Ja(l,h){for(uu[l]=h,l=0;l<h.length;l++)Sl.add(h[l])}var _l=RegExp("^[: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]*$"),sd={},Cl={};function ep(l){return et.call(Cl,l)?!0:et.call(sd,l)?!1:_l.test(l)?Cl[l]=!0:(sd[l]=!0,!1)}function ec(l,h,p){if(ep(h))if(p===null)l.removeAttribute(h);else{switch(typeof p){case"undefined":case"function":case"symbol":l.removeAttribute(h);return;case"boolean":var x=h.toLowerCase().slice(0,5);if(x!=="data-"&&x!=="aria-"){l.removeAttribute(h);return}}l.setAttribute(h,""+p)}}function Tl(l,h,p){if(p===null)l.removeAttribute(h);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(h);return}l.setAttribute(h,""+p)}}function Ao(l,h,p,x){if(x===null)l.removeAttribute(p);else{switch(typeof x){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(p);return}l.setAttributeNS(h,p,""+x)}}var du,od;function Mc(l){if(du===void 0)try{throw Error()}catch(p){var h=p.stack.trim().match(/\n( *(at )?)/);du=h&&h[1]||"",od=-1<p.stack.indexOf(` 35 at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return` 36`+du+l+od}var ad=!1;function cd(l,h){if(!l||ad)return"";ad=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(h){var gt=function(){throw Error()};if(Object.defineProperty(gt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(gt,[])}catch(He){var Ze=He}Reflect.construct(l,[],gt)}else{try{gt.call()}catch(He){Ze=He}l.call(gt.prototype)}}else{try{throw Error()}catch(He){Ze=He}(gt=l())&&typeof gt.catch=="function"&>.catch(function(){})}}catch(He){if(He&&Ze&&typeof He.stack=="string")return[He.stack,Ze.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var O=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");O&&O.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var G=x.DetermineComponentFrameRoot(),se=G[0],me=G[1];if(se&&me){var _e=se.split(` 37`),We=me.split(` 38`);for(O=x=0;x<_e.length&&!_e[x].includes("DetermineComponentFrameRoot");)x++;for(;O<We.length&&!We[O].includes("DetermineComponentFrameRoot");)O++;if(x===_e.length||O===We.length)for(x=_e.length-1,O=We.length-1;1<=x&&0<=O&&_e[x]!==We[O];)O--;for(;1<=x&&0<=O;x--,O--)if(_e[x]!==We[O]){if(x!==1||O!==1)do if(x--,O--,0>O||_e[x]!==We[O]){var ct=` 39`+_e[x].replace(" at new "," at ");return l.displayName&&ct.includes("<anonymous>")&&(ct=ct.replace("<anonymous>",l.displayName)),ct}while(1<=x&&0<=O);break}}}finally{ad=!1,Error.prepareStackTrace=p}return(p=l?l.displayName||l.name:"")?Mc(p):""}function tp(l){switch(l.tag){case 26:case 27:case 5:return Mc(l.type);case 16:return Mc("Lazy");case 13:return Mc("Suspense");case 19:return Mc("SuspenseList");case 0:case 15:return cd(l.type,!1);case 11:return cd(l.type.render,!1);case 1:return cd(l.type,!0);case 31:return Mc("Activity");default:return""}}function ld(l){try{var h="";do h+=tp(l),l=l.return;while(l);return h}catch(p){return` 40Error generating stack: `+p.message+` 41`+p.stack}}function $o(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Mg(l){var h=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function j0(l){var h=Mg(l)?"checked":"value",p=Object.getOwnPropertyDescriptor(l.constructor.prototype,h),x=""+l[h];if(!l.hasOwnProperty(h)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var O=p.get,G=p.set;return Object.defineProperty(l,h,{configurable:!0,get:function(){return O.call(this)},set:function(se){x=""+se,G.call(this,se)}}),Object.defineProperty(l,h,{enumerable:p.enumerable}),{getValue:function(){return x},setValue:function(se){x=""+se},stopTracking:function(){l._valueTracker=null,delete l[h]}}}}function xh(l){l._valueTracker||(l._valueTracker=j0(l))}function z0(l){if(!l)return!1;var h=l._valueTracker;if(!h)return!0;var p=h.getValue(),x="";return l&&(x=Mg(l)?l.checked?"true":"false":l.value),l=x,l!==p?(h.setValue(l),!0):!1}function ud(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var sn=/[\n"\\]/g;function ft(l){return l.replace(sn,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function $e(l,h,p,x,O,G,se,me){l.name="",se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?l.type=se:l.removeAttribute("type"),h!=null?se==="number"?(h===0&&l.value===""||l.value!=h)&&(l.value=""+$o(h)):l.value!==""+$o(h)&&(l.value=""+$o(h)):se!=="submit"&&se!=="reset"||l.removeAttribute("value"),h!=null?xt(l,se,$o(h)):p!=null?xt(l,se,$o(p)):x!=null&&l.removeAttribute("value"),O==null&&G!=null&&(l.defaultChecked=!!G),O!=null&&(l.checked=O&&typeof O!="function"&&typeof O!="symbol"),me!=null&&typeof me!="function"&&typeof me!="symbol"&&typeof me!="boolean"?l.name=""+$o(me):l.removeAttribute("name")}function Pe(l,h,p,x,O,G,se,me){if(G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"&&(l.type=G),h!=null||p!=null){if(!(G!=="submit"&&G!=="reset"||h!=null))return;p=p!=null?""+$o(p):"",h=h!=null?""+$o(h):p,me||h===l.value||(l.value=h),l.defaultValue=h}x=x??O,x=typeof x!="function"&&typeof x!="symbol"&&!!x,l.checked=me?l.checked:!!x,l.defaultChecked=!!x,se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"&&(l.name=se)}function xt(l,h,p){h==="number"&&ud(l.ownerDocument)===l||l.defaultValue===""+p||(l.defaultValue=""+p)}function Et(l,h,p,x){if(l=l.options,h){h={};for(var O=0;O<p.length;O++)h["$"+p[O]]=!0;for(p=0;p<l.length;p++)O=h.hasOwnProperty("$"+l[p].value),l[p].selected!==O&&(l[p].selected=O),O&&x&&(l[p].defaultSelected=!0)}else{for(p=""+$o(p),h=null,O=0;O<l.length;O++){if(l[O].value===p){l[O].selected=!0,x&&(l[O].defaultSelected=!0);return}h!==null||l[O].disabled||(h=l[O])}h!==null&&(h.selected=!0)}}function hn(l,h,p){if(h!=null&&(h=""+$o(h),h!==l.value&&(l.value=h),p==null)){l.defaultValue!==h&&(l.defaultValue=h);return}l.defaultValue=p!=null?""+$o(p):""}function $n(l,h,p,x){if(h==null){if(x!=null){if(p!=null)throw Error(r(92));if(_(x)){if(1<x.length)throw Error(r(93));x=x[0]}p=x}p==null&&(p=""),h=p}p=$o(h),l.defaultValue=p,x=l.textContent,x===p&&x!==""&&x!==null&&(l.value=x)}function pi(l,h){if(h){var p=l.firstChild;
vendor: 4,140 bytes, line 41
41if(p&&p===l.lastChild&&p.nodeType===3){p.nodeValue=h;return}}l.textContent=h}var Br=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function wa(l,h,p){var x=h.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?x?l.setProperty(h,""):h==="float"?l.cssFloat="":l[h]="":x?l.setProperty(h,p):typeof p!="number"||p===0||Br.has(h)?h==="float"?l.cssFloat=p:l[h]=(""+p).trim():l[h]=p+"px"}function dd(l,h,p){if(h!=null&&typeof h!="object")throw Error(r(62));if(l=l.style,p!=null){for(var x in p)!p.hasOwnProperty(x)||h!=null&&h.hasOwnProperty(x)||(x.indexOf("--")===0?l.setProperty(x,""):x==="float"?l.cssFloat="":l[x]="");for(var O in h)x=h[O],h.hasOwnProperty(O)&&p[O]!==x&&wa(l,O,x)}else for(var G in h)h.hasOwnProperty(G)&&wa(l,G,h[G])}function F0(l){if(l.indexOf("-")===-1)return!1;switch(l){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 pb=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
41-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),M4=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function W0(l){return M4.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}var gb=null;function CE(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var kg=null,Og=null;function TE(l){var h=ga(l);if(h&&(l=h.stateNode)){var p=l[Ce]||null;e:switch(l=h.stateNode,h.type){case"input":if($e(l,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),h=p.name,p.type==="radio"&&h!=null){for(p=l;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+ft(""+h)+'"][type="radio"]'),h=0;h<p.length;h++){var x=p[h];if(x!==l&&x.form===l.form){var O=x[Ce]||null;if(!O)throw Error(r(90));$e(x,O.value,O.defaultValue,O.defaultValue,O.checked,O.defaultChecked,O.type,O.name)}}for(h=0;h<p.length;h++)x=p[h],x.form===l.form&&z0(x)}break e;case"textarea":hn(l,p.value,p.defaultValue);break e;case"select":h=p.value,h!=null&&Et(l,!!p.multiple,h,!1)}}}var IE=!1;function k4(l,h,p){if(IE)return l(h,p);IE=!0;try{var x=l(h);return x}finally{if(IE=!1,(kg!==null||Og!==null)&&(gv(),kg&&(h=kg,l=Og,Og=kg=null,TE(h),l)))for(h=0;h<l.length;h++)TE(l[h])}}function H0(l,h){var p=l.stateNode;if(p===null)return null;var x=p[Ce]||null;if(x===null)return null;p=x[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(l=l.type,x=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!x;break e;default:l=!1}if(l)return null;if(p&&typeof p!="function")throw Error(r(231,h,typeof p));return p}var hd=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V0=!1;if(hd)try{var q0={};Object.defineProperty(q0,"passive",{get:function(){V0=!0}}),window.addEventListener("test",q0,q0),window.removeEventListener("test",q0,q0)}catch{V0=!1}var Eh=null,NE=null,mb=null;function O4(){if(mb)return mb;var l,h=NE,p=h.length,x,O="value"in Eh?Eh.value:Eh.textContent,G=O.length;for(l=0;l<p&&h[l]===O[l];l++);var se=p-l;for(x=1;x<=se&&h[p-x]===O[G-x];x++);return mb=O.slice(l,1<x?1-x:void 0)}function gi(l){var h=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&h===13&&(l=13)):l=h,l===10&&(l=13),32<=l||l===13?l:0}function li(){return!0}function P4(){return!1}function ya(l){function h(p,x,O,G,se){this._reactName=p,this._targetInst=O,this.type=x,this.nativeEvent=G,this.target=se,this.currentTarget=null;for(var me in l)l.hasOwnProperty(me)&&(p=l[me],this[me]=p?p(G):G[me]);return this.isDefaultPrevented=(G.defaultPrevented!=null?G.defaultPrevented:G.returnValue===!1)?li:P4,this.isPropagationStopped=P4,this}return d(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=li)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=li)},persist:function(){},isPersistent:li}),h}var np={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wb=ya(np),K0=d({},np,{view:0,detail:0}),oM=ya(K0),yb,RE,ws,Pg=d({},K0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hu,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==ws&&(ws&&l.type==="mousemove"?(yb=l.screenX-ws.screenX,RE=l.screenY-ws.screenY):RE=yb=0,ws=l),yb)},movementY:function(l){return"movementY"in l?l.movementY:RE}}),Ah=ya(Pg),D4=d({},Pg,{dataTransfer:0}),ME=ya(D4),kc=d({},K0,{relatedTarget:0}),bb=ya(kc),B4=d({},np,{animationName:0,elapsedTime:0,pseudoElement:0}),L4=ya(B4),$4=d({},np,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),U4=ya($4),j4=d({},np,{data:0}),ba=ya(j4),aM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Oc={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"},cM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function z4(l){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(l):(l=cM[l])?!!h[l]:!1}function hu(){return z4}var vb=d({},K0,{key:function(l){if(l.key){var h=aM[l.key]||l.key;if(h!=="Unidentified")return h}
vendor: 4,053 bytes, line 41
41return l.type==="keypress"?(l=gi(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Oc[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hu,charCode:function(l){return l.type==="keypress"?gi(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?gi(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),kE=ya(vb),Hi=d({},Pg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fd=ya(Hi),OE=d({},K0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hu}),lM=ya(OE),PE=d({},np,{propertyName:0,elapsedTime:0,pseudoElement:0}),uM=ya(PE),dM=d({},Pg,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),hM=ya(dM),F4=d({},np,{newState:0,oldState:0}),xb=ya(F4),Dg=[9,13,27,32],DE=hd&&"CompositionEvent"in window,Bg=null;hd&&"documentMode"in document&&(Bg=document.documentMode);var W4=hd&&"TextEvent"in window&&!Bg,Eb=hd&&(!DE||Bg&&8<Bg&&11>=Bg),Ab=" ",BE=!1;function H4(l,h){switch(l){case"keyup":return Dg.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sb(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Sh=!1;function fM(l,h){switch(l){case"compositionend":return Sb(h);case"keypress":return h.which!==32?null:(BE=!0,Ab);case"textInput":return l=h.data,l===Ab&&BE?null:l;default:return null}}function V4(l,h){if(Sh)return l==="compositionend"||!DE&&H4(l,h)?(l=O4(),mb=NE=Eh=null,Sh=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return Eb&&h.locale!=="ko"?null:h.data;default:return null}}var tc={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 _b(l){var h=l&&l.nodeName&&l.nodeName.toLowerCase();return h==="input"?!!tc[l.type]:h==="textarea"}function Lg(l,h,p,x){kg?Og?Og.push(x):Og=[x]:kg=x,h=Ev(h,"onChange"),0<h.length&&(p=new wb("onChange","change",null,p,x),l.push({event:p,listeners:h}))}var $g=null,Ug=null;function pM(l){vT(l,0)}function Cb(l){var h=Kr(l);if(z0(h))return l}function q4(l,h){if(l==="change")return h}var K4=!1;if(hd){var LE;if(hd){var _h="oninput"in document;if(!_h){var Y4=document.createElement("div");Y4.setAttribute("oninput","return;"),_h=typeof Y4.oninput=="function"}LE=_h}else LE=!1;K4=LE&&(!document.documentMode||9<document.documentMode)}function G4(){$g&&($g.detachEvent("onpropertychange",Tb),Ug=$g=null)}function Tb(l){if(l.propertyName==="value"&&Cb(Ug)){var h=[];Lg(h,Ug,l,CE(l)),k4(pM,h)}}function Z4(l,h,p){l==="focusin"?(G4(),$g=h,Ug=p,$g.attachEvent("onpropertychange",Tb)):l==="focusout"&&G4()}function Ch(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Cb(Ug)}function Ib(l,h){if(l==="click")return Cb(h)}function gM(l,h){if(l==="input"||l==="change")return Cb(h)}function mM(l,h){return l===h&&(l!==0||1/l===1/h)||l!==l&&h!==h}var nc=typeof Object.is=="function"?Object.is:mM;function fu(l,h){if(nc(l,h))return!0;if(typeof l!="object"||l===null||typeof h!="object"||h===null)return!1;var p=Object.keys(l),x=Object.keys(h);if(p.length!==x.length)return!1;for(x=0;x<p.length;x++){var O=p[x];if(!et.call(h,O)||!nc(l[O],h[O]))return!1}return!0}function Pc(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function $E(l,h){var p=Pc(l);l=0;for(var x;p;){if(p.nodeType===3){if(x=l+p.textContent.length,l<=h&&x>=h)return{node:p,offset:h-l};l=x}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Pc(p)}}
vendor: 110,802 bytes, lines 41-42
41function Q4(l,h){return l&&h?l===h?!0:l&&l.nodeType===3?!1:h&&h.nodeType===3?Q4(l,h.parentNode):"contains"in l?l.contains(h):l.compareDocumentPosition?!!(l.compareDocumentPosition(h)&16):!1:!1}function X4(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var h=ud(l.document);h instanceof l.HTMLIFrameElement;){try{var p=typeof h.contentWindow.location.href=="string"}catch{p=!1}if(p)l=h.contentWindow;else break;h=ud(l.document)}return h}function UE(l){var h=l&&l.nodeName&&l.nodeName.toLowerCase();return h&&(h==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||h==="textarea"||l.contentEditable==="true")}var wM=hd&&"documentMode"in document&&11>=document.documentMode,jg=null,Th=null,Oe=null,st=!1;function Je(l,h,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;st||jg==null||jg!==ud(x)||(x=jg,"selectionStart"in x&&UE(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Oe&&fu(Oe,x)||(Oe=x,x=Ev(Th,"onSelect"),0<x.length&&(h=new wb("onSelect","select",null,h,p),l.push({event:h,listeners:x}),h.target=jg)))}function Gt(l,h){var p={};return p[l.toLowerCase()]=h.toLowerCase(),p["Webkit"+l]="webkit"+h,p["Moz"+l]="moz"+h,p}var Kn={animationend:Gt("Animation","AnimationEnd"),animationiteration:Gt("Animation","AnimationIteration"),animationstart:Gt("Animation","AnimationStart"),transitionrun:Gt("Transition","TransitionRun"),transitionstart:Gt("Transition","TransitionStart"),transitioncancel:Gt("Transition","TransitionCancel"),transitionend:Gt("Transition","TransitionEnd")},Lr={},_s={};hd&&(_s=document.createElement("div").style,"AnimationEvent"in window||(delete Kn.animationend.animation,delete Kn.animationiteration.animation,delete Kn.animationstart.animation),"TransitionEvent"in window||delete Kn.transitionend.transition);function $r(l){if(Lr[l])return Lr[l];if(!Kn[l])return l;var h=Kn[l],p;for(p in h)if(h.hasOwnProperty(p)&&p in _s)return Lr[l]=h[p];return l}var Nb=$r("animationend"),J4=$r("animationiteration"),rc=$r("animationstart"),Rb=$r("transitionrun"),yM=$r("transitionstart"),zg=$r("transitioncancel"),Y0=$r("transitionend"),G0=new Map,Gr="abort auxClick beforeToggle 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(" ");Gr.push("scrollEnd");function Il(l,h){G0.set(l,h),ma(h,[l])}var jE=new WeakMap;function Uo(l,h){if(typeof l=="object"&&l!==null){var p=jE.get(l);return p!==void 0?p:(h={value:l,source:h,stack:ld(h)},jE.set(l,h),h)}return{value:l,source:h,stack:ld(h)}}var Dc=[],Fg=0,zE=0;function rp(){for(var l=Fg,h=zE=Fg=0;h<l;){var p=Dc[h];Dc[h++]=null;var x=Dc[h];Dc[h++]=null;var O=Dc[h];Dc[h++]=null;var G=Dc[h];if(Dc[h++]=null,x!==null&&O!==null){var se=x.pending;se===null?O.next=O:(O.next=se.next,se.next=O),x.pending=O}G!==0&&Z0(p,O,G)}}function Nl(l,h,p,x){Dc[Fg++]=l,Dc[Fg++]=h,Dc[Fg++]=p,Dc[Fg++]=x,zE|=x,l.lanes|=x,l=l.alternate,l!==null&&(l.lanes|=x)}function Wg(l,h,p,x){return Nl(l,h,p,x),Q0(l)}function ip(l,h){return Nl(l,null,null,h),Q0(l)}function Z0(l,h,p){l.lanes|=p;var x=l.alternate;x!==null&&(x.lanes|=p);for(var O=!1,G=l.return;G!==null;)G.childLanes|=p,x=G.alternate,x!==null&&(x.childLanes|=p),G.tag===22&&(l=G.stateNode,l===null||l._visibility&1||(O=!0)),l=G,G=G.return;return l.tag===3?(G=l.stateNode,O&&h!==null&&(O=31-yt(p),l=G.hiddenUpdates,x=l[O],x===null?l[O]=[h]:x.push(h),h.lane=p|536870912),G):null}function Q0(l){if(50<dm)throw dm=0,D3=null,Error(r(185));for(var h=l.return;h!==null;)l=h,h=l.return;return l.tag===3?l.stateNode:null}var sp={};function Mb(l,h,p,x){this.tag=l,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function va(l,h,p,x){return new Mb(l,h,p,x)}function op(l){return l=l.prototype,!(!l||!l.isReactComponent)}function jo(l,h){var p=l.alternate;return p===null?(p=va(l.tag,h,l.key,l.mode),p.elementType=l.elementType,p.type=l.type,p.stateNode=l.stateNode,p.alternate=l,l.alternate=p):(p.pendingProps=h,p.type=l.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=l.flags&65011712,p.childLanes=l.childLanes,p.lanes=l.lanes,p.child=l.child,p.memoizedProps=l.memoizedProps,p.memoizedState=l.memoizedState,p.updateQueue=l.updateQueue,h=l.dependencies,p.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},p.sibling=l.sibling,p.index=l.index,p.ref=l.ref,p.refCleanup=l.refCleanup,p}function X0(l,h){l.flags&=65011714;var p=l.alternate;return p===null?(l.childLanes=0,l.lanes=h,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=p.childLanes,l.lanes=p.lanes,l.child=p.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=p.memoizedProps,l.memoizedState=p.memoizedState,l.updateQueue=p.updateQueue,l.type=p.type,h=p.dependencies,l.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext}),l}function kb(l,h,p,x,O,G){var se=0;if(x=l,typeof l=="function")op(l)&&(se=1);else if(typeof l=="string")se=GM(l,p,Z.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case k:return l=va(31,p,h,O),l.elementType=k,l.lanes=G,l;case y:return ap(p.children,O,G,h);case b:se=8,O|=24;break;case E:return l=va(12,p,h,O|2),l.elementType=E,l.lanes=G,l;case L:return l=va(13,p,h,O),l.elementType=L,l.lanes=G,l;case U:return l=va(19,p,h,O),l.elementType=U,l.lanes=G,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case T:case I:se=10;break e;case N:se=9;break e;case H:se=11;break e;case K:se=14;break e;case Y:se=16,x=null;break e}se=29,p=Error(r(130,l===null?"null":typeof l,"")),x=null}return h=va(se,p,h,O),h.elementType=l,h.type=x,h.lanes=G,h}function ap(l,h,p,x){return l=va(7,l,x,h),l.lanes=p,l}function FE(l,h,p){return l=va(6,l,null,h),l.lanes=p,l}function Hg(l,h,p){return h=va(4,l.children!==null?l.children:[],l.key,h),h.lanes=p,h.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},h}var pd=[],Ih=0,Ob=null,J0=0,Bc=[],Lc=0,Di=null,Vi=1,gd="";function cp(l,h){pd[Ih++]=J0,pd[Ih++]=Ob,Ob=l,J0=h}function WE(l,h,p){Bc[Lc++]=Vi,Bc[Lc++]=gd,Bc[Lc++]=Di,Di=l;var x=Vi;l=gd;var O=32-yt(x)-1;x&=~(1<<O),p+=1;var G=32-yt(h)+O;if(30<G){var se=O-O%5;G=(x&(1<<se)-1).toString(32),x>>=se,O-=se,Vi=1<<32-yt(h)+O|p<<O|x,gd=G+l}else Vi=1<<G|p<<O|x,gd=l}function HE(l){l.return!==null&&(cp(l,1),WE(l,1,0))}function ew(l){for(;l===Ob;)Ob=pd[--Ih],pd[Ih]=null,J0=pd[--Ih],pd[Ih]=null;for(;l===Di;)Di=Bc[--Lc],Bc[Lc]=null,gd=Bc[--Lc],Bc[Lc]=null,Vi=Bc[--Lc],Bc[Lc]=null}var Ps=null,qi=null,Cr=!1,Rl=null,xa=!1,Vg=Error(r(519));function $c(l){var h=Error(r(418,""));throw Nh(Uo(h,l)),Vg}function e5(l){var h=l.stateNode,p=l.type,x=l.memoizedProps;switch(h[ye]=l,h[Ce]=x,p){case"dialog":Sr("cancel",h),Sr("close",h);break;case"iframe":case"object":case"embed":Sr("load",h);break;case"video":case"audio":for(p=0;p<Fw.length;p++)Sr(Fw[p],h);break;case"source":Sr("error",h);break;case"img":case"image":case"link":Sr("error",h),Sr("load",h);break;case"details":Sr("toggle",h);break;case"input":Sr("invalid",h),Pe(h,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0),xh(h);break;case"select":Sr("invalid",h);break;case"textarea":Sr("invalid",h),$n(h,x.value,x.defaultValue,x.children),xh(h)}p=x.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||h.textContent===""+p||x.suppressHydrationWarning===!0||AT(h.textContent,p)?(x.popover!=null&&(Sr("beforetoggle",h),Sr("toggle",h)),x.onScroll!=null&&Sr("scroll",h),x.onScrollEnd!=null&&Sr("scrollend",h),x.onClick!=null&&(h.onclick=Av),h=!0):h=!1,h||$c(l)}function t5(l){for(Ps=l.return;Ps;)switch(Ps.tag){case 5:case 13:xa=!1;return;case 27:case 3:xa=!0;return;default:Ps=Ps.return}}function tw(l){if(l!==Ps)return!1;if(!Cr)return t5(l),Cr=!0,!1;var h=l.tag,p;if((p=h!==3&&h!==27)&&((p=h===5)&&(p=l.type,p=!(p!=="form"&&p!=="button")||_v(l.type,l.memoizedProps)),p=!p),p&&qi&&$c(l),t5(l),h===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));e:{for(l=l.nextSibling,h=0;l;){if(l.nodeType===8)if(p=l.data,p==="/$"){if(h===0){qi=Bl(l.nextSibling);break e}h--}else p!=="$"&&p!=="$!"&&p!=="$?"||h++;l=l.nextSibling}qi=null}}else h===27?(h=qi,Hc(l.type)?(l=G3,G3=null,qi=l):qi=h):qi=Ps?Bl(l.stateNode.nextSibling):null;return!0}function nw(){qi=Ps=null,Cr=!1}function n5(){var l=Rl;return l!==null&&(Na===null?Na=l:Na.push.apply(Na,l),Rl=null),l}function Nh(l){Rl===null?Rl=[l]:Rl.push(l)}var lp=B(null),Rh=null,ge=null;function ic(l,h,p){M(lp,h._currentValue),h._currentValue=p}function Uc(l){l._currentValue=lp.current,C(lp)}function Ea(l,h,p){for(;l!==null;){var x=l.alternate;if((l.childLanes&h)!==h?(l.childLanes|=h,x!==null&&(x.childLanes|=h)):x!==null&&(x.childLanes&h)!==h&&(x.childLanes|=h),l===p)break;l=l.return}}function gr(l,h,p,x){var O=l.child;for(O!==null&&(O.return=l);O!==null;){var G=O.dependencies;if(G!==null){var se=O.child;G=G.firstContext;e:for(;G!==null;){var me=G;G=O;for(var _e=0;_e<h.length;_e++)if(me.context===h[_e]){G.lanes|=p,me=G.alternate,me!==null&&(me.lanes|=p),Ea(G.return,p,l),x||(se=null);break e}G=me.next}}else if(O.tag===18){if(se=O.return,se===null)throw Error(r(341));se.lanes|=p,G=se.alternate,G!==null&&(G.lanes|=p),Ea(se,p,l),se=null}else se=O.child;if(se!==null)se.return=O;else for(se=O;se!==null;){if(se===l){se=null;break}if(O=se.sibling,O!==null){O.return=se.return,se=O;break}se=se.return}O=se}}function rw(l,h,p,x){l=null;for(var O=h,G=!1;O!==null;){if(!G){if((O.flags&524288)!==0)G=!0;else if((O.flags&262144)!==0)break}if(O.tag===10){var se=O.alternate;if(se===null)throw Error(r(387));if(se=se.memoizedProps,se!==null){var me=O.type;nc(O.pendingProps.value,se.value)||(l!==null?l.push(me):l=[me])}}else if(O===we.current){if(se=O.alternate,se===null)throw Error(r(387));se.memoizedState.memoizedState!==O.memoizedState.memoizedState&&(l!==null?l.push(bm):l=[bm])}O=O.return}l!==null&&gr(h,l,p,x),h.flags|=262144}function Pb(l){for(l=l.firstContext;l!==null;){if(!nc(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function up(l){Rh=l,ge=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function os(l){return r5(Rh,l)}function Db(l,h){return Rh===null&&up(l),r5(l,h)}function r5(l,h){var p=h._currentValue;if(h={context:h,memoizedValue:p,next:null},ge===null){if(l===null)throw Error(r(308));ge=h,l.dependencies={lanes:0,firstContext:h},l.flags|=524288}else ge=ge.next=h;return p}var bM=typeof AbortController<"u"?AbortController:function(){var l=[],h=this.signal={aborted:!1,addEventListener:function(p,x){l.push(x)}};this.abort=function(){h.aborted=!0,l.forEach(function(p){return p()})}},vM=n.unstable_scheduleCallback,xM=n.unstable_NormalPriority,Ei={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function VE(){return{controller:new bM,data:new Map,refCount:0}}function iw(l){l.refCount--,l.refCount===0&&vM(xM,function(){l.controller.abort()})}var sw=null,qE=0,qg=0,Aa=null;function EM(l,h){if(sw===null){var p=sw=[];qE=0,qg=xv(),Aa={status:"pending",value:void 0,then:function(x){p.push(x)}}}return qE++,h.then(i5,i5),h}function i5(){if(--qE===0&&sw!==null){Aa!==null&&(Aa.status="fulfilled");var l=sw;sw=null,qg=0,Aa=null;for(var h=0;h<l.length;h++)(0,l[h])()}}function AM(l,h){var p=[],x={status:"pending",value:null,reason:null,then:function(O){p.push(O)}};return l.then(function(){x.status="fulfilled",x.value=h;for(var O=0;O<p.length;O++)(0,p[O])(h)},function(O){for(x.status="rejected",x.reason=O,O=0;O<p.length;O++)(0,p[O])(void 0)}),x}var s5=R.S;R.S=function(l,h){typeof h=="object"&&h!==null&&typeof h.then=="function"&&EM(l,h),s5!==null&&s5(l,h)};var dp=B(null);function md(){var l=dp.current;return l!==null?l:Oi.pooledCache}function Bb(l,h){h===null?M(dp,dp.current):M(dp,h.pool)}function o5(){var l=md();return l===null?null:{parent:Ei._currentValue,pool:l}}var zo=Error(r(460)),a5=Error(r(474)),Lb=Error(r(542)),KE={then:function(){}};function c5(l){return l=l.status,l==="fulfilled"||l==="rejected"}function $b(){}function YE(l,h,p){switch(p=l[p],p===void 0?l.push(h):p!==h&&(h.then($b,$b),h=p),h.status){case"fulfilled":return h.value;case"rejected":throw l=h.reason,u5(l),l;default:if(typeof h.status=="string")h.then($b,$b);else{if(l=Oi,l!==null&&100<l.shellSuspendCounter)throw Error(r(482));l=h,l.status="pending",l.then(function(x){if(h.status==="pending"){var O=h;O.status="fulfilled",O.value=x}},function(x){if(h.status==="pending"){var O=h;O.status="rejected",O.reason=x}})}switch(h.status){case"fulfilled":return h.value;case"rejected":throw l=h.reason,u5(l),l}throw Kg=h,zo}}var Kg=null;function l5(){if(Kg===null)throw Error(r(459));var l=Kg;return Kg=null,l}function u5(l){if(l===zo||l===Lb)throw Error(r(483))}var pu=!1;function hp(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yg(l,h){l=l.updateQueue,h.updateQueue===l&&(h.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Mh(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function wd(l,h,p){var x=l.updateQueue;if(x===null)return null;if(x=x.shared,(di&2)!==0){var O=x.pending;return O===null?h.next=h:(h.next=O.next,O.next=h),x.pending=h,h=Q0(l),Z0(l,null,p),h}return Nl(l,x,h,p),Q0(l)}function ow(l,h,p){if(h=h.updateQueue,h!==null&&(h=h.shared,(p&4194048)!==0)){var x=h.lanes;x&=l.pendingLanes,p|=x,h.lanes=p,kn(l,p)}}function Ml(l,h){var p=l.updateQueue,x=l.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var O=null,G=null;if(p=p.firstBaseUpdate,p!==null){do{var se={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};G===null?O=G=se:G=G.next=se,p=p.next}while(p!==null);G===null?O=G=h:G=G.next=h}else O=G=h;p={baseState:x.baseState,firstBaseUpdate:O,lastBaseUpdate:G,shared:x.shared,callbacks:x.callbacks},l.updateQueue=p;return}l=p.lastBaseUpdate,l===null?p.firstBaseUpdate=h:l.next=h,p.lastBaseUpdate=h}var aw=!1;function kl(){if(aw){var l=Aa;if(l!==null)throw l}}function So(l,h,p,x){aw=!1;var O=l.updateQueue;pu=!1;var G=O.firstBaseUpdate,se=O.lastBaseUpdate,me=O.shared.pending;if(me!==null){O.shared.pending=null;var _e=me,We=_e.next;_e.next=null,se===null?G=We:se.next=We,se=_e;var ct=l.alternate;ct!==null&&(ct=ct.updateQueue,me=ct.lastBaseUpdate,me!==se&&(me===null?ct.firstBaseUpdate=We:me.next=We,ct.lastBaseUpdate=_e))}if(G!==null){var gt=O.baseState;se=0,ct=We=_e=null,me=G;do{var Ze=me.lane&-536870913,He=Ze!==me.lane;if(He?(Dr&Ze)===Ze:(x&Ze)===Ze){Ze!==0&&Ze===qg&&(aw=!0),ct!==null&&(ct=ct.next={lane:0,tag:me.tag,payload:me.payload,callback:null,next:null});e:{var Wn=l,Un=me;Ze=h;var wi=p;switch(Un.tag){case 1:if(Wn=Un.payload,typeof Wn=="function"){gt=Wn.call(wi,gt,Ze);break e}gt=Wn;break e;case 3:Wn.flags=Wn.flags&-65537|128;case 0:if(Wn=Un.payload,Ze=typeof Wn=="function"?Wn.call(wi,gt,Ze):Wn,Ze==null)break e;gt=d({},gt,Ze);break e;case 2:pu=!0}}Ze=me.callback,Ze!==null&&(l.flags|=64,He&&(l.flags|=8192),He=O.callbacks,He===null?O.callbacks=[Ze]:He.push(Ze))}else He={lane:Ze,tag:me.tag,payload:me.payload,callback:me.callback,next:null},ct===null?(We=ct=He,_e=gt):ct=ct.next=He,se|=Ze;if(me=me.next,me===null){if(me=O.shared.pending,me===null)break;He=me,me=He.next,He.next=null,O.lastBaseUpdate=He,O.shared.pending=null}}while(!0);ct===null&&(_e=gt),O.baseState=_e,O.firstBaseUpdate=We,O.lastBaseUpdate=ct,G===null&&(O.shared.lanes=0),jh|=se,l.lanes=se,l.memoizedState=gt}}function d5(l,h){if(typeof l!="function")throw Error(r(191,l));l.call(h)}function GE(l,h){var p=l.callbacks;if(p!==null)for(l.callbacks=null,l=0;l<p.length;l++)d5(p[l],h)}var fp=B(null),kh=B(0);function yd(l,h){l=Td,M(kh,l),M(fp,h),Td=l|h.baseLanes}function Ub(){M(kh,Td),M(fp,fp.current)}function ZE(){Td=kh.current,C(fp),C(kh)}var Ol=0,fr=null,ui=null,Tr=null,Gg=!1,pp=!1,_o=!1,Zg=0,Oh=0,jc=null,h5=0;function Mr(){throw Error(r(321))}function cw(l,h){if(h===null)return!1;for(var p=0;p<h.length&&p<l.length;p++)if(!nc(l[p],h[p]))return!1;return!0}function QE(l,h,p,x,O,G){return Ol=G,fr=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,R.H=l===null||l.memoizedState===null?_5:g3,_o=!1,G=p(x,O),_o=!1,pp&&(G=p5(h,p,x,O)),f5(l),G}function f5(l){R.H=bw;var h=ui!==null&&ui.next!==null;if(Ol=0,Tr=ui=fr=null,Gg=!1,Oh=0,jc=null,h)throw Error(r(300));l===null||to||(l=l.dependencies,l!==null&&Pb(l)&&(to=!0))}function p5(l,h,p,x){fr=l;var O=0;do{if(pp&&(jc=null),Oh=0,pp=!1,25<=O)throw Error(r(301));if(O+=1,Tr=ui=null,l.updateQueue!=null){var G=l.updateQueue;G.lastEffect=null,G.events=null,G.stores=null,G.memoCache!=null&&(G.memoCache.index=0)}R.H=C5,G=h(p,x)}while(pp);return G}function XE(){var l=R.H,h=l.useState()[0];return h=typeof h.then=="function"?lw(h):h,l=l.useState()[0],(ui!==null?ui.memoizedState:null)!==l&&(fr.flags|=1024),h}function JE(){var l=Zg!==0;return Zg=0,l}function gp(l,h,p){h.updateQueue=l.updateQueue,h.flags&=-2053,l.lanes&=~p}function jb(l){if(Gg){for(l=l.memoizedState;l!==null;){var h=l.queue;h!==null&&(h.pending=null),l=l.next}Gg=!1}Ol=0,Tr=ui=fr=null,pp=!1,Oh=Zg=0,jc=null}function Sa(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tr===null?fr.memoizedState=Tr=l:Tr=Tr.next=l,Tr}function Cs(){if(ui===null){var l=fr.alternate;l=l!==null?l.memoizedState:null}else l=ui.next;var h=Tr===null?fr.memoizedState:Tr.next;if(h!==null)Tr=h,ui=l;else{if(l===null)throw fr.alternate===null?Error(r(467)):Error(r(310));ui=l,l={memoizedState:ui.memoizedState,baseState:ui.baseState,baseQueue:ui.baseQueue,queue:ui.queue,next:null},Tr===null?fr.memoizedState=Tr=l:Tr=Tr.next=l}return Tr}function mp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lw(l){var h=Oh;return Oh+=1,jc===null&&(jc=[]),l=YE(jc,l,h),h=fr,(Tr===null?h.memoizedState:Tr.next)===null&&(h=h.alternate,R.H=h===null||h.memoizedState===null?_5:g3),l}function zb(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return lw(l);if(l.$$typeof===I)return os(l)}throw Error(r(438,String(l)))}function uw(l){var h=null,p=fr.updateQueue;if(p!==null&&(h=p.memoCache),h==null){var x=fr.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(h={data:x.data.map(function(O){return O.slice()}),index:0})))}if(h==null&&(h={data:[],index:0}),p===null&&(p=mp(),fr.updateQueue=p),p.memoCache=h,p=h.data[h.index],p===void 0)for(p=h.data[h.index]=Array(l),x=0;x<l;x++)p[x]=j;return h.index++,p}function gu(l,h){return typeof h=="function"?h(l):h}function Fb(l){var h=Cs();return e3(h,ui,l)}function e3(l,h,p){var x=l.queue;if(x===null)throw Error(r(311));x.lastRenderedReducer=p;var O=l.baseQueue,G=x.pending;if(G!==null){if(O!==null){var se=O.next;O.next=G.next,G.next=se}h.baseQueue=O=G,x.pending=null}if(G=l.baseState,O===null)l.memoizedState=G;else{h=O.next;var me=se=null,_e=null,We=h,ct=!1;do{var gt=We.lane&-536870913;if(gt!==We.lane?(Dr>)===gt:(Ol>)===gt){var Ze=We.revertLane;if(Ze===0)_e!==null&&(_e=_e.next={lane:0,revertLane:0,action:We.action,hasEagerState:We.hasEagerState,eagerState:We.eagerState,next:null}),gt===qg&&(ct=!0);else if((Ol&Ze)===Ze){We=We.next,Ze===qg&&(ct=!0);continue}else gt={lane:0,revertLane:We.revertLane,action:We.action,hasEagerState:We.hasEagerState,eagerState:We.eagerState,next:null},_e===null?(me=_e=gt,se=G):_e=_e.next=gt,fr.lanes|=Ze,jh|=Ze;gt=We.action,_o&&p(G,gt),G=We.hasEagerState?We.eagerState:p(G,gt)}else Ze={lane:gt,revertLane:We.revertLane,action:We.action,hasEagerState:We.hasEagerState,eagerState:We.eagerState,next:null},_e===null?(me=_e=Ze,se=G):_e=_e.next=Ze,fr.lanes|=gt,jh|=gt;We=We.next}while(We!==null&&We!==h);if(_e===null?se=G:_e.next=me,!nc(G,l.memoizedState)&&(to=!0,ct&&(p=Aa,p!==null)))throw p;l.memoizedState=G,l.baseState=se,l.baseQueue=_e,x.lastRenderedState=G}return O===null&&(x.lanes=0),[l.memoizedState,x.dispatch]}function t3(l){var h=Cs(),p=h.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=l;var x=p.dispatch,O=p.pending,G=h.memoizedState;if(O!==null){p.pending=null;var se=O=O.next;do G=l(G,se.action),se=se.next;while(se!==O);nc(G,h.memoizedState)||(to=!0),h.memoizedState=G,h.baseQueue===null&&(h.baseState=G),p.lastRenderedState=G}return[G,x]}function n3(l,h,p){var x=fr,O=Cs(),G=Cr;if(G){if(p===void 0)throw Error(r(407));p=p()}else p=h();var se=!nc((ui||O).memoizedState,p);se&&(O.memoizedState=p,to=!0),O=O.queue;var me=Hb.bind(null,x,O,l);if(fw(2048,8,me,[l]),O.getSnapshot!==h||se||Tr!==null&&Tr.memoizedState.tag&1){if(x.flags|=2048,Qg(9,Gb(),g5.bind(null,x,O,p,h),null),Oi===null)throw Error(r(349));G||(Ol&124)!==0||Wb(x,h,p)}return p}function Wb(l,h,p){l.flags|=16384,l={getSnapshot:h,value:p},h=fr.updateQueue,h===null?(h=mp(),fr.updateQueue=h,h.stores=[l]):(p=h.stores,p===null?h.stores=[l]:p.push(l))}function g5(l,h,p,x){h.value=p,h.getSnapshot=x,r3(h)&&i3(l)}function Hb(l,h,p){return p(function(){r3(h)&&i3(l)})}function r3(l){var h=l.getSnapshot;l=l.value;try{var p=h();return!nc(l,p)}catch{return!0}}function i3(l){var h=ip(l,2);h!==null&&lc(h,l,2)}function Vb(l){var h=Sa();if(typeof l=="function"){var p=l;if(l=p(),_o){lt(!0);try{p()}finally{lt(!1)}}}return h.memoizedState=h.baseState=l,h.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gu,lastRenderedState:l},h}function dw(l,h,p,x){return l.baseState=p,e3(l,ui,typeof x=="function"?x:gu)}function SM(l,h,p,x,O){if(Jb(l))throw Error(r(485));if(l=h.action,l!==null){var G={payload:O,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(se){G.listeners.push(se)}};R.T!==null?p(!0):G.isTransition=!1,x(G),p=h.pending,p===null?(G.next=h.pending=G,s3(h,G)):(G.next=p.next,h.pending=p.next=G)}}function s3(l,h){var p=h.action,x=h.payload,O=l.state;if(h.isTransition){var G=R.T,se={};R.T=se;try{var me=p(O,x),_e=R.S;_e!==null&&_e(se,me),o3(l,h,me)}catch(We){qb(l,h,We)}finally{R.T=G}}else try{G=p(O,x),o3(l,h,G)}catch(We){qb(l,h,We)}}function o3(l,h,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(x){m5(l,h,x)},function(x){return qb(l,h,x)}):m5(l,h,p)}function m5(l,h,p){h.status="fulfilled",h.value=p,w5(h),l.state=p,h=l.pending,h!==null&&(p=h.next,p===h?l.pending=null:(p=p.next,h.next=p,s3(l,p)))}function qb(l,h,p){var x=l.pending;if(l.pending=null,x!==null){x=x.next;do h.status="rejected",h.reason=p,w5(h),h=h.next;while(h!==x)}l.action=null}function w5(l){l=l.listeners;for(var h=0;h<l.length;h++)(0,l[h])()}function Kb(l,h){return h}function a3(l,h){if(Cr){var p=Oi.formState;if(p!==null){e:{var x=fr;if(Cr){if(qi){t:{for(var O=qi,G=xa;O.nodeType!==8;){if(!G){O=null;break t}if(O=Bl(O.nextSibling),O===null){O=null;break t}}G=O.data,O=G==="F!"||G==="F"?O:null}if(O){qi=Bl(O.nextSibling),x=O.data==="F!";break e}}$c(x)}x=!1}x&&(h=p[0])}}return p=Sa(),p.memoizedState=p.baseState=h,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kb,lastRenderedState:h},p.queue=x,p=h3.bind(null,fr,x),x.dispatch=p,x=Vb(!1),G=f3.bind(null,fr,!1,x.queue),x=Sa(),O={state:h,dispatch:null,action:l,pending:null},x.queue=O,p=SM.bind(null,fr,O,G,p),O.dispatch=p,x.memoizedState=l,[h,p,!1]}function Yb(l){var h=Cs();return y5(h,ui,l)}function y5(l,h,p){if(h=e3(l,h,Kb)[0],l=Fb(gu)[0],typeof h=="object"&&h!==null&&typeof h.then=="function")try{var x=lw(h)}catch(se){throw se===zo?Lb:se}else x=h;h=Cs();var O=h.queue,G=O.dispatch;return p!==h.memoizedState&&(fr.flags|=2048,Qg(9,Gb(),c3.bind(null,O,p),null)),[x,G,l]}function c3(l,h){l.action=h}function lr(l){var h=Cs(),p=ui;if(p!==null)return y5(h,p,l);Cs(),h=h.memoizedState,p=Cs();var x=p.queue.dispatch;return p.memoizedState=l,[h,x,!1]}function Qg(l,h,p,x){return l={tag:l,create:p,deps:x,inst:h,next:null},h=fr.updateQueue,h===null&&(h=mp(),fr.updateQueue=h),p=h.lastEffect,p===null?h.lastEffect=l.next=l:(x=p.next,p.next=l,l.next=x,h.lastEffect=l),l}function Gb(){return{destroy:void 0,resource:void 0}}function Xg(){return Cs().memoizedState}function hw(l,h,p,x){var O=Sa();x=x===void 0?null:x,fr.flags|=l,O.memoizedState=Qg(1|h,Gb(),p,x)}function fw(l,h,p,x){var O=Cs();x=x===void 0?null:x;var G=O.memoizedState.inst;ui!==null&&x!==null&&cw(x,ui.memoizedState.deps)?O.memoizedState=Qg(h,G,p,x):(fr.flags|=l,O.memoizedState=Qg(1|h,G,p,x))}function b5(l,h){hw(8390656,8,l,h)}function sc(l,h){fw(2048,8,l,h)}function v5(l,h){return fw(4,2,l,h)}function pw(l,h){return fw(4,4,l,h)}function Zb(l,h){if(typeof h=="function"){l=l();var p=h(l);return function(){typeof p=="function"?p():h(null)}}if(h!=null)return l=l(),h.current=l,function(){h.current=null}}function l3(l,h,p){p=p!=null?p.concat([l]):null,fw(4,4,Zb.bind(null,h,l),p)}function Qb(){}function _a(l,h){var p=Cs();h=h===void 0?null:h;var x=p.memoizedState;return h!==null&&cw(h,x[1])?x[0]:(p.memoizedState=[l,h],l)}function bd(l,h){var p=Cs();h=h===void 0?null:h;var x=p.memoizedState;if(h!==null&&cw(h,x[1]))return x[0];if(x=l(),_o){lt(!0);try{l()}finally{lt(!1)}}return p.memoizedState=[x,h],x}function gw(l,h,p){return p===void 0||(Ol&1073741824)!==0?l.memoizedState=h:(l.memoizedState=p,l=J5(),fr.lanes|=l,jh|=l,p)}function u3(l,h,p,x){return nc(p,h)?p:fp.current!==null?(l=gw(l,p,x),nc(l,h)||(to=!0),l):(Ol&42)===0?(to=!0,l.memoizedState=p):(l=J5(),fr.lanes|=l,jh|=l,h)}function mw(l,h,p,x,O){var G=P.p;P.p=G!==0&&8>G?G:8;var se=R.T,me={};R.T=me,f3(l,!1,h,p);try{var _e=O(),We=R.S;if(We!==null&&We(me,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var ct=AM(_e,x);wp(l,h,ct,To(l))}else wp(l,h,x,To(l))}catch(gt){wp(l,h,{then:function(){},status:"rejected",reason:gt},To())}finally{P.p=G,R.T=se}}function x5(){}function ww(l,h,p,x){if(l.tag!==5)throw Error(r(476));var O=d3(l).queue;mw(l,O,h,q,p===null?x5:function(){return Xb(l),p(x)})}function d3(l){var h=l.memoizedState;if(h!==null)return h;h={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gu,lastRenderedState:q},next:null};var p={};return h.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gu,lastRenderedState:p},next:null},l.memoizedState=h,l=l.alternate,l!==null&&(l.memoizedState=h),h}function Xb(l){var h=d3(l).next.queue;wp(l,h,{},To())}function yw(){return os(bm)}function vd(){return Cs().memoizedState}function E5(){return Cs().memoizedState}function Ph(l){for(var h=l.return;h!==null;){switch(h.tag){case 24:case 3:var p=To();l=Mh(p);var x=wd(h,l,p);x!==null&&(lc(x,h,p),ow(x,h,p)),h={cache:VE()},l.payload=h;return}h=h.return}}function A5(l,h,p){var x=To();p={lane:x,revertLane:0,action:p,hasEagerState:!1,eagerState:null,next:null},Jb(l)?S5(h,p):(p=Wg(l,h,p,x),p!==null&&(lc(p,l,x),p3(p,h,x)))}function h3(l,h,p){var x=To();wp(l,h,p,x)}function wp(l,h,p,x){var O={lane:x,revertLane:0,action:p,hasEagerState:!1,eagerState:null,next:null};if(Jb(l))S5(h,O);else{var G=l.alternate;if(l.lanes===0&&(G===null||G.lanes===0)&&(G=h.lastRenderedReducer,G!==null))try{var se=h.lastRenderedState,me=G(se,p);if(O.hasEagerState=!0,O.eagerState=me,nc(me,se))return Nl(l,h,O,0),Oi===null&&rp(),!1}catch{}finally{}if(p=Wg(l,h,O,x),p!==null)return lc(p,l,x),p3(p,h,x),!0}return!1}function f3(l,h,p,x){if(x={lane:2,revertLane:xv(),action:x,hasEagerState:!1,eagerState:null,next:null},Jb(l)){if(h)throw Error(r(479))}else h=Wg(l,p,x,2),h!==null&&lc(h,l,2)}function Jb(l){var h=l.alternate;return l===fr||h!==null&&h===fr}function S5(l,h){pp=Gg=!0;var p=l.pending;p===null?h.next=h:(h.next=p.next,p.next=h),l.pending=h}function p3(l,h,p){if((p&4194048)!==0){var x=h.lanes;x&=l.pendingLanes,p|=x,h.lanes=p,kn(l,p)}}var bw={readContext:os,use:zb,useCallback:Mr,useContext:Mr,useEffect:Mr,useImperativeHandle:Mr,useLayoutEffect:Mr,useInsertionEffect:Mr,useMemo:Mr,useReducer:Mr,useRef:Mr,useState:Mr,useDebugValue:Mr,useDeferredValue:Mr,useTransition:Mr,useSyncExternalStore:Mr,useId:Mr,useHostTransitionStatus:Mr,useFormState:Mr,useActionState:Mr,useOptimistic:Mr,useMemoCache:Mr,useCacheRefresh:Mr},_5={readContext:os,use:zb,useCallback:function(l,h){return Sa().memoizedState=[l,h===void 0?null:h],l},useContext:os,useEffect:b5,useImperativeHandle:function(l,h,p){p=p!=null?p.concat([l]):null,hw(4194308,4,Zb.bind(null,h,l),p)},useLayoutEffect:function(l,h){return hw(4194308,4,l,h)},useInsertionEffect:function(l,h){hw(4,2,l,h)},useMemo:function(l,h){var p=Sa();h=h===void 0?null:h;var x=l();if(_o){lt(!0);try{l()}finally{lt(!1)}}return p.memoizedState=[x,h],x},useReducer:function(l,h,p){var x=Sa();if(p!==void 0){var O=p(h);if(_o){lt(!0);try{p(h)}finally{lt(!1)}}}else O=h;return x.memoizedState=x.baseState=O,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:O},x.queue=l,l=l.dispatch=A5.bind(null,fr,l),[x.memoizedState,l]},useRef:function(l){var h=Sa();return l={current:l},h.memoizedState=l},useState:function(l){l=Vb(l);var h=l.queue,p=h3.bind(null,fr,h);return h.dispatch=p,[l.memoizedState,p]},useDebugValue:Qb,useDeferredValue:function(l,h){var p=Sa();return gw(p,l,h)},useTransition:function(){var l=Vb(!1);return l=mw.bind(null,fr,l.queue,!0,!1),Sa().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,h,p){var x=fr,O=Sa();if(Cr){if(p===void 0)throw Error(r(407));p=p()}else{if(p=h(),Oi===null)throw Error(r(349));(Dr&124)!==0||Wb(x,h,p)}O.memoizedState=p;var G={value:p,getSnapshot:h};return O.queue=G,b5(Hb.bind(null,x,G,l),[l]),x.flags|=2048,Qg(9,Gb(),g5.bind(null,x,G,p,h),null),p},useId:function(){var l=Sa(),h=Oi.identifierPrefix;if(Cr){var p=gd,x=Vi;p=(x&~(1<<32-yt(x)-1)).toString(32)+p,h="«"+h+"R"+p,p=Zg++,0<p&&(h+="H"+p.toString(32)),h+="»"}else p=h5++,h="«"+h+"r"+p.toString(32)+"»";return l.memoizedState=h},useHostTransitionStatus:yw,useFormState:a3,useActionState:a3,useOptimistic:function(l){var h=Sa();h.memoizedState=h.baseState=l;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return h.queue=p,h=f3.bind(null,fr,!0,p),p.dispatch=h,[l,h]},useMemoCache:uw,useCacheRefresh:function(){return Sa().memoizedState=Ph.bind(null,fr)}},g3={readContext:os,use:zb,useCallback:_a,useContext:os,useEffect:sc,useImperativeHandle:l3,useInsertionEffect:v5,useLayoutEffect:pw,useMemo:bd,useReducer:Fb,useRef:Xg,useState:function(){return Fb(gu)},useDebugValue:Qb,useDeferredValue:function(l,h){var p=Cs();return u3(p,ui.memoizedState,l,h)},useTransition:function(){var l=Fb(gu)[0],h=Cs().memoizedState;return[typeof l=="boolean"?l:lw(l),h]},useSyncExternalStore:n3,useId:vd,useHostTransitionStatus:yw,useFormState:Yb,useActionState:Yb,useOptimistic:function(l,h){var p=Cs();return dw(p,ui,l,h)},useMemoCache:uw,useCacheRefresh:E5},C5={readContext:os,use:zb,useCallback:_a,useContext:os,useEffect:sc,useImperativeHandle:l3,useInsertionEffect:v5,useLayoutEffect:pw,useMemo:bd,useReducer:t3,useRef:Xg,useState:function(){return t3(gu)},useDebugValue:Qb,useDeferredValue:function(l,h){var p=Cs();return ui===null?gw(p,l,h):u3(p,ui.memoizedState,l,h)},useTransition:function(){var l=t3(gu)[0],h=Cs().memoizedState;return[typeof l=="boolean"?l:lw(l),h]},useSyncExternalStore:n3,useId:vd,useHostTransitionStatus:yw,useFormState:lr,useActionState:lr,useOptimistic:function(l,h){var p=Cs();return ui!==null?dw(p,ui,l,h):(p.baseState=l,[l,p.queue.dispatch])},useMemoCache:uw,useCacheRefresh:E5},Ds=null,Ca=0;function ev(l){var h=Ca;return Ca+=1,Ds===null&&(Ds=[]),YE(Ds,l,h)}function vw(l,h){h=h.props.ref,l.ref=h!==void 0?h:null}function yp(l,h){throw h.$$typeof===f?Error(r(525)):(l=Object.prototype.toString.call(h),Error(r(31,l==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":l)))}function bp(l){var h=l._init;return h(l._payload)}function m3(l){function h(Le,Ne){if(l){var ze=Le.deletions;ze===null?(Le.deletions=[Ne],Le.flags|=16):ze.push(Ne)}}function p(Le,Ne){if(!l)return null;for(;Ne!==null;)h(Le,Ne),Ne=Ne.sibling;return null}function x(Le){for(var Ne=new Map;Le!==null;)Le.key!==null?Ne.set(Le.key,Le):Ne.set(Le.index,Le),Le=Le.sibling;return Ne}function O(Le,Ne){return Le=jo(Le,Ne),Le.index=0,Le.sibling=null,Le}function G(Le,Ne,ze){return Le.index=ze,l?(ze=Le.alternate,ze!==null?(ze=ze.index,ze<Ne?(Le.flags|=67108866,Ne):ze):(Le.flags|=67108866,Ne)):(Le.flags|=1048576,Ne)}function se(Le){return l&&Le.alternate===null&&(Le.flags|=67108866),Le}function me(Le,Ne,ze,dt){return Ne===null||Ne.tag!==6?(Ne=FE(ze,Le.mode,dt),Ne.return=Le,Ne):(Ne=O(Ne,ze),Ne.return=Le,Ne)}function _e(Le,Ne,ze,dt){var an=ze.type;return an===y?ct(Le,Ne,ze.props.children,dt,ze.key):Ne!==null&&(Ne.elementType===an||typeof an=="object"&&an!==null&&an.$$typeof===Y&&bp(an)===Ne.type)?(Ne=O(Ne,ze.props),vw(Ne,ze),Ne.return=Le,Ne):(Ne=kb(ze.type,ze.key,ze.props,null,Le.mode,dt),vw(Ne,ze),Ne.return=Le,Ne)}function We(Le,Ne,ze,dt){return Ne===null||Ne.tag!==4||Ne.stateNode.containerInfo!==ze.containerInfo||Ne.stateNode.implementation!==ze.implementation?(Ne=Hg(ze,Le.mode,dt),Ne.return=Le,Ne):(Ne=O(Ne,ze.children||[]),Ne.return=Le,Ne)}function ct(Le,Ne,ze,dt,an){return Ne===null||Ne.tag!==7?(Ne=ap(ze,Le.mode,dt,an),Ne.return=Le,Ne):(Ne=O(Ne,ze),Ne.return=Le,Ne)}function gt(Le,Ne,ze){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return Ne=FE(""+Ne,Le.mode,ze),Ne.return=Le,Ne;if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case m:return ze=kb(Ne.type,Ne.key,Ne.props,null,Le.mode,ze),vw(ze,Ne),ze.return=Le,ze;case w:return Ne=Hg(Ne,Le.mode,ze),Ne.return=Le,Ne;case Y:var dt=Ne._init;return Ne=dt(Ne._payload),gt(Le,Ne,ze)}if(_(Ne)||W(Ne))return Ne=ap(Ne,Le.mode,ze,null),Ne.return=Le,Ne;if(typeof Ne.then=="function")return gt(Le,ev(Ne),ze);if(Ne.$$typeof===I)return gt(Le,Db(Le,Ne),ze);yp(Le,Ne)}return null}function Ze(Le,Ne,ze,dt){var an=Ne!==null?Ne.key:null;if(typeof ze=="string"&&ze!==""||typeof ze=="number"||typeof ze=="bigint")return an!==null?null:me(Le,Ne,""+ze,dt);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case m:return ze.key===an?_e(Le,Ne,ze,dt):null;case w:return ze.key===an?We(Le,Ne,ze,dt):null;case Y:return an=ze._init,ze=an(ze._payload),Ze(Le,Ne,ze,dt)}if(_(ze)||W(ze))return an!==null?null:ct(Le,Ne,ze,dt,null);if(typeof ze.then=="function")return Ze(Le,Ne,ev(ze),dt);if(ze.$$typeof===I)return Ze(Le,Ne,Db(Le,ze),dt);yp(Le,ze)}return null}function He(Le,Ne,ze,dt,an){if(typeof dt=="string"&&dt!==""||typeof dt=="number"||typeof dt=="bigint")return Le=Le.get(ze)||null,me(Ne,Le,""+dt,an);if(typeof dt=="object"&&dt!==null){switch(dt.$$typeof){case m:return Le=Le.get(dt.key===null?ze:dt.key)||null,_e(Ne,Le,dt,an);case w:return Le=Le.get(dt.key===null?ze:dt.key)||null,We(Ne,Le,dt,an);case Y:var mr=dt._init;return dt=mr(dt._payload),He(Le,Ne,ze,dt,an)}if(_(dt)||W(dt))return Le=Le.get(ze)||null,ct(Ne,Le,dt,an,null);if(typeof dt.then=="function")return He(Le,Ne,ze,ev(dt),an);if(dt.$$typeof===I)return He(Le,Ne,ze,Db(Ne,dt),an);yp(Ne,dt)}return null}function Wn(Le,Ne,ze,dt){for(var an=null,mr=null,Tn=Ne,Hn=Ne=0,io=null;Tn!==null&&Hn<ze.length;Hn++){Tn.index>Hn?(io=Tn,Tn=null):io=Tn.sibling;var Ur=Ze(Le,Tn,ze[Hn],dt);if(Ur===null){Tn===null&&(Tn=io);break}l&&Tn&&Ur.alternate===null&&h(Le,Tn),Ne=G(Ur,Ne,Hn),mr===null?an=Ur:mr.sibling=Ur,mr=Ur,Tn=io}if(Hn===ze.length)return p(Le,Tn),Cr&&cp(Le,Hn),an;if(Tn===null){for(;Hn<ze.length;Hn++)Tn=gt(Le,ze[Hn],dt),Tn!==null&&(Ne=G(Tn,Ne,Hn),mr===null?an=Tn:mr.sibling=Tn,mr=Tn);return Cr&&cp(Le,Hn),an}for(Tn=x(Tn);Hn<ze.length;Hn++)io=He(Tn,Le,Hn,ze[Hn],dt),io!==null&&(l&&io.alternate!==null&&Tn.delete(io.key===null?Hn:io.key),Ne=G(io,Ne,Hn),mr===null?an=io:mr.sibling=io,mr=io);return l&&Tn.forEach(function(Zh){return h(Le,Zh)}),Cr&&cp(Le,Hn),an}function Un(Le,Ne,ze,dt){if(ze==null)throw Error(r(151));for(var an=null,mr=null,Tn=Ne,Hn=Ne=0,io=null,Ur=ze.next();Tn!==null&&!Ur.done;Hn++,Ur=ze.next()){Tn.index>Hn?(io=Tn,Tn=null):io=Tn.sibling;var Zh=Ze(Le,Tn,Ur.value,dt);if(Zh===null){Tn===null&&(Tn=io);break}l&&Tn&&Zh.alternate===null&&h(Le,Tn),Ne=G(Zh,Ne,Hn),mr===null?an=Zh:mr.sibling=Zh,mr=Zh,Tn=io}if(Ur.done)return p(Le,Tn),Cr&&cp(Le,Hn),an;if(Tn===null){for(;!Ur.done;Hn++,Ur=ze.next())Ur=gt(Le,Ur.value,dt),Ur!==null&&(Ne=G(Ur,Ne,Hn),mr===null?an=Ur:mr.sibling=Ur,mr=Ur);return Cr&&cp(Le,Hn),an}for(Tn=x(Tn);!Ur.done;Hn++,Ur=ze.next())Ur=He(Tn,Le,Hn,Ur.value,dt),Ur!==null&&(l&&Ur.alternate!==null&&Tn.delete(Ur.key===null?Hn:Ur.key),Ne=G(Ur,Ne,Hn),mr===null?an=Ur:mr.sibling=Ur,mr=Ur);return l&&Tn.forEach(function(ok){return h(Le,ok)}),Cr&&cp(Le,Hn),an}function wi(Le,Ne,ze,dt){if(typeof ze=="object"&&ze!==null&&ze.type===y&&ze.key===null&&(ze=ze.props.children),typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case m:e:{for(var an=ze.key;Ne!==null;){if(Ne.key===an){if(an=ze.type,an===y){if(Ne.tag===7){p(Le,Ne.sibling),dt=O(Ne,ze.props.children),dt.return=Le,Le=dt;break e}}else if(Ne.elementType===an||typeof an=="object"&&an!==null&&an.$$typeof===Y&&bp(an)===Ne.type){p(Le,Ne.sibling),dt=O(Ne,ze.props),vw(dt,ze),dt.return=Le,Le=dt;break e}p(Le,Ne);break}else h(Le,Ne);Ne=Ne.sibling}ze.type===y?(dt=ap(ze.props.children,Le.mode,dt,ze.key),dt.return=Le,Le=dt):(dt=kb(ze.type,ze.key,ze.props,null,Le.mode,dt),vw(dt,ze),dt.return=Le,Le=dt)}return se(Le);case w:e:{for(an=ze.key;Ne!==null;){if(Ne.key===an)if(Ne.tag===4&&Ne.stateNode.containerInfo===ze.containerInfo&&Ne.stateNode.implementation===ze.implementation){p(Le,Ne.sibling),dt=O(Ne,ze.children||[]),dt.return=Le,Le=dt;break e}else{p(Le,Ne);break}else h(Le,Ne);Ne=Ne.sibling}dt=Hg(ze,Le.mode,dt),dt.return=Le,Le=dt}return se(Le);case Y:return an=ze._init,ze=an(ze._payload),wi(Le,Ne,ze,dt)}if(_(ze))return Wn(Le,Ne,ze,dt);if(W(ze)){if(an=W(ze),typeof an!="function")throw Error(r(150));return ze=an.call(ze),Un(Le,Ne,ze,dt)}if(typeof ze.then=="function")return wi(Le,Ne,ev(ze),dt);if(ze.$$typeof===I)return wi(Le,Ne,Db(Le,ze),dt);yp(Le,ze)}return typeof ze=="string"&&ze!==""||typeof ze=="number"||typeof ze=="bigint"?(ze=""+ze,Ne!==null&&Ne.tag===6?(p(Le,Ne.sibling),dt=O(Ne,ze),dt.return=Le,Le=dt):(p(Le,Ne),dt=FE(ze,Le.mode,dt),dt.return=Le,Le=dt),se(Le)):p(Le,Ne)}return function(Le,Ne,ze,dt){try{Ca=0;var an=wi(Le,Ne,ze,dt);return Ds=null,an}catch(Tn){if(Tn===zo||Tn===Lb)throw Tn;var mr=va(29,Tn,null,Le.mode);return mr.lanes=dt,mr.return=Le,mr}finally{}}}var vp=m3(!0),T5=m3(!1),oc=B(null),Fo=null;function zc(l){var h=l.alternate;M(as,as.current&1),M(oc,l),Fo===null&&(h===null||fp.current!==null||h.memoizedState!==null)&&(Fo=l)}function I5(l){if(l.tag===22){if(M(as,as.current),M(oc,l),Fo===null){var h=l.alternate;h!==null&&h.memoizedState!==null&&(Fo=l)}}else xd()}function xd(){M(as,as.current),M(oc,oc.current)}function mu(l){C(oc),Fo===l&&(Fo=null),C(as)}var as=B(0);function xw(l){for(var h=l;h!==null;){if(h.tag===13){var p=h.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||Ho(p)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}function Jg(l,h,p,x){h=l.memoizedState,p=p(x,h),p=p==null?h:d({},h,p),l.memoizedState=p,l.lanes===0&&(l.updateQueue.baseState=p)}var Ew={enqueueSetState:function(l,h,p){l=l._reactInternals;var x=To(),O=Mh(x);O.payload=h,p!=null&&(O.callback=p),h=wd(l,O,x),h!==null&&(lc(h,l,x),ow(h,l,x))},enqueueReplaceState:function(l,h,p){l=l._reactInternals;var x=To(),O=Mh(x);O.tag=1,O.payload=h,p!=null&&(O.callback=p),h=wd(l,O,x),h!==null&&(lc(h,l,x),ow(h,l,x))},enqueueForceUpdate:function(l,h){l=l._reactInternals;var p=To(),x=Mh(p);x.tag=2,h!=null&&(x.callback=h),h=wd(l,x,p),h!==null&&(lc(h,l,p),ow(h,l,p))}};function Aw(l,h,p,x,O,G,se){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,G,se):h.prototype&&h.prototype.isPureReactComponent?!fu(p,x)||!fu(O,G):!0}function N5(l,h,p,x){l=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(p,x),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(p,x),h.state!==l&&Ew.enqueueReplaceState(h,h.state,null)}function Dh(l,h){var p=h;if("ref"in h){p={};for(var x in h)x!=="ref"&&(p[x]=h[x])}if(l=l.defaultProps){p===h&&(p=d({},p));for(var O in l)p[O]===void 0&&(p[O]=l[O])}return p}var xp=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var h=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(h))return}else if(typeof Ji=="object"&&typeof Ji.emit=="function"){Ji.emit("uncaughtException",l);return}console.error(l)};function w3(l){xp(l)}function tv(l){console.error(l)}function R5(l){xp(l)}function Sw(l,h){try{var p=l.onUncaughtError;p(h.value,{componentStack:h.stack})}catch(x){setTimeout(function(){throw x})}}function wu(l,h,p){try{var x=l.onCaughtError;x(p.value,{componentStack:p.stack,errorBoundary:h.tag===1?h.stateNode:null})}catch(O){setTimeout(function(){throw O})}}function nv(l,h,p){return p=Mh(p),p.tag=3,p.payload={element:null},p.callback=function(){Sw(l,h)},p}function y3(l){return l=Mh(l),l.tag=3,l}function M5(l,h,p,x){var O=p.type.getDerivedStateFromError;if(typeof O=="function"){var G=x.value;l.payload=function(){return O(G)},l.callback=function(){wu(h,p,x)}}var se=p.stateNode;se!==null&&typeof se.componentDidCatch=="function"&&(l.callback=function(){wu(h,p,x),typeof O!="function"&&(zh===null?zh=new Set([this]):zh.add(this));var me=x.stack;this.componentDidCatch(x.value,{componentStack:me!==null?me:""})})}function k5(l,h,p,x,O){if(p.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(h=p.alternate,h!==null&&rw(h,p,O,!0),p=oc.current,p!==null){switch(p.tag){case 13:return Fo===null?L3():p.alternate===null&&cs===0&&(cs=3),p.flags&=-257,p.flags|=65536,p.lanes=O,x===KE?p.flags|=16384:(h=p.updateQueue,h===null?p.updateQueue=new Set([x]):h.add(x),j3(l,x,O)),!1;case 22:return p.flags|=65536,x===KE?p.flags|=16384:(h=p.updateQueue,h===null?(h={transitions:null,markerInstances:null,retryQueue:new Set([x])},p.updateQueue=h):(p=h.retryQueue,p===null?h.retryQueue=new Set([x]):p.add(x)),j3(l,x,O)),!1}throw Error(r(435,p.tag))}return j3(l,x,O),L3(),!1}if(Cr)return h=oc.current,h!==null?((h.flags&65536)===0&&(h.flags|=256),h.flags|=65536,h.lanes=O,x!==Vg&&(l=Error(r(422),{cause:x}),Nh(Uo(l,p)))):(x!==Vg&&(h=Error(r(423),{cause:x}),Nh(Uo(h,p))),l=l.current.alternate,l.flags|=65536,O&=-O,l.lanes|=O,x=Uo(x,p),O=nv(l.stateNode,x,O),Ml(l,O),cs!==4&&(cs=2)),!1;var G=Error(r(520),{cause:x});if(G=Uo(G,p),Pw===null?Pw=[G]:Pw.push(G),cs!==4&&(cs=2),h===null)return!0;x=Uo(x,p),p=h;do{switch(p.tag){case 3:return p.flags|=65536,l=O&-O,p.lanes|=l,l=nv(p.stateNode,x,l),Ml(p,l),!1;case 1:if(h=p.type,G=p.stateNode,(p.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(zh===null||!zh.has(G))))return p.flags|=65536,O&=-O,p.lanes|=O,O=y3(O),M5(O,l,p,x),Ml(p,O),!1}p=p.return}while(p!==null);return!1}var O5=Error(r(461)),to=!1;function Bi(l,h,p,x){h.child=l===null?T5(h,null,p,x):vp(h,l.child,p,x)}function rv(l,h,p,x,O){p=p.render;var G=h.ref;if("ref"in x){var se={};for(var me in x)me!=="ref"&&(se[me]=x[me])}else se=x;return up(h),x=QE(l,h,p,se,G,O),me=JE(),l!==null&&!to?(gp(l,h,O),Ed(l,h,O)):(Cr&&me&&HE(h),h.flags|=1,Bi(l,h,x,O),h.child)}function iv(l,h,p,x,O){if(l===null){var G=p.type;return typeof G=="function"&&!op(G)&&G.defaultProps===void 0&&p.compare===null?(h.tag=15,h.type=G,sv(l,h,G,x,O)):(l=kb(p.type,null,x,h,h.mode,O),l.ref=h.ref,l.return=h,h.child=l)}if(G=l.child,!Pl(l,O)){var se=G.memoizedProps;if(p=p.compare,p=p!==null?p:fu,p(se,x)&&l.ref===h.ref)return Ed(l,h,O)}return h.flags|=1,l=jo(G,x),l.ref=h.ref,l.return=h,h.child=l}function sv(l,h,p,x,O){if(l!==null){var G=l.memoizedProps;if(fu(G,x)&&l.ref===h.ref)if(to=!1,h.pendingProps=x=G,Pl(l,O))(l.flags&131072)!==0&&(to=!0);else return h.lanes=l.lanes,Ed(l,h,O)}return em(l,h,p,x,O)}function _w(l,h,p){var x=h.pendingProps,O=x.children,G=l!==null?l.memoizedState:null;if(x.mode==="hidden"){if((h.flags&128)!==0){if(x=G!==null?G.baseLanes|p:p,l!==null){for(O=h.child=l.child,G=0;O!==null;)G=G|O.lanes|O.childLanes,O=O.sibling;h.childLanes=G&~x}else h.childLanes=0,h.child=null;return Ep(l,h,x,p)}if((p&536870912)!==0)h.memoizedState={baseLanes:0,cachePool:null},l!==null&&Bb(h,G!==null?G.cachePool:null),G!==null?yd(h,G):Ub(),I5(h);else return h.lanes=h.childLanes=536870912,Ep(l,h,G!==null?G.baseLanes|p:p,p)}else G!==null?(Bb(h,G.cachePool),yd(h,G),xd(),h.memoizedState=null):(l!==null&&Bb(h,null),Ub(),xd());return Bi(l,h,O,p),h.child}function Ep(l,h,p,x){var O=md();return O=O===null?null:{parent:Ei._currentValue,pool:O},h.memoizedState={baseLanes:p,cachePool:O},l!==null&&Bb(h,null),Ub(),I5(h),l!==null&&rw(l,h,x,!0),null}function On(l,h){var p=h.ref;if(p===null)l!==null&&l.ref!==null&&(h.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(l===null||l.ref!==p)&&(h.flags|=4194816)}}function em(l,h,p,x,O){return up(h),p=QE(l,h,p,x,void 0,O),x=JE(),l!==null&&!to?(gp(l,h,O),Ed(l,h,O)):(Cr&&x&&HE(h),h.flags|=1,Bi(l,h,p,O),h.child)}function ov(l,h,p,x,O,G){return up(h),h.updateQueue=null,p=p5(h,x,p,O),f5(l),x=JE(),l!==null&&!to?(gp(l,h,G),Ed(l,h,G)):(Cr&&x&&HE(h),h.flags|=1,Bi(l,h,p,G),h.child)}function Bh(l,h,p,x,O){if(up(h),h.stateNode===null){var G=sp,se=p.contextType;typeof se=="object"&&se!==null&&(G=os(se)),G=new p(x,G),h.memoizedState=G.state!==null&&G.state!==void 0?G.state:null,G.updater=Ew,h.stateNode=G,G._reactInternals=h,G=h.stateNode,G.props=x,G.state=h.memoizedState,G.refs={},hp(h),se=p.contextType,G.context=typeof se=="object"&&se!==null?os(se):sp,G.state=h.memoizedState,se=p.getDerivedStateFromProps,typeof se=="function"&&(Jg(h,p,se,x),G.state=h.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof G.getSnapshotBeforeUpdate=="function"||typeof G.UNSAFE_componentWillMount!="function"&&typeof G.componentWillMount!="function"||(se=G.state,typeof G.componentWillMount=="function"&&G.componentWillMount(),typeof G.UNSAFE_componentWillMount=="function"&&G.UNSAFE_componentWillMount(),se!==G.state&&Ew.enqueueReplaceState(G,G.state,null),So(h,x,G,O),kl(),G.state=h.memoizedState),typeof G.componentDidMount=="function"&&(h.flags|=4194308),x=!0}else if(l===null){G=h.stateNode;var me=h.memoizedProps,_e=Dh(p,me);G.props=_e;var We=G.context,ct=p.contextType;se=sp,typeof ct=="object"&&ct!==null&&(se=os(ct));var gt=p.getDerivedStateFromProps;ct=typeof gt=="function"||typeof G.getSnapshotBeforeUpdate=="function",me=h.pendingProps!==me,ct||typeof G.UNSAFE_componentWillReceiveProps!="function"&&typeof G.componentWillReceiveProps!="function"||(me||We!==se)&&N5(h,G,x,se),pu=!1;var Ze=h.memoizedState;G.state=Ze,So(h,x,G,O),kl(),We=h.memoizedState,me||Ze!==We||pu?(typeof gt=="function"&&(Jg(h,p,gt,x),We=h.memoizedState),(_e=pu||Aw(h,p,_e,x,Ze,We,se))?(ct||typeof G.UNSAFE_componentWillMount!="function"&&typeof G.componentWillMount!="function"||(typeof G.componentWillMount=="function"&&G.componentWillMount(),typeof G.UNSAFE_componentWillMount=="function"&&G.UNSAFE_componentWillMount()),typeof G.componentDidMount=="function"&&(h.flags|=4194308)):(typeof G.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=x,h.memoizedState=We),G.props=x,G.state=We,G.context=se,x=_e):(typeof G.componentDidMount=="function"&&(h.flags|=4194308),x=!1)}else{G=h.stateNode,Yg(l,h),se=h.memoizedProps,ct=Dh(p,se),G.props=ct,gt=h.pendingProps,Ze=G.context,We=p.contextType,_e=sp,typeof We=="object"&&We!==null&&(_e=os(We)),me=p.getDerivedStateFromProps,(We=typeof me=="function"||typeof G.getSnapshotBeforeUpdate=="function")||typeof G.UNSAFE_componentWillReceiveProps!="function"&&typeof G.componentWillReceiveProps!="function"||(se!==gt||Ze!==_e)&&N5(h,G,x,_e),pu=!1,Ze=h.memoizedState,G.state=Ze,So(h,x,G,O),kl();var He=h.memoizedState;se!==gt||Ze!==He||pu||l!==null&&l.dependencies!==null&&Pb(l.dependencies)?(typeof me=="function"&&(Jg(h,p,me,x),He=h.memoizedState),(ct=pu||Aw(h,p,ct,x,Ze,He,_e)||l!==null&&l.dependencies!==null&&Pb(l.dependencies))?(We||typeof G.UNSAFE_componentWillUpdate!="function"&&typeof G.componentWillUpdate!="function"||(typeof G.componentWillUpdate=="function"&&G.componentWillUpdate(x,He,_e),typeof G.UNSAFE_componentWillUpdate=="function"&&G.UNSAFE_componentWillUpdate(x,He,_e)),typeof G.componentDidUpdate=="function"&&(h.flags|=4),typeof G.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof G.componentDidUpdate!="function"||se===l.memoizedProps&&Ze===l.memoizedState||(h.flags|=4),typeof G.getSnapshotBeforeUpdate!="function"||se===l.memoizedProps&&Ze===l.memoizedState||(h.flags|=1024),h.memoizedProps=x,h.memoizedState=He),G.props=x,G.state=He,G.context=_e,x=ct):(typeof G.componentDidUpdate!="function"||se===l.memoizedProps&&Ze===l.memoizedState||(h.flags|=4),typeof G.getSnapshotBeforeUpdate!="function"||se===l.memoizedProps&&Ze===l.memoizedState||(h.flags|=1024),x=!1)}return G=x,On(l,h),x=(h.flags&128)!==0,G||x?(G=h.stateNode,p=x&&typeof p.getDerivedStateFromError!="function"?null:G.render(),h.flags|=1,l!==null&&x?(h.child=vp(h,l.child,null,O),h.child=vp(h,null,p,O)):Bi(l,h,p,O),h.memoizedState=G.state,l=h.child):l=Ed(l,h,O),l}function P5(l,h,p,x){return nw(),h.flags|=256,Bi(l,h,p,x),h.child}var Cw={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function av(l){return{baseLanes:l,cachePool:o5()}}function no(l,h,p){return l=l!==null?l.childLanes&~p:0,h&&(l|=Wc),l}function D5(l,h,p){var x=h.pendingProps,O=!1,G=(h.flags&128)!==0,se;if((se=G)||(se=l!==null&&l.memoizedState===null?!1:(as.current&2)!==0),se&&(O=!0,h.flags&=-129),se=(h.flags&32)!==0,h.flags&=-33,l===null){if(Cr){if(O?zc(h):xd(),Cr){var me=qi,_e;if(_e=me){e:{for(_e=me,me=xa;_e.nodeType!==8;){if(!me){me=null;break e}if(_e=Bl(_e.nextSibling),_e===null){me=null;break e}}me=_e}me!==null?(h.memoizedState={dehydrated:me,treeContext:Di!==null?{id:Vi,overflow:gd}:null,retryLane:536870912,hydrationErrors:null},_e=va(18,null,null,0),_e.stateNode=me,_e.return=h,h.child=_e,Ps=h,qi=null,_e=!0):_e=!1}_e||$c(h)}if(me=h.memoizedState,me!==null&&(me=me.dehydrated,me!==null))return Ho(me)?h.lanes=32:h.lanes=536870912,null;mu(h)}return me=x.children,x=x.fallback,O?(xd(),O=h.mode,me=Tw({mode:"hidden",children:me},O),x=ap(x,O,p,null),me.return=h,x.return=h,me.sibling=x,h.child=me,O=h.child,O.memoizedState=av(p),O.childLanes=no(l,se,p),h.memoizedState=Cw,x):(zc(h),b3(h,me))}if(_e=l.memoizedState,_e!==null&&(me=_e.dehydrated,me!==null)){if(G)h.flags&256?(zc(h),h.flags&=-257,h=v3(l,h,p)):h.memoizedState!==null?(xd(),h.child=l.child,h.flags|=128,h=null):(xd(),O=x.fallback,me=h.mode,x=Tw({mode:"visible",children:x.children},me),O=ap(O,me,p,null),O.flags|=2,x.return=h,O.return=h,x.sibling=O,h.child=x,vp(h,l.child,null,p),x=h.child,x.memoizedState=av(p),x.childLanes=no(l,se,p),h.memoizedState=Cw,h=O);else if(zc(h),Ho(me)){if(se=me.nextSibling&&me.nextSibling.dataset,se)var We=se.dgst;se=We,x=Error(r(419)),x.stack="",x.digest=se,Nh({value:x,source:null,stack:null}),h=v3(l,h,p)}else if(to||rw(l,h,p,!1),se=(p&l.childLanes)!==0,to||se){if(se=Oi,se!==null&&(x=p&-p,x=(x&42)!==0?1:tr(x),x=(x&(se.suspendedLanes|p))!==0?0:x,x!==0&&x!==_e.retryLane))throw _e.retryLane=x,ip(l,x),lc(se,l,x),O5;me.data==="$?"||L3(),h=v3(l,h,p)}else me.data==="$?"?(h.flags|=192,h.child=l.child,h=null):(l=_e.treeContext,qi=Bl(me.nextSibling),Ps=h,Cr=!0,Rl=null,xa=!1,l!==null&&(Bc[Lc++]=Vi,Bc[Lc++]=gd,Bc[Lc++]=Di,Vi=l.id,gd=l.overflow,Di=h),h=b3(h,x.children),h.flags|=4096);return h}return O?(xd(),O=x.fallback,me=h.mode,_e=l.child,We=_e.sibling,x=jo(_e,{mode:"hidden",children:x.children}),x.subtreeFlags=_e.subtreeFlags&65011712,We!==null?O=jo(We,O):(O=ap(O,me,p,null),O.flags|=2),O.return=h,x.return=h,x.sibling=O,h.child=x,x=O,O=h.child,me=l.child.memoizedState,me===null?me=av(p):(_e=me.cachePool,_e!==null?(We=Ei._currentValue,_e=_e.parent!==We?{parent:We,pool:We}:_e):_e=o5(),me={baseLanes:me.baseLanes|p,cachePool:_e}),O.memoizedState=me,O.childLanes=no(l,se,p),h.memoizedState=Cw,x):(zc(h),p=l.child,l=p.sibling,p=jo(p,{mode:"visible",children:x.children}),p.return=h,p.sibling=null,l!==null&&(se=h.deletions,se===null?(h.deletions=[l],h.flags|=16):se.push(l)),h.child=p,h.memoizedState=null,p)}function b3(l,h){return h=Tw({mode:"visible",children:h},l.mode),h.return=l,l.child=h}function Tw(l,h){return l=va(22,l,null,h),l.lanes=0,l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},l}function v3(l,h,p){return vp(h,l.child,null,p),l=b3(h,h.pendingProps.children),l.flags|=2,h.memoizedState=null,l}function x3(l,h,p){l.lanes|=h;var x=l.alternate;x!==null&&(x.lanes|=h),Ea(l.return,h,p)}function E3(l,h,p,x,O){var G=l.memoizedState;G===null?l.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:x,tail:p,tailMode:O}:(G.isBackwards=h,G.rendering=null,G.renderingStartTime=0,G.last=x,G.tail=p,G.tailMode=O)}function B5(l,h,p){var x=h.pendingProps,O=x.revealOrder,G=x.tail;if(Bi(l,h,x.children,p),x=as.current,(x&2)!==0)x=x&1|2,h.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=h.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&x3(l,p,h);else if(l.tag===19)x3(l,p,h);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===h)break e;for(;l.sibling===null;){if(l.return===null||l.return===h)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}x&=1}switch(M(as,x),O){case"forwards":for(p=h.child,O=null;p!==null;)l=p.alternate,l!==null&&xw(l)===null&&(O=p),p=p.sibling;p=O,p===null?(O=h.child,h.child=null):(O=p.sibling,p.sibling=null),E3(h,!1,O,p,G);break;case"backwards":for(p=null,O=h.child,h.child=null;O!==null;){if(l=O.alternate,l!==null&&xw(l)===null){h.child=O;break}l=O.sibling,O.sibling=p,p=O,O=l}E3(h,!0,p,null,G);break;case"together":E3(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Ed(l,h,p){if(l!==null&&(h.dependencies=l.dependencies),jh|=h.lanes,(p&h.childLanes)===0)if(l!==null){if(rw(l,h,p,!1),(p&h.childLanes)===0)return null}else return null;if(l!==null&&h.child!==l.child)throw Error(r(153));if(h.child!==null){for(l=h.child,p=jo(l,l.pendingProps),h.child=p,p.return=h;l.sibling!==null;)l=l.sibling,p=p.sibling=jo(l,l.pendingProps),p.return=h;p.sibling=null}return h.child}function Pl(l,h){return(l.lanes&h)!==0?!0:(l=l.dependencies,!!(l!==null&&Pb(l)))}function Wo(l,h,p){switch(h.tag){case 3:he(h,h.stateNode.containerInfo),ic(h,Ei,l.memoizedState.cache),nw();break;case 27:case 5:Se(h);break;case 4:he(h,h.stateNode.containerInfo);break;case 10:ic(h,h.type,h.memoizedProps.value);break;case 13:var x=h.memoizedState;if(x!==null)return x.dehydrated!==null?(zc(h),h.flags|=128,null):(p&h.child.childLanes)!==0?D5(l,h,p):(zc(h),l=Ed(l,h,p),l!==null?l.sibling:null);zc(h);break;case 19:var O=(l.flags&128)!==0;if(x=(p&h.childLanes)!==0,x||(rw(l,h,p,!1),x=(p&h.childLanes)!==0),O){if(x)return B5(l,h,p);h.flags|=128}if(O=h.memoizedState,O!==null&&(O.rendering=null,O.tail=null,O.lastEffect=null),M(as,as.current),x)break;return null;case 22:case 23:return h.lanes=0,_w(l,h,p);case 24:ic(h,Ei,l.memoizedState.cache)}return Ed(l,h,p)}function cv(l,h,p){if(l!==null)if(l.memoizedProps!==h.pendingProps)to=!0;else{if(!Pl(l,p)&&(h.flags&128)===0)return to=!1,Wo(l,h,p);to=(l.flags&131072)!==0}else to=!1,Cr&&(h.flags&1048576)!==0&&WE(h,J0,h.index);switch(h.lanes=0,h.tag){case 16:e:{l=h.pendingProps;var x=h.elementType,O=x._init;if(x=O(x._payload),h.type=x,typeof x=="function")op(x)?(l=Dh(x,l),h.tag=1,h=Bh(null,h,x,l,p)):(h.tag=0,h=em(null,h,x,l,p));else{if(x!=null){if(O=x.$$typeof,O===H){h.tag=11,h=rv(null,h,x,l,p);break e}else if(O===K){h.tag=14,h=iv(null,h,x,l,p);break e}}throw h=A(x)||x,Error(r(306,h,""))}}return h;case 0:return em(l,h,h.type,h.pendingProps,p);case 1:return x=h.type,O=Dh(x,h.pendingProps),Bh(l,h,x,O,p);case 3:e:{if(he(h,h.stateNode.containerInfo),l===null)throw Error(r(387));x=h.pendingProps;var G=h.memoizedState;O=G.element,Yg(l,h),So(h,x,null,p);var se=h.memoizedState;if(x=se.cache,ic(h,Ei,x),x!==G.cache&&gr(h,[Ei],p,!0),kl(),x=se.element,G.isDehydrated)if(G={element:x,isDehydrated:!1,cache:se.cache},h.updateQueue.baseState=G,h.memoizedState=G,h.flags&256){h=P5(l,h,x,p);break e}else if(x!==O){O=Uo(Error(r(424)),h),Nh(O),h=P5(l,h,x,p);break e}else{switch(l=h.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(qi=Bl(l.firstChild),Ps=h,Cr=!0,Rl=null,xa=!0,p=T5(h,null,x,p),h.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(nw(),x===O){h=Ed(l,h,p);break e}Bi(l,h,x,p)}h=h.child}return h;case 26:return On(l,h),l===null?(p=kT(h.type,null,h.pendingProps,null))?h.memoizedState=p:Cr||(p=h.type,l=h.pendingProps,x=_p(ae.current).createElement(p),x[ye]=h,x[Ce]=l,$s(x,p,l),ki(x),h.stateNode=x):h.memoizedState=kT(h.type,l.memoizedProps,h.pendingProps,l.memoizedState),null;case 27:return Se(h),l===null&&Cr&&(x=h.stateNode=NT(h.type,h.pendingProps,ae.current),Ps=h,xa=!0,O=qi,Hc(h.type)?(G3=O,qi=Bl(x.firstChild)):qi=O),Bi(l,h,h.pendingProps.children,p),On(l,h),l===null&&(h.flags|=4194304),h.child;case 5:return l===null&&Cr&&((O=x=qi)&&(x=TT(x,h.type,h.pendingProps,xa),x!==null?(h.stateNode=x,Ps=h,qi=Bl(x.firstChild),xa=!1,O=!0):O=!1),O||$c(h)),Se(h),O=h.type,G=h.pendingProps,se=l!==null?l.memoizedProps:null,x=G.children,_v(O,G)?x=null:se!==null&&_v(O,se)&&(h.flags|=32),h.memoizedState!==null&&(O=QE(l,h,XE,null,null,p),bm._currentValue=O),On(l,h),Bi(l,h,x,p),h.child;case 6:return l===null&&Cr&&((l=p=qi)&&(p=Tv(p,h.pendingProps,xa),p!==null?(h.stateNode=p,Ps=h,qi=null,l=!0):l=!1),l||$c(h)),null;case 13:return D5(l,h,p);case 4:return he(h,h.stateNode.containerInfo),x=h.pendingProps,l===null?h.child=vp(h,null,x,p):Bi(l,h,x,p),h.child;case 11:return rv(l,h,h.type,h.pendingProps,p);case 7:return Bi(l,h,h.pendingProps,p),h.child;case 8:return Bi(l,h,h.pendingProps.children,p),h.child;case 12:return Bi(l,h,h.pendingProps.children,p),h.child;case 10:return x=h.pendingProps,ic(h,h.type,x.value),Bi(l,h,x.children,p),h.child;case 9:return O=h.type._context,x=h.pendingProps.children,up(h),O=os(O),x=x(O),h.flags|=1,Bi(l,h,x,p),h.child;case 14:return iv(l,h,h.type,h.pendingProps,p);case 15:return sv(l,h,h.type,h.pendingProps,p);case 19:return B5(l,h,p);case 31:return x=h.pendingProps,p=h.mode,x={mode:x.mode,children:x.children},l===null?(p=Tw(x,p),p.ref=h.ref,h.child=p,p.return=h,h=p):(p=jo(l.child,x),p.ref=h.ref,h.child=p,p.return=h,h=p),h;case 22:return _w(l,h,p);case 24:return up(h),x=os(Ei),l===null?(O=md(),O===null&&(O=Oi,G=VE(),O.pooledCache=G,G.refCount++,G!==null&&(O.pooledCacheLanes|=p),O=G),h.memoizedState={parent:x,cache:O},hp(h),ic(h,Ei,O)):((l.lanes&p)!==0&&(Yg(l,h),So(h,null,null,p),kl()),O=l.memoizedState,G=h.memoizedState,O.parent!==x?(O={parent:x,cache:x},h.memoizedState=O,h.lanes===0&&(h.memoizedState=h.updateQueue.baseState=O),ic(h,Ei,x)):(x=G.cache,ic(h,Ei,x),x!==O.cache&&gr(h,[Ei],p,!0))),Bi(l,h,h.pendingProps.children,p),h.child;case 29:throw h.pendingProps}throw Error(r(156,h.tag))}function Ad(l){l.flags|=4}function lv(l,h){if(h.type!=="stylesheet"||(h.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!Us(h)){if(h=oc.current,h!==null&&((Dr&4194048)===Dr?Fo!==null:(Dr&62914560)!==Dr&&(Dr&536870912)===0||h!==Fo))throw Kg=KE,a5;l.flags|=8192}}function uv(l,h){h!==null&&(l.flags|=4),l.flags&16384&&(h=l.tag!==22?dn():536870912,l.lanes|=h,am|=h)}function Iw(l,h){if(!Cr)switch(l.tailMode){case"hidden":h=l.tail;for(var p=null;h!==null;)h.alternate!==null&&(p=h),h=h.sibling;p===null?l.tail=null:p.sibling=null;break;case"collapsed":p=l.tail;for(var x=null;p!==null;)p.alternate!==null&&(x=p),p=p.sibling;x===null?h||l.tail===null?l.tail=null:l.tail.sibling=null:x.sibling=null}}function Ai(l){var h=l.alternate!==null&&l.alternate.child===l.child,p=0,x=0;if(h)for(var O=l.child;O!==null;)p|=O.lanes|O.childLanes,x|=O.subtreeFlags&65011712,x|=O.flags&65011712,O.return=l,O=O.sibling;else for(O=l.child;O!==null;)p|=O.lanes|O.childLanes,x|=O.subtreeFlags,x|=O.flags,O.return=l,O=O.sibling;return l.subtreeFlags|=x,l.childLanes=p,h}function L5(l,h,p){var x=h.pendingProps;switch(ew(h),h.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ai(h),null;case 1:return Ai(h),null;case 3:return p=h.stateNode,x=null,l!==null&&(x=l.memoizedState.cache),h.memoizedState.cache!==x&&(h.flags|=2048),Uc(Ei),xe(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(l===null||l.child===null)&&(tw(h)?Ad(h):l===null||l.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,n5())),Ai(h),null;case 26:return p=h.memoizedState,l===null?(Ad(h),p!==null?(Ai(h),lv(h,p)):(Ai(h),h.flags&=-16777217)):p?p!==l.memoizedState?(Ad(h),Ai(h),lv(h,p)):(Ai(h),h.flags&=-16777217):(l.memoizedProps!==x&&Ad(h),Ai(h),h.flags&=-16777217),null;case 27:Re(h),p=ae.current;var O=h.type;if(l!==null&&h.stateNode!=null)l.memoizedProps!==x&&Ad(h);else{if(!x){if(h.stateNode===null)throw Error(r(166));return Ai(h),null}l=Z.current,tw(h)?e5(h):(l=NT(O,x,p),h.stateNode=l,Ad(h))}return Ai(h),null;case 5:if(Re(h),p=h.type,l!==null&&h.stateNode!=null)l.memoizedProps!==x&&Ad(h);else{if(!x){if(h.stateNode===null)throw Error(r(166));return Ai(h),null}if(l=Z.current,tw(h))e5(h);else{switch(O=_p(ae.current),l){case 1:l=O.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:l=O.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":l=O.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":l=O.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":l=O.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild);break;case"select":l=typeof x.is=="string"?O.createElement("select",{is:x.is}):O.createElement("select"),x.multiple?l.multiple=!0:x.size&&(l.size=x.size);break;default:l=typeof x.is=="string"?O.createElement(p,{is:x.is}):O.createElement(p)}}l[ye]=h,l[Ce]=x;e:for(O=h.child;O!==null;){if(O.tag===5||O.tag===6)l.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===h)break e;for(;O.sibling===null;){if(O.return===null||O.return===h)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}h.stateNode=l;e:switch($s(l,p,x),p){case"button":case"input":case"select":case"textarea":l=!!x.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ad(h)}}return Ai(h),h.flags&=-16777217,null;case 6:if(l&&h.stateNode!=null)l.memoizedProps!==x&&Ad(h);else{if(typeof x!="string"&&h.stateNode===null)throw Error(r(166));if(l=ae.current,tw(h)){if(l=h.stateNode,p=h.memoizedProps,x=null,O=Ps,O!==null)switch(O.tag){case 27:case 5:x=O.memoizedProps}l[ye]=h,l=!!(l.nodeValue===p||x!==null&&x.suppressHydrationWarning===!0||AT(l.nodeValue,p)),l||$c(h)}else l=_p(l).createTextNode(x),l[ye]=h,h.stateNode=l}return Ai(h),null;case 13:if(x=h.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(O=tw(h),x!==null&&x.dehydrated!==null){if(l===null){if(!O)throw Error(r(318));if(O=h.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(r(317));O[ye]=h}else nw(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Ai(h),O=!1}else O=n5(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=O),O=!0;if(!O)return h.flags&256?(mu(h),h):(mu(h),null)}if(mu(h),(h.flags&128)!==0)return h.lanes=p,h;if(p=x!==null,l=l!==null&&l.memoizedState!==null,p){x=h.child,O=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(O=x.alternate.memoizedState.cachePool.pool);var G=null;x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(G=x.memoizedState.cachePool.pool),G!==O&&(x.flags|=2048)}return p!==l&&p&&(h.child.flags|=8192),uv(h,h.updateQueue),Ai(h),null;case 4:return xe(),l===null&&V3(h.stateNode.containerInfo),Ai(h),null;case 10:return Uc(h.type),Ai(h),null;case 19:if(C(as),O=h.memoizedState,O===null)return Ai(h),null;if(x=(h.flags&128)!==0,G=O.rendering,G===null)if(x)Iw(O,!1);else{if(cs!==0||l!==null&&(l.flags&128)!==0)for(l=h.child;l!==null;){if(G=xw(l),G!==null){for(h.flags|=128,Iw(O,!1),l=G.updateQueue,h.updateQueue=l,uv(h,l),h.subtreeFlags=0,l=p,p=h.child;p!==null;)X0(p,l),p=p.sibling;return M(as,as.current&1|2),h.child}l=l.sibling}O.tail!==null&&At()>cm&&(h.flags|=128,x=!0,Iw(O,!1),h.lanes=4194304)}else{if(!x)if(l=xw(G),l!==null){if(h.flags|=128,x=!0,l=l.updateQueue,h.updateQueue=l,uv(h,l),Iw(O,!0),O.tail===null&&O.tailMode==="hidden"&&!G.alternate&&!Cr)return Ai(h),null}else 2*At()-O.renderingStartTime>cm&&p!==536870912&&(h.flags|=128,x=!0,Iw(O,!1),h.lanes=4194304);O.isBackwards?(G.sibling=h.child,h.child=G):(l=O.last,l!==null?l.sibling=G:h.child=G,O.last=G)}return O.tail!==null?(h=O.tail,O.rendering=h,O.tail=h.sibling,O.renderingStartTime=At(),h.sibling=null,l=as.current,M(as,x?l&1|2:l&1),h):(Ai(h),null);case 22:case 23:return mu(h),ZE(),x=h.memoizedState!==null,l!==null?l.memoizedState!==null!==x&&(h.flags|=8192):x&&(h.flags|=8192),x?(p&536870912)!==0&&(h.flags&128)===0&&(Ai(h),h.subtreeFlags&6&&(h.flags|=8192)):Ai(h),p=h.updateQueue,p!==null&&uv(h,p.retryQueue),p=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==p&&(h.flags|=2048),l!==null&&C(dp),null;case 24:return p=null,l!==null&&(p=l.memoizedState.cache),h.memoizedState.cache!==p&&(h.flags|=2048),Uc(Ei),Ai(h),null;case 25:return null;case 30:return null}throw Error(r(156,h.tag))}function $5(l,h){switch(ew(h),h.tag){case 1:return l=h.flags,l&65536?(h.flags=l&-65537|128,h):null;case 3:return Uc(Ei),xe(),l=h.flags,(l&65536)!==0&&(l&128)===0?(h.flags=l&-65537|128,h):null;case 26:case 27:case 5:return Re(h),null;case 13:if(mu(h),l=h.memoizedState,l!==null&&l.dehydrated!==null){if(h.alternate===null)throw Error(r(340));nw()}return l=h.flags,l&65536?(h.flags=l&-65537|128,h):null;case 19:return C(as),null;case 4:return xe(),null;case 10:return Uc(h.type),null;case 22:case 23:return mu(h),ZE(),l!==null&&C(dp),l=h.flags,l&65536?(h.flags=l&-65537|128,h):null;case 24:return Uc(Ei),null;case 25:return null;default:return null}}function U5(l,h){switch(ew(h),h.tag){case 3:Uc(Ei),xe();break;case 26:case 27:case 5:Re(h);break;case 4:xe();break;case 13:mu(h);break;case 19:C(as);break;case 10:Uc(h.type);break;case 22:case 23:mu(h),ZE(),l!==null&&C(dp);break;case 24:Uc(Ei)}}function Nw(l,h){try{var p=h.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var O=x.next;p=O;do{if((p.tag&l)===l){x=void 0;var G=p.create,se=p.inst;x=G(),se.destroy=x}p=p.next}while(p!==O)}}catch(me){Si(h,h.return,me)}}function Lh(l,h,p){try{var x=h.updateQueue,O=x!==null?x.lastEffect:null;if(O!==null){var G=O.next;x=G;do{if((x.tag&l)===l){var se=x.inst,me=se.destroy;if(me!==void 0){se.destroy=void 0,O=h;var _e=p,We=me;try{We()}catch(ct){Si(O,_e,ct)}}}x=x.next}while(x!==G)}}catch(ct){Si(h,h.return,ct)}}function j5(l){var h=l.updateQueue;if(h!==null){var p=l.stateNode;try{GE(h,p)}catch(x){Si(l,l.return,x)}}}function A3(l,h,p){p.props=Dh(l.type,l.memoizedProps),p.state=l.memoizedState;try{p.componentWillUnmount()}catch(x){Si(l,h,x)}}function tm(l,h){try{var p=l.ref;if(p!==null){switch(l.tag){case 26:case 27:case 5:var x=l.stateNode;break;case 30:x=l.stateNode;break;default:x=l.stateNode}typeof p=="function"?l.refCleanup=p(x):p.current=x}}catch(O){Si(l,h,O)}}function yu(l,h){var p=l.ref,x=l.refCleanup;if(p!==null)if(typeof x=="function")try{x()}catch(O){Si(l,h,O)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(O){Si(l,h,O)}else p.current=null}function dv(l){var h=l.type,p=l.memoizedProps,x=l.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":p.autoFocus&&x.focus();break e;case"img":p.src?x.src=p.src:p.srcSet&&(x.srcset=p.srcSet)}}catch(O){Si(l,l.return,O)}}function hv(l,h,p){try{var x=l.stateNode;UM(x,l.type,p,h),x[Ce]=h}catch(O){Si(l,l.return,O)}}function nm(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Hc(l.type)||l.tag===4}function Rw(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||nm(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&Hc(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function fv(l,h,p){var x=l.tag;if(x===5||x===6)l=l.stateNode,h?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(l,h):(h=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,h.appendChild(l),p=p._reactRootContainer,p!=null||h.onclick!==null||(h.onclick=Av));else if(x!==4&&(x===27&&Hc(l.type)&&(p=l.stateNode,h=null),l=l.child,l!==null))for(fv(l,h,p),l=l.sibling;l!==null;)fv(l,h,p),l=l.sibling}function Mw(l,h,p){var x=l.tag;if(x===5||x===6)l=l.stateNode,h?p.insertBefore(l,h):p.appendChild(l);else if(x!==4&&(x===27&&Hc(l.type)&&(p=l.stateNode),l=l.child,l!==null))for(Mw(l,h,p),l=l.sibling;l!==null;)Mw(l,h,p),l=l.sibling}function kw(l){var h=l.stateNode,p=l.memoizedProps;try{for(var x=l.type,O=h.attributes;O.length;)h.removeAttributeNode(O[0]);$s(h,x,p),h[ye]=l,h[Ce]=p}catch(G){Si(l,l.return,G)}}var bu=!1,ei=!1,Sd=!1,z5=typeof WeakSet=="function"?WeakSet:Set,Bs=null;function _M(l,h){if(l=l.containerInfo,Dl=Mv,l=X4(l),UE(l)){if("selectionStart"in l)var p={start:l.selectionStart,end:l.selectionEnd};else e:{p=(p=l.ownerDocument)&&p.defaultView||window;var x=p.getSelection&&p.getSelection();if(x&&x.rangeCount!==0){p=x.anchorNode;var O=x.anchorOffset,G=x.focusNode;x=x.focusOffset;try{p.nodeType,G.nodeType}catch{p=null;break e}var se=0,me=-1,_e=-1,We=0,ct=0,gt=l,Ze=null;t:for(;;){for(var He;gt!==p||O!==0&>.nodeType!==3||(me=se+O),gt!==G||x!==0&>.nodeType!==3||(_e=se+x),gt.nodeType===3&&(se+=gt.nodeValue.length),(He=gt.firstChild)!==null;)Ze=gt,gt=He;for(;;){if(gt===l)break t;if(Ze===p&&++We===O&&(me=se),Ze===G&&++ct===x&&(_e=se),(He=gt.nextSibling)!==null)break;gt=Ze,Ze=gt.parentNode}gt=He}p=me===-1||_e===-1?null:{start:me,end:_e}}else p=null}p=p||{start:0,end:0}}else p=null;for(Sv={focusedElem:l,selectionRange:p},Mv=!1,Bs=h;Bs!==null;)if(h=Bs,l=h.child,(h.subtreeFlags&1024)!==0&&l!==null)l.return=h,Bs=l;else for(;Bs!==null;){switch(h=Bs,G=h.alternate,l=h.flags,h.tag){case 0:break;case 11:case 15:break;case 1:if((l&1024)!==0&&G!==null){l=void 0,p=h,O=G.memoizedProps,G=G.memoizedState,x=p.stateNode;try{var Wn=Dh(p.type,O,p.elementType===p.type);l=x.getSnapshotBeforeUpdate(Wn,G),x.__reactInternalSnapshotBeforeUpdate=l}catch(Un){Si(p,p.return,Un)}}break;case 3:if((l&1024)!==0){if(l=h.stateNode.containerInfo,p=l.nodeType,p===9)Y3(l);else if(p===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Y3(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(r(163))}if(l=h.sibling,l!==null){l.return=h.return,Bs=l;break}Bs=h.return}}function F5(l,h,p){var x=p.flags;switch(p.tag){case 0:case 11:case 15:$h(l,p),x&4&&Nw(5,p);break;case 1:if($h(l,p),x&4)if(l=p.stateNode,h===null)try{l.componentDidMount()}catch(se){Si(p,p.return,se)}else{var O=Dh(p.type,h.memoizedProps);h=h.memoizedState;try{l.componentDidUpdate(O,h,l.__reactInternalSnapshotBeforeUpdate)}catch(se){Si(p,p.return,se)}}x&64&&j5(p),x&512&&tm(p,p.return);break;case 3:if($h(l,p),x&64&&(l=p.updateQueue,l!==null)){if(h=null,p.child!==null)switch(p.child.tag){case 27:case 5:h=p.child.stateNode;break;case 1:h=p.child.stateNode}try{GE(l,h)}catch(se){Si(p,p.return,se)}}break;case 27:h===null&&x&4&&kw(p);case 26:case 5:$h(l,p),h===null&&x&4&&dv(p),x&512&&tm(p,p.return);break;case 12:$h(l,p);break;case 13:$h(l,p),x&4&&V5(l,p),x&64&&(l=p.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(p=yv.bind(null,p),pm(l,p))));break;case 22:if(x=p.memoizedState!==null||bu,!x){h=h!==null&&h.memoizedState!==null||ei,O=bu;var G=ei;bu=x,(ei=h)&&!G?Cd(l,p,(p.subtreeFlags&8772)!==0):$h(l,p),bu=O,ei=G}break;case 30:break;default:$h(l,p)}}function W5(l){var h=l.alternate;h!==null&&(l.alternate=null,W5(h)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(h=l.stateNode,h!==null&&gn(h)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var Ki=null,Ta=!1;function _d(l,h,p){for(p=p.child;p!==null;)H5(l,h,p),p=p.sibling}function H5(l,h,p){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(at,p)}catch{}switch(p.tag){case 26:ei||yu(p,h),_d(l,h,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:ei||yu(p,h);var x=Ki,O=Ta;Hc(p.type)&&(Ki=p.stateNode,Ta=!1),_d(l,h,p),Ww(p.stateNode),Ki=x,Ta=O;break;case 5:ei||yu(p,h);case 6:if(x=Ki,O=Ta,Ki=null,_d(l,h,p),Ki=x,Ta=O,Ki!==null)if(Ta)try{(Ki.nodeType===9?Ki.body:Ki.nodeName==="HTML"?Ki.ownerDocument.body:Ki).removeChild(p.stateNode)}catch(G){Si(p,h,G)}else try{Ki.removeChild(p.stateNode)}catch(G){Si(p,h,G)}break;case 18:Ki!==null&&(Ta?(l=Ki,Cv(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,p.stateNode),Qw(l)):Cv(Ki,p.stateNode));break;case 4:x=Ki,O=Ta,Ki=p.stateNode.containerInfo,Ta=!0,_d(l,h,p),Ki=x,Ta=O;break;case 0:case 11:case 14:case 15:ei||Lh(2,p,h),ei||Lh(4,p,h),_d(l,h,p);break;case 1:ei||(yu(p,h),x=p.stateNode,typeof x.componentWillUnmount=="function"&&A3(p,h,x)),_d(l,h,p);break;case 21:_d(l,h,p);break;case 22:ei=(x=ei)||p.memoizedState!==null,_d(l,h,p),ei=x;break;default:_d(l,h,p)}}function V5(l,h){if(h.memoizedState===null&&(l=h.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{Qw(l)}catch(p){Si(h,h.return,p)}}function CM(l){switch(l.tag){case 13:case 19:var h=l.stateNode;return h===null&&(h=l.stateNode=new z5),h;case 22:return l=l.stateNode,h=l._retryCache,h===null&&(h=l._retryCache=new z5),h;default:throw Error(r(435,l.tag))}}function S3(l,h){var p=CM(l);h.forEach(function(x){var O=kM.bind(null,l,x);p.has(x)||(p.add(x),x.then(O,O))})}function ac(l,h){var p=h.deletions;if(p!==null)for(var x=0;x<p.length;x++){var O=p[x],G=l,se=h,me=se;e:for(;me!==null;){switch(me.tag){case 27:if(Hc(me.type)){Ki=me.stateNode,Ta=!1;break e}break;case 5:Ki=me.stateNode,Ta=!1;break e;case 3:case 4:Ki=me.stateNode.containerInfo,Ta=!0;break e}me=me.return}if(Ki===null)throw Error(r(160));H5(G,se,O),Ki=null,Ta=!1,G=O.alternate,G!==null&&(G.return=null),O.return=null}if(h.subtreeFlags&13878)for(h=h.child;h!==null;)_3(h,l),h=h.sibling}var Fc=null;function _3(l,h){var p=l.alternate,x=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:ac(h,l),Ia(l),x&4&&(Lh(3,l,l.return),Nw(3,l),Lh(5,l,l.return));break;case 1:ac(h,l),Ia(l),x&512&&(ei||p===null||yu(p,p.return)),x&64&&bu&&(l=l.updateQueue,l!==null&&(x=l.callbacks,x!==null&&(p=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=p===null?x:p.concat(x))));break;case 26:var O=Fc;if(ac(h,l),Ia(l),x&512&&(ei||p===null||yu(p,p.return)),x&4){var G=p!==null?p.memoizedState:null;if(x=l.memoizedState,p===null)if(x===null)if(l.stateNode===null){e:{x=l.type,p=l.memoizedProps,O=O.ownerDocument||O;t:switch(x){case"title":G=O.getElementsByTagName("title")[0],(!G||G[or]||G[ye]||G.namespaceURI==="http://www.w3.org/2000/svg"||G.hasAttribute("itemprop"))&&(G=O.createElement(x),O.head.insertBefore(G,O.querySelector("head > title"))),$s(G,x,p),G[ye]=l,ki(G),x=G;break e;case"link":var se=DT("link","href",O).get(x+(p.href||""));if(se){for(var me=0;me<se.length;me++)if(G=se[me],G.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&G.getAttribute("rel")===(p.rel==null?null:p.rel)&&G.getAttribute("title")===(p.title==null?null:p.title)&&G.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){se.splice(me,1);break t}}G=O.createElement(x),$s(G,x,p),O.head.appendChild(G);break;case"meta":if(se=DT("meta","content",O).get(x+(p.content||""))){for(me=0;me<se.length;me++)if(G=se[me],G.getAttribute("content")===(p.content==null?null:""+p.content)&&G.getAttribute("name")===(p.name==null?null:p.name)&&G.getAttribute("property")===(p.property==null?null:p.property)&&G.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&G.getAttribute("charset")===(p.charSet==null?null:p.charSet)){se.splice(me,1);break t}}G=O.createElement(x),$s(G,x,p),O.head.appendChild(G);break;default:throw Error(r(468,x))}G[ye]=l,ki(G),x=G}l.stateNode=x}else BT(O,l.type,l.stateNode);else l.stateNode=PT(O,x,l.memoizedProps);else G!==x?(G===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):G.count--,x===null?BT(O,l.type,l.stateNode):PT(O,x,l.memoizedProps)):x===null&&l.stateNode!==null&&hv(l,l.memoizedProps,p.memoizedProps)}break;case 27:ac(h,l),Ia(l),x&512&&(ei||p===null||yu(p,p.return)),p!==null&&x&4&&hv(l,l.memoizedProps,p.memoizedProps);break;case 5:if(ac(h,l),Ia(l),x&512&&(ei||p===null||yu(p,p.return)),l.flags&32){O=l.stateNode;try{pi(O,"")}catch(He){Si(l,l.return,He)}}x&4&&l.stateNode!=null&&(O=l.memoizedProps,hv(l,O,p!==null?p.memoizedProps:O)),x&1024&&(Sd=!0);break;case 6:if(ac(h,l),Ia(l),x&4){if(l.stateNode===null)throw Error(r(162));x=l.memoizedProps,p=l.stateNode;try{p.nodeValue=x}catch(He){Si(l,l.return,He)}}break;case 3:if(ym=null,O=Fc,Fc=rr(h.containerInfo),ac(h,l),Fc=O,Ia(l),x&4&&p!==null&&p.memoizedState.isDehydrated)try{Qw(h.containerInfo)}catch(He){Si(l,l.return,He)}Sd&&(Sd=!1,q5(l));break;case 4:x=Fc,Fc=rr(l.stateNode.containerInfo),ac(h,l),Ia(l),Fc=x;break;case 12:ac(h,l),Ia(l);break;case 13:ac(h,l),Ia(l),l.child.flags&8192&&l.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(k3=At()),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,S3(l,x)));break;case 22:O=l.memoizedState!==null;var _e=p!==null&&p.memoizedState!==null,We=bu,ct=ei;if(bu=We||O,ei=ct||_e,ac(h,l),ei=ct,bu=We,Ia(l),x&8192)e:for(h=l.stateNode,h._visibility=O?h._visibility&-2:h._visibility|1,O&&(p===null||_e||bu||ei||Ap(l)),p=null,h=l;;){if(h.tag===5||h.tag===26){if(p===null){_e=p=h;try{if(G=_e.stateNode,O)se=G.style,typeof se.setProperty=="function"?se.setProperty("display","none","important"):se.display="none";else{me=_e.stateNode;var gt=_e.memoizedProps.style,Ze=gt!=null&>.hasOwnProperty("display")?gt.display:null;me.style.display=Ze==null||typeof Ze=="boolean"?"":(""+Ze).trim()}}catch(He){Si(_e,_e.return,He)}}}else if(h.tag===6){if(p===null){_e=h;try{_e.stateNode.nodeValue=O?"":_e.memoizedProps}catch(He){Si(_e,_e.return,He)}}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===l)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break e;for(;h.sibling===null;){if(h.return===null||h.return===l)break e;p===h&&(p=null),h=h.return}p===h&&(p=null),h.sibling.return=h.return,h=h.sibling}x&4&&(x=l.updateQueue,x!==null&&(p=x.retryQueue,p!==null&&(x.retryQueue=null,S3(l,p))));break;case 19:ac(h,l),Ia(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,S3(l,x)));break;case 30:break;case 21:break;default:ac(h,l),Ia(l)}}function Ia(l){var h=l.flags;if(h&2){try{for(var p,x=l.return;x!==null;){if(nm(x)){p=x;break}x=x.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var O=p.stateNode,G=Rw(l);Mw(l,G,O);break;case 5:var se=p.stateNode;p.flags&32&&(pi(se,""),p.flags&=-33);var me=Rw(l);Mw(l,me,se);break;case 3:case 4:var _e=p.stateNode.containerInfo,We=Rw(l);fv(l,We,_e);break;default:throw Error(r(161))}}catch(ct){Si(l,l.return,ct)}l.flags&=-3}h&4096&&(l.flags&=-4097)}function q5(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var h=l;q5(h),h.tag===5&&h.flags&1024&&h.stateNode.reset(),l=l.sibling}}function $h(l,h){if(h.subtreeFlags&8772)for(h=h.child;h!==null;)F5(l,h.alternate,h),h=h.sibling}function Ap(l){for(l=l.child;l!==null;){var h=l;switch(h.tag){case 0:case 11:case 14:case 15:Lh(4,h,h.return),Ap(h);break;case 1:yu(h,h.return);var p=h.stateNode;typeof p.componentWillUnmount=="function"&&A3(h,h.return,p),Ap(h);break;case 27:Ww(h.stateNode);case 26:case 5:yu(h,h.return),Ap(h);break;case 22:h.memoizedState===null&&Ap(h);break;case 30:Ap(h);break;default:Ap(h)}l=l.sibling}}function Cd(l,h,p){for(p=p&&(h.subtreeFlags&8772)!==0,h=h.child;h!==null;){var x=h.alternate,O=l,G=h,se=G.flags;switch(G.tag){case 0:case 11:case 15:Cd(O,G,p),Nw(4,G);break;case 1:if(Cd(O,G,p),x=G,O=x.stateNode,typeof O.componentDidMount=="function")try{O.componentDidMount()}catch(We){Si(x,x.return,We)}if(x=G,O=x.updateQueue,O!==null){var me=x.stateNode;try{var _e=O.shared.hiddenCallbacks;if(_e!==null)for(O.shared.hiddenCallbacks=null,O=0;O<_e.length;O++)d5(_e[O],me)}catch(We){Si(x,x.return,We)}}p&&se&64&&j5(G),tm(G,G.return);break;case 27:kw(G);case 26:case 5:Cd(O,G,p),p&&x===null&&se&4&&dv(G),tm(G,G.return);break;case 12:Cd(O,G,p);break;case 13:Cd(O,G,p),p&&se&4&&V5(O,G);break;case 22:G.memoizedState===null&&Cd(O,G,p),tm(G,G.return);break;case 30:break;default:Cd(O,G,p)}h=h.sibling}}function C3(l,h){var p=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),l=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(l=h.memoizedState.cachePool.pool),l!==p&&(l!=null&&l.refCount++,p!=null&&iw(p))}function T3(l,h){l=null,h.alternate!==null&&(l=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==l&&(h.refCount++,l!=null&&iw(l))}function vu(l,h,p,x){if(h.subtreeFlags&10256)for(h=h.child;h!==null;)K5(l,h,p,x),h=h.sibling}function K5(l,h,p,x){var O=h.flags;switch(h.tag){case 0:case 11:case 15:vu(l,h,p,x),O&2048&&Nw(9,h);break;case 1:vu(l,h,p,x);break;case 3:vu(l,h,p,x),O&2048&&(l=null,h.alternate!==null&&(l=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==l&&(h.refCount++,l!=null&&iw(l)));break;case 12:if(O&2048){vu(l,h,p,x),l=h.stateNode;try{var G=h.memoizedProps,se=G.id,me=G.onPostCommit;typeof me=="function"&&me(se,h.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(_e){Si(h,h.return,_e)}}else vu(l,h,p,x);break;case 13:vu(l,h,p,x);break;case 23:break;case 22:G=h.stateNode,se=h.alternate,h.memoizedState!==null?G._visibility&2?vu(l,h,p,x):Ow(l,h):G._visibility&2?vu(l,h,p,x):(G._visibility|=2,rm(l,h,p,x,(h.subtreeFlags&10256)!==0)),O&2048&&C3(se,h);break;case 24:vu(l,h,p,x),O&2048&&T3(h.alternate,h);break;default:vu(l,h,p,x)}}function rm(l,h,p,x,O){for(O=O&&(h.subtreeFlags&10256)!==0,h=h.child;h!==null;){var G=l,se=h,me=p,_e=x,We=se.flags;switch(se.tag){case 0:case 11:case 15:rm(G,se,me,_e,O),Nw(8,se);break;case 23:break;case 22:var ct=se.stateNode;se.memoizedState!==null?ct._visibility&2?rm(G,se,me,_e,O):Ow(G,se):(ct._visibility|=2,rm(G,se,me,_e,O)),O&&We&2048&&C3(se.alternate,se);break;case 24:rm(G,se,me,_e,O),O&&We&2048&&T3(se.alternate,se);break;default:rm(G,se,me,_e,O)}h=h.sibling}}function Ow(l,h){if(h.subtreeFlags&10256)for(h=h.child;h!==null;){var p=l,x=h,O=x.flags;switch(x.tag){case 22:Ow(p,x),O&2048&&C3(x.alternate,x);break;case 24:Ow(p,x),O&2048&&T3(x.alternate,x);break;default:Ow(p,x)}h=h.sibling}}var Co=8192;function im(l){if(l.subtreeFlags&Co)for(l=l.child;l!==null;)Y5(l),l=l.sibling}function Y5(l){switch(l.tag){case 26:im(l),l.flags&Co&&l.memoizedState!==null&&QM(Fc,l.memoizedState,l.memoizedProps);break;case 5:im(l);break;case 3:case 4:var h=Fc;Fc=rr(l.stateNode.containerInfo),im(l),Fc=h;break;case 22:l.memoizedState===null&&(h=l.alternate,h!==null&&h.memoizedState!==null?(h=Co,Co=16777216,im(l),Co=h):im(l));break;default:im(l)}}function G5(l){var h=l.alternate;if(h!==null&&(l=h.child,l!==null)){h.child=null;do h=l.sibling,l.sibling=null,l=h;while(l!==null)}}function sm(l){var h=l.deletions;if((l.flags&16)!==0){if(h!==null)for(var p=0;p<h.length;p++){var x=h[p];Bs=x,Q5(x,l)}G5(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Z5(l),l=l.sibling}function Z5(l){switch(l.tag){case 0:case 11:case 15:sm(l),l.flags&2048&&Lh(9,l,l.return);break;case 3:sm(l);break;case 12:sm(l);break;case 22:var h=l.stateNode;l.memoizedState!==null&&h._visibility&2&&(l.return===null||l.return.tag!==13)?(h._visibility&=-3,pv(l)):sm(l);break;default:sm(l)}}function pv(l){var h=l.deletions;if((l.flags&16)!==0){if(h!==null)for(var p=0;p<h.length;p++){var x=h[p];Bs=x,Q5(x,l)}G5(l)}for(l=l.child;l!==null;){switch(h=l,h.tag){case 0:case 11:case 15:Lh(8,h,h.return),pv(h);break;case 22:p=h.stateNode,p._visibility&2&&(p._visibility&=-3,pv(h));break;default:pv(h)}l=l.sibling}}function Q5(l,h){for(;Bs!==null;){var p=Bs;switch(p.tag){case 0:case 11:case 15:Lh(8,p,h);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var x=p.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:iw(p.memoizedState.cache)}if(x=p.child,x!==null)x.return=p,Bs=x;else e:for(p=l;Bs!==null;){x=Bs;var O=x.sibling,G=x.return;if(W5(x),x===p){Bs=null;break e}if(O!==null){O.return=G,Bs=O;break e}Bs=G}}}var TM={getCacheForType:function(l){var h=os(Ei),p=h.data.get(l);return p===void 0&&(p=l(),h.data.set(l,p)),p}},I3=typeof WeakMap=="function"?WeakMap:Map,di=0,Oi=null,Ar=null,Dr=0,hi=0,cc=null,Uh=!1,om=!1,N3=!1,Td=0,cs=0,jh=0,Sp=0,R3=0,Wc=0,am=0,Pw=null,Na=null,M3=!1,k3=0,cm=1/0,Dw=null,zh=null,po=0,Fh=null,lm=null,um=0,O3=0,P3=null,X5=null,dm=0,D3=null;function To(){if((di&2)!==0&&Dr!==0)return Dr&-Dr;if(R.T!==null){var l=qg;return l!==0?l:xv()}return de()}function J5(){Wc===0&&(Wc=(Dr&536870912)===0||Cr?kt():536870912);var l=oc.current;return l!==null&&(l.flags|=32),Wc}function lc(l,h,p){(l===Oi&&(hi===2||hi===9)||l.cancelPendingCommit!==null)&&(hm(l,0),Wh(l,Dr,Wc,!1)),_n(l,p),((di&2)===0||l!==Oi)&&(l===Oi&&((di&2)===0&&(Sp|=p),cs===4&&Wh(l,Dr,Wc,!1)),xu(l))}function eT(l,h,p){if((di&6)!==0)throw Error(r(327));var x=!p&&(h&124)===0&&(h&l.expiredLanes)===0||vt(l,h),O=x?RM(l,h):$3(l,h,!0),G=x;do{if(O===0){om&&!x&&Wh(l,h,0,!1);break}else{if(p=l.current.alternate,G&&!IM(p)){O=$3(l,h,!1),G=!1;continue}if(O===2){if(G=h,l.errorRecoveryDisabledLanes&G)var se=0;else se=l.pendingLanes&-536870913,se=se!==0?se:se&536870912?536870912:0;if(se!==0){h=se;e:{var me=l;O=Pw;var _e=me.current.memoizedState.isDehydrated;if(_e&&(hm(me,se).flags|=256),se=$3(me,se,!1),se!==2){if(N3&&!_e){me.errorRecoveryDisabledLanes|=G,Sp|=G,O=4;break e}G=Na,Na=O,G!==null&&(Na===null?Na=G:Na.push.apply(Na,G))}O=se}if(G=!1,O!==2)continue}}if(O===1){hm(l,0),Wh(l,h,0,!0);break}e:{switch(x=l,G=O,G){case 0:case 1:throw Error(r(345));case 4:if((h&4194048)!==h)break;case 6:Wh(x,h,Wc,!Uh);break e;case 2:Na=null;break;case 3:case 5:break;default:throw Error(r(329))}if((h&62914560)===h&&(O=k3+300-At(),10<O)){if(Wh(x,h,Wc,!Uh),De(x,0,!0)!==0)break e;x.timeoutHandle=ST(tT.bind(null,x,p,Na,Dw,M3,h,Wc,Sp,am,Uh,G,2,-0,0),O);break e}tT(x,p,Na,Dw,M3,h,Wc,Sp,am,Uh,G,0,-0,0)}}break}while(!0);xu(l)}function tT(l,h,p,x,O,G,se,me,_e,We,ct,gt,Ze,He){if(l.timeoutHandle=-1,gt=h.subtreeFlags,(gt&8192||(gt&16785408)===16785408)&&(ro={stylesheets:null,count:0,unsuspend:ZM},Y5(h),gt=XM(),gt!==null)){l.cancelPendingCommit=gt(Bw.bind(null,l,h,G,p,x,O,se,me,_e,ct,1,Ze,He)),Wh(l,G,se,!We);return}Bw(l,h,G,p,x,O,se,me,_e)}function IM(l){for(var h=l;;){var p=h.tag;if((p===0||p===11||p===15)&&h.flags&16384&&(p=h.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var x=0;x<p.length;x++){var O=p[x],G=O.getSnapshot;O=O.value;try{if(!nc(G(),O))return!1}catch{return!1}}if(p=h.child,h.subtreeFlags&16384&&p!==null)p.return=h,h=p;else{if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function Wh(l,h,p,x){h&=~R3,h&=~Sp,l.suspendedLanes|=h,l.pingedLanes&=~h,x&&(l.warmLanes|=h),x=l.expirationTimes;for(var O=h;0<O;){var G=31-yt(O),se=1<<G;x[G]=-1,O&=~se}p!==0&&Xn(l,p,h)}function gv(){return(di&6)===0?(Uw(0),!1):!0}function B3(){if(Ar!==null){if(hi===0)var l=Ar.return;else l=Ar,ge=Rh=null,jb(l),Ds=null,Ca=0,l=Ar;for(;l!==null;)U5(l.alternate,l),l=l.return;Ar=null}}function hm(l,h){var p=l.timeoutHandle;p!==-1&&(l.timeoutHandle=-1,zM(p)),p=l.cancelPendingCommit,p!==null&&(l.cancelPendingCommit=null,p()),B3(),Oi=l,Ar=p=jo(l.current,null),Dr=h,hi=0,cc=null,Uh=!1,om=vt(l,h),N3=!1,am=Wc=R3=Sp=jh=cs=0,Na=Pw=null,M3=!1,(h&8)!==0&&(h|=h&32);var x=l.entangledLanes;if(x!==0)for(l=l.entanglements,x&=h;0<x;){var O=31-yt(x),G=1<<O;h|=l[O],x&=~G}return Td=h,rp(),p}function nT(l,h){fr=null,R.H=bw,h===zo||h===Lb?(h=l5(),hi=3):h===a5?(h=l5(),hi=4):hi=h===O5?8:h!==null&&typeof h=="object"&&typeof h.then=="function"?6:1,cc=h,Ar===null&&(cs=1,Sw(l,Uo(h,l.current)))}function rT(){var l=R.H;return R.H=bw,l===null?bw:l}function iT(){var l=R.A;return R.A=TM,l}function L3(){cs=4,Uh||(Dr&4194048)!==Dr&&oc.current!==null||(om=!0),(jh&134217727)===0&&(Sp&134217727)===0||Oi===null||Wh(Oi,Dr,Wc,!1)}function $3(l,h,p){var x=di;di|=2;var O=rT(),G=iT();(Oi!==l||Dr!==h)&&(Dw=null,hm(l,h)),h=!1;var se=cs;e:do try{if(hi!==0&&Ar!==null){var me=Ar,_e=cc;switch(hi){case 8:B3(),se=6;break e;case 3:case 2:case 9:case 6:oc.current===null&&(h=!0);var We=hi;if(hi=0,cc=null,fm(l,me,_e,We),p&&om){se=0;break e}break;default:We=hi,hi=0,cc=null,fm(l,me,_e,We)}}NM(),se=cs;break}catch(ct){nT(l,ct)}while(!0);return h&&l.shellSuspendCounter++,ge=Rh=null,di=x,R.H=O,R.A=G,Ar===null&&(Oi=null,Dr=0,rp()),se}function NM(){for(;Ar!==null;)U3(Ar)}function RM(l,h){var p=di;di|=2;var x=rT(),O=iT();Oi!==l||Dr!==h?(Dw=null,cm=At()+500,hm(l,h)):om=vt(l,h);e:do try{if(hi!==0&&Ar!==null){h=Ar;var G=cc;t:switch(hi){case 1:hi=0,cc=null,fm(l,h,G,1);break;case 2:case 9:if(c5(G)){hi=0,cc=null,oT(h);break}h=function(){hi!==2&&hi!==9||Oi!==l||(hi=7),xu(l)},G.then(h,h);break e;case 3:hi=7;break e;case 4:hi=5;break e;case 7:c5(G)?(hi=0,cc=null,oT(h)):(hi=0,cc=null,fm(l,h,G,7));break;case 5:var se=null;switch(Ar.tag){case 26:se=Ar.memoizedState;case 5:case 27:var me=Ar;if(!se||Us(se)){hi=0,cc=null;var _e=me.sibling;if(_e!==null)Ar=_e;else{var We=me.return;We!==null?(Ar=We,mv(We)):Ar=null}break t}}hi=0,cc=null,fm(l,h,G,5);break;case 6:hi=0,cc=null,fm(l,h,G,6);break;case 8:B3(),cs=6;break e;default:throw Error(r(462))}}sT();break}catch(ct){nT(l,ct)}while(!0);return ge=Rh=null,R.H=x,R.A=O,di=p,Ar!==null?0:(Oi=null,Dr=0,rp(),cs)}function sT(){for(;Ar!==null&&!ht();)U3(Ar)}function U3(l){var h=cv(l.alternate,l,Td);l.memoizedProps=l.pendingProps,h===null?mv(l):Ar=h}function oT(l){var h=l,p=h.alternate;switch(h.tag){case 15:case 0:h=ov(p,h,h.pendingProps,h.type,void 0,Dr);break;case 11:h=ov(p,h,h.pendingProps,h.type.render,h.ref,Dr);break;case 5:jb(h);default:U5(p,h),h=Ar=X0(h,Td),h=cv(p,h,Td)}l.memoizedProps=l.pendingProps,h===null?mv(l):Ar=h}function fm(l,h,p,x){ge=Rh=null,jb(h),Ds=null,Ca=0;var O=h.return;try{if(k5(l,O,h,p,Dr)){cs=1,Sw(l,Uo(p,l.current)),Ar=null;return}}catch(G){if(O!==null)throw Ar=O,G;cs=1,Sw(l,Uo(p,l.current)),Ar=null;return}h.flags&32768?(Cr||x===1?l=!0:om||(Dr&536870912)!==0?l=!1:(Uh=l=!0,(x===2||x===9||x===3||x===6)&&(x=oc.current,x!==null&&x.tag===13&&(x.flags|=16384))),aT(h,l)):mv(h)}function mv(l){var h=l;do{if((h.flags&32768)!==0){aT(h,Uh);return}l=h.return;var p=L5(h.alternate,h,Td);if(p!==null){Ar=p;return}if(h=h.sibling,h!==null){Ar=h;return}Ar=h=l}while(h!==null);cs===0&&(cs=5)}function aT(l,h){do{var p=$5(l.alternate,l);if(p!==null){p.flags&=32767,Ar=p;return}if(p=l.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!h&&(l=l.sibling,l!==null)){Ar=l;return}Ar=l=p}while(l!==null);cs=6,Ar=null}function Bw(l,h,p,x,O,G,se,me,_e){l.cancelPendingCommit=null;do wv();while(po!==0);if((di&6)!==0)throw Error(r(327));if(h!==null){if(h===l.current)throw Error(r(177));if(G=h.lanes|h.childLanes,G|=zE,vn(l,p,G,se,me,_e),l===Oi&&(Ar=Oi=null,Dr=0),lm=h,Fh=l,um=p,O3=G,P3=O,X5=x,(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,gT(Jt,function(){return hT(),null})):(l.callbackNode=null,l.callbackPriority=0),x=(h.flags&13878)!==0,(h.subtreeFlags&13878)!==0||x){x=R.T,R.T=null,O=P.p,P.p=2,se=di,di|=4;try{_M(l,h,p)}finally{di=se,P.p=O,R.T=x}}po=1,cT(),lT(),uT()}}function cT(){if(po===1){po=0;var l=Fh,h=lm,p=(h.flags&13878)!==0;if((h.subtreeFlags&13878)!==0||p){p=R.T,R.T=null;var x=P.p;P.p=2;var O=di;di|=4;try{_3(h,l);var G=Sv,se=X4(l.containerInfo),me=G.focusedElem,_e=G.selectionRange;if(se!==me&&me&&me.ownerDocument&&Q4(me.ownerDocument.documentElement,me)){if(_e!==null&&UE(me)){var We=_e.start,ct=_e.end;if(ct===void 0&&(ct=We),"selectionStart"in me)me.selectionStart=We,me.selectionEnd=Math.min(ct,me.value.length);else{var gt=me.ownerDocument||document,Ze=gt&>.defaultView||window;if(Ze.getSelection){var He=Ze.getSelection(),Wn=me.textContent.length,Un=Math.min(_e.start,Wn),wi=_e.end===void 0?Un:Math.min(_e.end,Wn);!He.extend&&Un>wi&&(se=wi,wi=Un,Un=se);var Le=$E(me,Un),Ne=$E(me,wi);if(Le&&Ne&&(He.rangeCount!==1||He.anchorNode!==Le.node||He.anchorOffset!==Le.offset||He.focusNode!==Ne.node||He.focusOffset!==Ne.offset)){var ze=gt.createRange();ze.setStart(Le.node,Le.offset),He.removeAllRanges(),Un>wi?(He.addRange(ze),He.extend(Ne.node,Ne.offset)):(ze.setEnd(Ne.node,Ne.offset),He.addRange(ze))}}}}for(gt=[],He=me;He=He.parentNode;)He.nodeType===1&>.push({element:He,left:He.scrollLeft,top:He.scrollTop});for(typeof me.focus=="function"&&me.focus(),me=0;me<gt.length;me++){var dt=gt[me];dt.element.scrollLeft=dt.left,dt.element.scrollTop=dt.top}}Mv=!!Dl,Sv=Dl=null}finally{di=O,P.p=x,R.T=p}}l.current=h,po=2}}function lT(){if(po===2){po=0;var l=Fh,h=lm,p=(h.flags&8772)!==0;if((h.subtreeFlags&8772)!==0||p){p=R.T,R.T=null;var x=P.p;P.p=2;var O=di;di|=4;try{F5(l,h.alternate,h)}finally{di=O,P.p=x,R.T=p}}po=3}}function uT(){if(po===4||po===3){po=0,Dt();var l=Fh,h=lm,p=um,x=X5;(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?po=5:(po=0,lm=Fh=null,dT(l,l.pendingLanes));var O=l.pendingLanes;if(O===0&&(zh=null),Cn(p),h=h.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(at,h,void 0,(h.current.flags&128)===128)}catch{}if(x!==null){h=R.T,O=P.p,P.p=2,R.T=null;try{for(var G=l.onRecoverableError,se=0;se<x.length;se++){var me=x[se];G(me.value,{componentStack:me.stack})}}finally{R.T=h,P.p=O}}(um&3)!==0&&wv(),xu(l),O=l.pendingLanes,(p&4194090)!==0&&(O&42)!==0?l===D3?dm++:(dm=0,D3=l):dm=0,Uw(0)}}function dT(l,h){(l.pooledCacheLanes&=h)===0&&(h=l.pooledCache,h!=null&&(l.pooledCache=null,iw(h)))}function wv(l){return cT(),lT(),uT(),hT()}function hT(){if(po!==5)return!1;var l=Fh,h=O3;O3=0;var p=Cn(um),x=R.T,O=P.p;try{P.p=32>p?32:p,R.T=null,p=P3,P3=null;var G=Fh,se=um;if(po=0,lm=Fh=null,um=0,(di&6)!==0)throw Error(r(331));var me=di;if(di|=4,Z5(G.current),K5(G,G.current,se,p),di=me,Uw(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(at,G)}catch{}return!0}finally{P.p=O,R.T=x,dT(l,h)}}function fT(l,h,p){h=Uo(p,h),h=nv(l.stateNode,h,2),l=wd(l,h,2),l!==null&&(_n(l,2),xu(l))}function Si(l,h,p){if(l.tag===3)fT(l,l,p);else for(;h!==null;){if(h.tag===3){fT(h,l,p);break}else if(h.tag===1){var x=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(zh===null||!zh.has(x))){l=Uo(p,l),p=y3(2),x=wd(h,p,2),x!==null&&(M5(p,x,h,l),_n(x,2),xu(x));break}}h=h.return}}function j3(l,h,p){var x=l.pingCache;if(x===null){x=l.pingCache=new I3;var O=new Set;x.set(h,O)}else O=x.get(h),O===void 0&&(O=new Set,x.set(h,O));O.has(p)||(N3=!0,O.add(p),l=MM.bind(null,l,h,p),h.then(l,l))}function MM(l,h,p){var x=l.pingCache;x!==null&&x.delete(h),l.pingedLanes|=l.suspendedLanes&p,l.warmLanes&=~p,Oi===l&&(Dr&p)===p&&(cs===4||cs===3&&(Dr&62914560)===Dr&&300>At()-k3?(di&2)===0&&hm(l,0):R3|=p,am===Dr&&(am=0)),xu(l)}function pT(l,h){h===0&&(h=dn()),l=ip(l,h),l!==null&&(_n(l,h),xu(l))}function yv(l){var h=l.memoizedState,p=0;h!==null&&(p=h.retryLane),pT(l,p)}function kM(l,h){var p=0;switch(l.tag){case 13:var x=l.stateNode,O=l.memoizedState;O!==null&&(p=O.retryLane);break;case 19:x=l.stateNode;break;case 22:x=l.stateNode._retryCache;break;default:throw Error(r(314))}x!==null&&x.delete(h),pT(l,p)}function gT(l,h){return Me(l,h)}var Lw=null,Hh=null,bv=!1,$w=!1,vv=!1,Vh=0;function xu(l){l!==Hh&&l.next===null&&(Hh===null?Lw=Hh=l:Hh=Hh.next=l),$w=!0,bv||(bv=!0,z3())}function Uw(l,h){if(!vv&&$w){vv=!0;do for(var p=!1,x=Lw;x!==null;){if(l!==0){var O=x.pendingLanes;if(O===0)var G=0;else{var se=x.suspendedLanes,me=x.pingedLanes;G=(1<<31-yt(42|l)+1)-1,G&=O&~(se&~me),G=G&201326741?G&201326741|1:G?G|2:0}G!==0&&(p=!0,wT(x,G))}else G=Dr,G=De(x,x===Oi?G:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(G&3)===0||vt(x,G)||(p=!0,wT(x,G));x=x.next}while(p);vv=!1}}function OM(){jw()}function jw(){$w=bv=!1;var l=0;Vh!==0&&(jM()&&(l=Vh),Vh=0);for(var h=At(),p=null,x=Lw;x!==null;){var O=x.next,G=zw(x,h);G===0?(x.next=null,p===null?Lw=O:p.next=O,O===null&&(Hh=p)):(p=x,(l!==0||(G&3)!==0)&&($w=!0)),x=O}Uw(l)}function zw(l,h){for(var p=l.suspendedLanes,x=l.pingedLanes,O=l.expirationTimes,G=l.pendingLanes&-62914561;0<G;){var se=31-yt(G),me=1<<se,_e=O[se];_e===-1?((me&p)===0||(me&x)!==0)&&(O[se]=jt(me,h)):_e<=h&&(l.expiredLanes|=me),G&=~me}if(h=Oi,p=Dr,p=De(l,l===h?p:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),x=l.callbackNode,p===0||l===h&&(hi===2||hi===9)||l.cancelPendingCommit!==null)return x!==null&&x!==null&&Fe(x),l.callbackNode=null,l.callbackPriority=0;if((p&3)===0||vt(l,p)){if(h=p&-p,h===l.callbackPriority)return h;switch(x!==null&&Fe(x),Cn(p)){case 2:case 8:p=Yt;break;case 32:p=Jt;break;case 268435456:p=Kt;break;default:p=Jt}return x=mT.bind(null,l),p=Me(p,x),l.callbackPriority=h,l.callbackNode=p,h}return x!==null&&x!==null&&Fe(x),l.callbackPriority=2,l.callbackNode=null,2}function mT(l,h){if(po!==0&&po!==5)return l.callbackNode=null,l.callbackPriority=0,null;var p=l.callbackNode;if(wv()&&l.callbackNode!==p)return null;var x=Dr;return x=De(l,l===Oi?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),x===0?null:(eT(l,x,h),zw(l,At()),l.callbackNode!=null&&l.callbackNode===p?mT.bind(null,l):null)}function wT(l,h){if(wv())return null;eT(l,h,!0)}function z3(){FM(function(){(di&6)!==0?Me(yn,OM):jw()})}function xv(){return Vh===0&&(Vh=kt()),Vh}function yT(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:W0(""+l)}function bT(l,h){var p=h.ownerDocument.createElement("input");return p.name=h.name,p.value=h.value,l.id&&p.setAttribute("form",l.id),h.parentNode.insertBefore(p,h),l=new FormData(l),p.parentNode.removeChild(p),l}function PM(l,h,p,x,O){if(h==="submit"&&p&&p.stateNode===O){var G=yT((O[Ce]||null).action),se=x.submitter;se&&(h=(h=se[Ce]||null)?yT(h.formAction):se.getAttribute("formAction"),h!==null&&(G=h,se=null));var me=new wb("action","action",null,x,O);l.push({event:me,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(Vh!==0){var _e=se?bT(O,se):new FormData(O);ww(p,{pending:!0,data:_e,method:O.method,action:G},null,_e)}}else typeof G=="function"&&(me.preventDefault(),_e=se?bT(O,se):new FormData(O),ww(p,{pending:!0,data:_e,method:O.method,action:G},G,_e))},currentTarget:O}]})}}for(var F3=0;F3<Gr.length;F3++){var W3=Gr[F3],DM=W3.toLowerCase(),BM=W3[0].toUpperCase()+W3.slice(1);Il(DM,"on"+BM)}Il(Nb,"onAnimationEnd"),Il(J4,"onAnimationIteration"),Il(rc,"onAnimationStart"),Il("dblclick","onDoubleClick"),Il("focusin","onFocus"),Il("focusout","onBlur"),Il(Rb,"onTransitionRun"),Il(yM,"onTransitionStart"),Il(zg,"onTransitionCancel"),Il(Y0,"onTransitionEnd"),Ja("onMouseEnter",["mouseout","mouseover"]),Ja("onMouseLeave",["mouseout","mouseover"]),Ja("onPointerEnter",["pointerout","pointerover"]),Ja("onPointerLeave",["pointerout","pointerover"]),ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fw="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(" "),LM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fw));function vT(l,h){h=(h&4)!==0;for(var p=0;p<l.length;p++){var x=l[p],O=x.event;x=x.listeners;e:{var G=void 0;if(h)for(var se=x.length-1;0<=se;se--){var me=x[se],_e=me.instance,We=me.currentTarget;if(me=me.listener,_e!==G&&O.isPropagationStopped())break e;G=me,O.currentTarget=We;try{G(O)}catch(ct){xp(ct)}O.currentTarget=null,G=_e}else for(se=0;se<x.length;se++){if(me=x[se],_e=me.instance,We=me.currentTarget,me=me.listener,_e!==G&&O.isPropagationStopped())break e;G=me,O.currentTarget=We;try{G(O)}catch(ct){xp(ct)}O.currentTarget=null,G=_e}}}}function Sr(l,h){var p=h[Ye];p===void 0&&(p=h[Ye]=new Set);var x=l+"__bubble";p.has(x)||(xT(h,l,2,!1),p.add(x))}function H3(l,h,p){var x=0;h&&(x|=4),xT(p,l,x,h)}var Ra="_reactListening"+Math.random().toString(36).slice(2);function V3(l){if(!l[Ra]){l[Ra]=!0,Sl.forEach(function(p){p!=="selectionchange"&&(LM.has(p)||H3(p,!1,l),H3(p,!0,l))});var h=l.nodeType===9?l:l.ownerDocument;h===null||h[Ra]||(h[Ra]=!0,H3("selectionchange",!1,h))}}function xT(l,h,p,x){switch(jT(h)){case 2:var O=tk;break;case 8:O=vm;break;default:O=tA}p=O.bind(null,h,p,l),O=void 0,!V0||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(O=!0),x?O!==void 0?l.addEventListener(h,p,{capture:!0,passive:O}):l.addEventListener(h,p,!0):O!==void 0?l.addEventListener(h,p,{passive:O}):l.addEventListener(h,p,!1)}function Id(l,h,p,x,O){var G=x;if((h&1)===0&&(h&2)===0&&x!==null)e:for(;;){if(x===null)return;var se=x.tag;if(se===3||se===4){var me=x.stateNode.containerInfo;if(me===O)break;if(se===4)for(se=x.return;se!==null;){var _e=se.tag;if((_e===3||_e===4)&&se.stateNode.containerInfo===O)return;se=se.return}for(;me!==null;){if(se=Rr(me),se===null)return;if(_e=se.tag,_e===5||_e===6||_e===26||_e===27){x=G=se;continue e}me=me.parentNode}}x=x.return}k4(function(){var We=G,ct=CE(p),gt=[];e:{var Ze=G0.get(l);if(Ze!==void 0){var He=wb,Wn=l;switch(l){case"keypress":if(gi(p)===0)break e;case"keydown":case"keyup":He=kE;break;case"focusin":Wn="focus",He=bb;break;case"focusout":Wn="blur",He=bb;break;case"beforeblur":case"afterblur":He=bb;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":He=Ah;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":He=ME;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":He=lM;break;case Nb:case J4:case rc:He=L4;break;case Y0:He=uM;break;case"scroll":case"scrollend":He=oM;break;case"wheel":He=hM;break;case"copy":case"cut":case"paste":He=U4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":He=fd;break;case"toggle":case"beforetoggle":He=xb}var Un=(h&4)!==0,wi=!Un&&(l==="scroll"||l==="scrollend"),Le=Un?Ze!==null?Ze+"Capture":null:Ze;Un=[];for(var Ne=We,ze;Ne!==null;){var dt=Ne;if(ze=dt.stateNode,dt=dt.tag,dt!==5&&dt!==26&&dt!==27||ze===null||Le===null||(dt=H0(Ne,Le),dt!=null&&Un.push(Jn(Ne,dt,ze))),wi)break;Ne=Ne.return}0<Un.length&&(Ze=new He(Ze,Wn,null,p,ct),gt.push({event:Ze,listeners:Un}))}}if((h&7)===0){e:{if(Ze=l==="mouseover"||l==="pointerover",He=l==="mouseout"||l==="pointerout",Ze&&p!==gb&&(Wn=p.relatedTarget||p.fromElement)&&(Rr(Wn)||Wn[ke]))break e;if((He||Ze)&&(Ze=ct.window===ct?ct:(Ze=ct.ownerDocument)?Ze.defaultView||Ze.parentWindow:window,He?(Wn=p.relatedTarget||p.toElement,He=We,Wn=Wn?Rr(Wn):null,Wn!==null&&(wi=s(Wn),Un=Wn.tag,Wn!==wi||Un!==5&&Un!==27&&Un!==6)&&(Wn=null)):(He=null,Wn=We),He!==Wn)){if(Un=Ah,dt="onMouseLeave",Le="onMouseEnter",Ne="mouse",(l==="pointerout"||l==="pointerover")&&(Un=fd,dt="onPointerLeave",Le="onPointerEnter",Ne="pointer"),wi=He==null?Ze:Kr(He),ze=Wn==null?Ze:Kr(Wn),Ze=new Un(dt,Ne+"leave",He,p,ct),Ze.target=wi,Ze.relatedTarget=ze,dt=null,Rr(ct)===We&&(Un=new Un(Le,Ne+"enter",Wn,p,ct),Un.target=ze,Un.relatedTarget=wi,dt=Un),wi=dt,He&&Wn)t:{for(Un=He,Le=Wn,Ne=0,ze=Un;ze;ze=Ls(ze))Ne++;for(ze=0,dt=Le;dt;dt=Ls(dt))ze++;for(;0<Ne-ze;)Un=Ls(Un),Ne--;for(;0<ze-Ne;)Le=Ls(Le),ze--;for(;Ne--;){if(Un===Le||Le!==null&&Un===Le.alternate)break t;Un=Ls(Un),Le=Ls(Le)}Un=null}else Un=null;He!==null&&ls(gt,Ze,He,Un,!1),Wn!==null&&wi!==null&&ls(gt,wi,Wn,Un,!0)}}e:{if(Ze=We?Kr(We):window,He=Ze.nodeName&&Ze.nodeName.toLowerCase(),He==="select"||He==="input"&&Ze.type==="file")var an=q4;else if(_b(Ze))if(K4)an=gM;else{an=Ch;var mr=Z4}else He=Ze.nodeName,!He||He.toLowerCase()!=="input"||Ze.type!=="checkbox"&&Ze.type!=="radio"?We&&F0(We.elementType)&&(an=q4):an=Ib;if(an&&(an=an(l,We))){Lg(gt,an,p,ct);break e}mr&&mr(l,Ze,We),l==="focusout"&&We&&Ze.type==="number"&&We.memoizedProps.value!=null&&xt(Ze,"number",Ze.value)}switch(mr=We?Kr(We):window,l){case"focusin":(_b(mr)||mr.contentEditable==="true")&&(jg=mr,Th=We,Oe=null);break;case"focusout":Oe=Th=jg=null;break;case"mousedown":st=!0;break;case"contextmenu":case"mouseup":case"dragend":st=!1,Je(gt,p,ct);break;case"selectionchange":if(wM)break;case"keydown":case"keyup":Je(gt,p,ct)}var Tn;if(DE)e:{switch(l){case"compositionstart":var Hn="onCompositionStart";break e;case"compositionend":Hn="onCompositionEnd";break e;case"compositionupdate":Hn="onCompositionUpdate";break e}Hn=void 0}else Sh?H4(l,p)&&(Hn="onCompositionEnd"):l==="keydown"&&p.keyCode===229&&(Hn="onCompositionStart");Hn&&(Eb&&p.locale!=="ko"&&(Sh||Hn!=="onCompositionStart"?Hn==="onCompositionEnd"&&Sh&&(Tn=O4()):(Eh=ct,NE="value"in Eh?Eh.value:Eh.textContent,Sh=!0)),mr=Ev(We,Hn),0<mr.length&&(Hn=new ba(Hn,l,null,p,ct),gt.push({event:Hn,listeners:mr}),Tn?Hn.data=Tn:(Tn=Sb(p),Tn!==null&&(Hn.data=Tn)))),(Tn=W4?fM(l,p):V4(l,p))&&(Hn=Ev(We,"onBeforeInput"),0<Hn.length&&(mr=new ba("onBeforeInput","beforeinput",null,p,ct),gt.push({event:mr,listeners:Hn}),mr.data=Tn)),PM(gt,l,We,p,ct)}vT(gt,h)})}function Jn(l,h,p){return{instance:l,listener:h,currentTarget:p}}function Ev(l,h){for(var p=h+"Capture",x=[];l!==null;){var O=l,G=O.stateNode;if(O=O.tag,O!==5&&O!==26&&O!==27||G===null||(O=H0(l,p),O!=null&&x.unshift(Jn(l,O,G)),O=H0(l,h),O!=null&&x.push(Jn(l,O,G))),l.tag===3)return x;l=l.return}return[]}function Ls(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function ls(l,h,p,x,O){for(var G=h._reactName,se=[];p!==null&&p!==x;){var me=p,_e=me.alternate,We=me.stateNode;if(me=me.tag,_e!==null&&_e===x)break;me!==5&&me!==26&&me!==27||We===null||(_e=We,O?(We=H0(p,G),We!=null&&se.unshift(Jn(p,We,_e))):O||(We=H0(p,G),We!=null&&se.push(Jn(p,We,_e)))),p=p.return}se.length!==0&&l.push({event:h,listeners:se})}var $M=/\r\n?/g,qh=/\u0000|\uFFFD/g;function ET(l){return(typeof l=="string"?l:""+l).replace($M,` 42`).replace(qh,"")}function AT(l,h){return h=ET(h),ET(l)===h}function Av(){}function mi(l,h,p,x,O,G){switch(p){case"children":typeof x=="string"?h==="body"||h==="textarea"&&x===""||pi(l,x):(typeof x=="number"||typeof x=="bigint")&&h!=="body"&&pi(l,""+x);break;case"className":Tl(l,"class",x);break;case"tabIndex":Tl(l,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":Tl(l,p,x);break;case"style":dd(l,x,G);break;case"data":if(h!=="object"){Tl(l,"data",x);break}case"src":case"href":if(x===""&&(h!=="a"||p!=="href")){l.removeAttribute(p);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){l.removeAttribute(p);break}x=W0(""+x),l.setAttribute(p,x);break;case"action":case"formAction":if(typeof x=="function"){l.setAttribute(p,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof G=="function"&&(p==="formAction"?(h!=="input"&&mi(l,h,"name",O.name,O,null),mi(l,h,"formEncType",O.formEncType,O,null),mi(l,h,"formMethod",O.formMethod,O,null),mi(l,h,"formTarget",O.formTarget,O,null)):(mi(l,h,"encType",O.encType,O,null),mi(l,h,"method",O.method,O,null),mi(l,h,"target",O.target,O,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){l.removeAttribute(p);break}x=W0(""+x),l.setAttribute(p,x);break;case"onClick":x!=null&&(l.onclick=Av);break;case"onScroll":x!=null&&Sr("scroll",l);break;case"onScrollEnd":x!=null&&Sr("scrollend",l);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(p=x.__html,p!=null){if(O.children!=null)throw Error(r(60));l.innerHTML=p}}break;case"multiple":l.multiple=x&&typeof x!="function"&&typeof x!="symbol";break;case"muted":l.muted=x&&typeof x!="function"&&typeof x!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(x==null||typeof x=="function"||typeof x=="boolean"||typeof x=="symbol"){l.removeAttribute("xlink:href");break}p=W0(""+x),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":x!=null&&typeof x!="function"&&typeof x!="symbol"?l.setAttribute(p,""+x):l.removeAttribute(p);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
42ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":x&&typeof x!="function"&&typeof x!="symbol"?l.setAttribute(p,""):l.removeAttribute(p);break;case"capture":case"download":x===!0?l.setAttribute(p,""):x!==!1&&x!=null&&typeof x!="function"&&typeof x!="symbol"?l.setAttribute(p,x):l.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":x!=null&&typeof x!="function"&&typeof x!="symbol"&&!isNaN(x)&&1<=x?l.setAttribute(p,x):l.removeAttribute(p);break;case"rowSpan":case"start":x==null||typeof x=="function"||typeof x=="symbol"||isNaN(x)?l.removeAttribute(p):l.setAttribute(p,x);break;case"popover":Sr("beforetoggle",l),Sr("toggle",l),ec(l,"popover",x);break;case"xlinkActuate":Ao(l,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":Ao(l,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":Ao(l,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":Ao(l,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":Ao(l,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":Ao(l,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":Ao(l,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":Ao(l,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":Ao(l,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":ec(l,"is",x);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=pb.get(p)||p,ec(l,p,x))}}function q3(l,h,p,x,O,G){switch(p){case"style":dd(l,x,G);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(p=x.__html,p!=null){if(O.children!=null)throw Error(r(60));l.innerHTML=p}}break;case"children":typeof x=="string"?pi(l,x):(typeof x=="number"||typeof x=="bigint")&&pi(l,""+x);break;case"onScroll":x!=null&&Sr("scroll",l);break;case"onScrollEnd":x!=null&&Sr("scrollend",l);break;case"onClick":x!=null&&(l.onclick=Av);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!uu.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(O=p.endsWith("Capture"),h=p.slice(2,O?p.length-7:void 0),G=l[Ce]||null,G=G!=null?G[p]:null,typeof G=="function"&&l.removeEventListener(h,G,O),typeof x=="function")){typeof G!="function"&&G!==null&&(p in l?l[p]=null:l.hasAttribute(p)&&l.removeAttribute(p)),l.addEventListener(h,x,O);break e}p in l?l[p]=x:x===!0?l.setAttribute(p,""):ec(l,p,x)}}}function $s(l,h,p){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Sr("error",l),Sr("load",l);var x=!1,O=!1,G;for(G in p)if(p.hasOwnProperty(G)){var se=p[G];if(se!=null)switch(G){case"src":x=!0;break;case"srcSet":O=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,h));default:mi(l,h,G,se,p,null)}}O&&mi(l,h,"srcSet",p.srcSet,p,null),x&&mi(l,h,"src",p.src,p,null);return;case"input":Sr("invalid",l);var me=G=se=O=null,_e=null,We=null;for(x in p)if(p.hasOwnProperty(x)){var ct=p[x];if(ct!=null)switch(x){case"name":O=ct;break;case"type":se=ct;break;case"checked":_e=ct;break;case"defaultChecked":We=ct;break;case"value":G=ct;break;case"defaultValue":me=ct;break;case"children":case"dangerouslySetInnerHTML":if(ct!=null)throw Error(r(137,h));break;default:mi(l,h,x,ct,p,null)}}Pe(l,G,me,_e,We,se,O,!1),xh(l);return;case"select":Sr("invalid",l),x=se=G=null;for(O in p)if(p.hasOwnProperty(O)&&(me=p[O],me!=null))switch(O){case"value":G=me;break;case"defaultValue":se=me;break;case"multiple":x=me;default:mi(l,h,O,me,p,null)}h=G,p=se,l.multiple=!!x,h!=null?Et(l,!!x,h,!1):p!=null&&Et(l,!!x,p,!0);return;case"textarea":Sr("invalid",l),G=O=x=null;for(se in p)if(p.hasOwnProperty(se)&&(me=p[se],me!=null))switch(se){case"value":x=me;break;case"defaultValue":O=me;break;case"children":G=me;break;case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(91));break;default:mi(l,h,se,me,p,null)}$n(l,x,O,G),xh(l);return;case"option":for(_e in p)if(p.hasOwnProperty(_e)&&(x=p[_e],x!=null))switch(_e){case"selected":l.selected=x&&typeof x!="function"&&typeof x!="symbol";break;default:mi(l,h,_e,x,p,null)}return;case"dialog":Sr("beforetoggle",l),Sr("toggle",l),Sr("cancel",l),Sr("close",l);break;case"iframe":case"object":Sr("load",l);break;case"video":case"audio":for(x=0;x<Fw.length;x++)Sr(Fw[x],l);break;case"image":Sr("error",l),Sr("load",l);break;case"details":Sr("toggle",l);break;case"embed":case"source":case"link":Sr("error",l),Sr("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(We in p)if(p.hasOwnProperty(We)&&(x=p[We],x!=null))switch(We){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,h));default:mi(l,h,We,x,p,null)}return;default:if(F0(h)){for(ct in p)p.hasOwnProperty(ct)&&(x=p[ct],x!==void 0&&q3(l,h,ct,x,p,void 0));return}}for(me in p)p.hasOwnProperty(me)&&(x=p[me],x!=null&&mi(l,h,me,x,p,null))}function UM(l,h,p,x){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var O=null,G=null,se=null,me=null,_e=null,We=null,ct=null;for(He in p){var gt=p[He];if(p.hasOwnProperty(He)&>!=null)switch(He){case"checked":break;case"value":break;case"defaultValue":_e=gt;default:x.hasOwnProperty(He)||mi(l,h,He,null,x,gt)}}for(var Ze in x){var He=x[Ze];if(gt=p[Ze],x.hasOwnProperty(Ze)&&(He!=null||gt!=null))switch(Ze){case"type":G=He;break;case"name":O=He;break;case"checked":We=He;break;case"defaultChecked":ct=He;break;case"value":se=He;break;case"defaultValue":me=He;break;case"children":case"dangerouslySetInnerHTML":if(He!=null)throw Error(r(137,h));break;default:He!==gt&&mi(l,h,Ze,He,x,gt)}}$e(l,se,me,_e,We,ct,G,O);return;case"select":He=se=me=Ze=null;for(G in p)if(_e=p[G],p.hasOwnProperty(G)&&_e!=null)switch(G){case"value":break;case"multiple":He=_e;default:x.hasOwnProperty(G)||mi(l,h,G,null,x,_e)}for(O in x)if(G=x[O],_e=p[O],x.hasOwnProperty(O)&&(G!=null||_e!=null))switch(O){case"value":Ze=G;break;case"defaultValue":me=G;break;case"multiple":se=G;default:G!==_e&&mi(l,h,O,G,x,_e)}h=me,p=se,x=He,Ze!=null?Et(l,!!p,Ze,!1):!!x!=!!p&&(h!=null?Et(l,!!p,h,
vendor: 22,092 bytes, line 42
42!0):Et(l,!!p,p?[]:"",!1));return;case"textarea":He=Ze=null;for(me in p)if(O=p[me],p.hasOwnProperty(me)&&O!=null&&!x.hasOwnProperty(me))switch(me){case"value":break;case"children":break;default:mi(l,h,me,null,x,O)}for(se in x)if(O=x[se],G=p[se],x.hasOwnProperty(se)&&(O!=null||G!=null))switch(se){case"value":Ze=O;break;case"defaultValue":He=O;break;case"children":break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:O!==G&&mi(l,h,se,O,x,G)}hn(l,Ze,He);return;case"option":for(var Wn in p)if(Ze=p[Wn],p.hasOwnProperty(Wn)&&Ze!=null&&!x.hasOwnProperty(Wn))switch(Wn){case"selected":l.selected=!1;break;default:mi(l,h,Wn,null,x,Ze)}for(_e in x)if(Ze=x[_e],He=p[_e],x.hasOwnProperty(_e)&&Ze!==He&&(Ze!=null||He!=null))switch(_e){case"selected":l.selected=Ze&&typeof Ze!="function"&&typeof Ze!="symbol";break;default:mi(l,h,_e,Ze,x,He)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Un in p)Ze=p[Un],p.hasOwnProperty(Un)&&Ze!=null&&!x.hasOwnProperty(Un)&&mi(l,h,Un,null,x,Ze);for(We in x)if(Ze=x[We],He=p[We],x.hasOwnProperty(We)&&Ze!==He&&(Ze!=null||He!=null))switch(We){case"children":case"dangerouslySetInnerHTML":if(Ze!=null)throw Error(r(137,h));break;default:mi(l,h,We,Ze,x,He)}return;default:if(F0(h)){for(var wi in p)Ze=p[wi],p.hasOwnProperty(wi)&&Ze!==void 0&&!x.hasOwnProperty(wi)&&q3(l,h,wi,void 0,x,Ze);for(ct in x)Ze=x[ct],He=p[ct],!x.hasOwnProperty(ct)||Ze===He||Ze===void 0&&He===void 0||q3(l,h,ct,Ze,x,He);return}}for(var Le in p)Ze=p[Le],p.hasOwnProperty(Le)&&Ze!=null&&!x.hasOwnProperty(Le)&&mi(l,h,Le,null,x,Ze);for(gt in x)Ze=x[gt],He=p[gt],!x.hasOwnProperty(gt)||Ze===He||Ze==null&&He==null||mi(l,h,gt,Ze,x,He)}var Dl=null,Sv=null;function _p(l){return l.nodeType===9?l:l.ownerDocument}function Yi(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ts(l,h){if(l===0)switch(h){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&h==="foreignObject"?0:l}function _v(l,h){return l==="textarea"||l==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.children=="bigint"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var K3=null;function jM(){var l=window.event;return l&&l.type==="popstate"?l===K3?!1:(K3=l,!0):(K3=null,!1)}var ST=typeof setTimeout=="function"?setTimeout:void 0,zM=typeof clearTimeout=="function"?clearTimeout:void 0,_T=typeof Promise=="function"?Promise:void 0,FM=typeof queueMicrotask=="function"?queueMicrotask:typeof _T<"u"?function(l){return _T.resolve(null).then(l).catch(CT)}:ST;function CT(l){setTimeout(function(){throw l})}function Hc(l){return l==="head"}function Cv(l,h){var p=h,x=0,O=0;do{var G=p.nextSibling;if(l.removeChild(p),G&&G.nodeType===8)if(p=G.data,p==="/$"){if(0<x&&8>x){p=x;var se=l.ownerDocument;if(p&1&&Ww(se.documentElement),p&2&&Ww(se.body),p&4)for(p=se.head,Ww(p),se=p.firstChild;se;){var me=se.nextSibling,_e=se.nodeName;se[or]||_e==="SCRIPT"||_e==="STYLE"||_e==="LINK"&&se.rel.toLowerCase()==="stylesheet"||p.removeChild(se),se=me}}if(O===0){l.removeChild(G),Qw(h);return}O--}else p==="$"||p==="$?"||p==="$!"?O++:x=p.charCodeAt(0)-48;else x=0;p=G}while(p);Qw(h)}function Y3(l){var h=l.firstChild;for(h&&h.nodeType===10&&(h=h.nextSibling);h;){var p=h;switch(h=h.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":Y3(p),gn(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}l.removeChild(p)}}function TT(l,h,p,x){for(;l.nodeType===1;){var O=p;if(l.nodeName.toLowerCase()!==h.toLowerCase()){if(!x&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(x){if(!l[or])switch(h){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(G=l.getAttribute("rel"),G==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(G!==O.rel||l.getAttribute("href")!==(O.href==null||O.href===""?null:O.href)||l.getAttribute("crossorigin")!==(O.crossOrigin==null?null:O.crossOrigin)||l.getAttribute("title")!==(O.title==null?null:O.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(G=l.getAttribute("src"),(G!==(O.src==null?null:O.src)||l.getAttribute("type")!==(O.type==null?null:O.type)||l.getAttribute("crossorigin")!==(O.crossOrigin==null?null:O.crossOrigin))&&G&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(h==="input"&&l.type==="hidden"){var G=O.name==null?null:""+O.name;if(O.type==="hidden"&&l.getAttribute("name")===G)return l}else return l;if(l=Bl(l.nextSibling),l===null)break}return null}function Tv(l,h,p){if(h==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!p||(l=Bl(l.nextSibling),l===null))return null;return l}function Ho(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState==="complete"}function pm(l,h){var p=l.ownerDocument;if(l.data!=="$?"||p.readyState==="complete")h();else{var x=function(){h(),p.removeEventListener("DOMContentLoaded",x)};p.addEventListener("DOMContentLoaded",x),l._reactRetry=x}}function Bl(l){for(;l!=null;l=l.nextSibling){var h=l.nodeType;if(h===1||h===3)break;if(h===8){if(h=l.data,h==="$"||h==="$!"||h==="$?"||h==="F!"||h==="F")break;if(h==="/$")return null}}return l}var G3=null;function IT(l){l=l.previousSibling;for(var h=0;l;){if(l.nodeType===8){var p=l.data;if(p==="$"||p==="$!"||p==="$?"){if(h===0)return l;h--}else p==="/$"&&h++}l=l.previousSibling}return null}function NT(l,h,p){switch(h=_p(p),l){case"html":if(l=h.documentElement,!l)throw Error(r(452));return l;case"head":if(l=h.head,!l)throw Error(r(453));return l;case"body":if(l=h.body,!l)throw Error(r(454));return l;default:throw Error(r(451))}}function Ww(l){for(var h=l.attributes;h.length;)l.removeAttributeNode(h[0]);gn(l)}var uc=new Map,Eu=new Set;function rr(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var Au=P.d;P.d={f:Vc,r:RT,D:WM,C:MT,L:Iv,m:HM,X:qM,S:VM,M:KM};function Vc(){var l=Au.f(),h=gv();return l||h}function RT(l){var h=ga(l);h!==null&&h.tag===5&&h.type==="form"?Xb(h):Au.r(l)}var gm=typeof document>"u"?null:document;function Zr(l,h,p){var x=gm;if(x&&typeof h=="string"&&h){var O=ft(h);O='link[rel="'+l+'"][href="'+O+'"]',typeof p=="string"&&(O+='[crossorigin="'+p+'"]'),Eu.has(O)||(Eu.add(O),l={rel:l,crossOrigin:p,href:h},x.querySelector(O)===null&&(h=x.createElement("link"),$s(h,"link",l),ki(h),x.head.appendChild(h)))}}function WM(l){Au.D(l),Zr("dns-prefetch",l,null)}function MT(l,h){Au.C(l,h),Zr("preconnect",l,h)}function Iv(l,h,p){Au.L(l,h,p);var x=gm;if(x&&l&&h){var O='link[rel="preload"][as="'+ft(h)+'"]';h==="image"&&p&&p.imageSrcSet?(O+='[imagesrcset="'+ft(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(O+='[imagesizes="'+ft(p.imageSizes)+'"]')):O+='[href="'+ft(l)+'"]';var G=O;switch(h){case"style":G=mm(l);break;case"script":G=wm(l)}uc.has(G)||(l=d({rel:"preload",href:h==="image"&&p&&p.imageSrcSet?void 0:l,as:h},p),uc.set(G,l),x.querySelector(O)!==null||h==="style"&&x.querySelector(Hw(G))||h==="script"&&x.querySelector(Vw(G))||(h=x.createElement("link"),$s(h,"link",l),ki(h),x.head.appendChild(h)))}}function HM(l,h){Au.m(l,h);var p=gm;if(p&&l){var x=h&&typeof h.as=="string"?h.as:"script",O='link[rel="modulepreload"][as="'+ft(x)+'"][href="'+ft(l)+'"]',G=O;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":G=wm(l)}if(!uc.has(G)&&(l=d({rel:"modulepreload",href:l},h),uc.set(G,l),p.querySelector(O)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Vw(G)))return}x=p.createElement("link"),$s(x,"link",l),ki(x),p.head.appendChild(x)}}}function VM(l,h,p){Au.S(l,h,p);var x=gm;if(x&&l){var O=Yr(x).hoistableStyles,G=mm(l);h=h||"default";var se=O.get(G);if(!se){var me={loading:0,preload:null};if(se=x.querySelector(Hw(G)))me.loading=5;else{l=d({rel:"stylesheet",href:l,"data-precedence":h},p),(p=uc.get(G))&&qw(l,p);var _e=se=x.createElement("link");ki(_e),$s(_e,"link",l),_e._p=new Promise(function(We,ct){_e.onload=We,_e.onerror=ct}),_e.addEventListener("load",function(){me.loading|=1}),_e.addEventListener("error",function(){me.loading|=2}),me.loading|=4,Nv(se,h,x)}se={type:"stylesheet",instance:se,count:1,state:me},O.set(G,se)}}}function qM(l,h){Au.X(l,h);var p=gm;if(p&&l){var x=Yr(p).hoistableScripts,O=wm(l),G=x.get(O);G||(G=p.querySelector(Vw(O)),G||(l=d({src:l,async:!0},h),(h=uc.get(O))&&Z3(l,h),G=p.createElement("script"),ki(G),$s(G,"link",l),p.head.appendChild(G)),G={type:"script",instance:G,count:1,state:null},x.set(O,G))}}function KM(l,h){Au.M(l,h);var p=gm;if(p&&l){var x=Yr(p).hoistableScripts,O=wm(l),G=x.get(O);G||(G=p.querySelector(Vw(O)),G||(l=d({src:l,async:!0,type:"module"},h),(h=uc.get(O))&&Z3(l,h),G=p.createElement("script"),ki(G),$s(G,"link",l),p.head.appendChild(G)),G={type:"script",instance:G,count:1,state:null},x.set(O,G))}}function kT(l,h,p,x){var O=(O=ae.current)?rr(O):null;if(!O)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(h=mm(p.href),p=Yr(O).hoistableStyles,x=p.get(h),x||(x={type:"style",instance:null,count:0,state:null},p.set(h,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){l=mm(p.href);var G=Yr(O).hoistableStyles,se=G.get(l);if(se||(O=O.ownerDocument||O,se={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},G.set(l,se),(G=O.querySelector(Hw(l)))&&!G._p&&(se.instance=G,se.state.loading=5),uc.has(l)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},uc.set(l,p),G||YM(O,l,p,se.state))),h&&x===null)throw Error(r(528,""));return se}if(h&&x!==null)throw Error(r(529,""));return null;case"script":return h=p.async,p=p.src,typeof p=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=wm(p),p=Yr(O).hoistableScripts,x=p.get(h),x||(x={type:"script",instance:null,count:0,state:null},p.set(h,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function mm(l){return'href="'+ft(l)+'"'}function Hw(l){return'link[rel="stylesheet"]['+l+"]"}function OT(l){return d({},l,{"data-precedence":l.precedence,precedence:null})}function YM(l,h,p,x){l.querySelector('link[rel="preload"][as="style"]['+h+"]")?x.loading=1:(h=l.createElement("link"),x.preload=h,h.addEventListener("load",function(){return x.loading|=1}),h.addEventListener("error",function(){return x.loading|=2}),$s(h,"link",p),ki(h),l.head.appendChild(h))}function wm(l){return'[src="'+ft(l)+'"]'}function Vw(l){return"script[async]"+l}function PT(l,h,p){if(h.count++,h.instance===null)switch(h.type){case"style":var x=l.querySelector('style[data-href~="'+ft(p.href)+'"]');if(x)return h.instance=x,ki(x),x;var O=d({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return x=(l.ownerDocument||l).createElement("style"),ki(x),$s(x,"style",O),Nv(x,p.precedence,l),h.instance=x;case"stylesheet":O=mm(p.href);var G=l.querySelector(Hw(O));if(G)return h.state.loading|=4,h.instance=G,ki(G),G;x=OT(p),(O=uc.get(O))&&qw(x,O),G=(l.ownerDocument||l).createElement("link"),ki(G);var se=G;return se._p=new Promise(function(me,_e){se.onload=me,se.onerror=_e}),$s(G,"link",x),h.state.loading|=4,Nv(G,p.precedence,l),h.instance=G;case"script":return G=wm(p.src),(O=l.querySelector(Vw(G)))?(h.instance=O,ki(O),O):(x=p,(O=uc.get(G))&&(x=d({},p),Z3(x,O)),l=l.ownerDocument||l,O=l.createElement("script"),ki(O),$s(O,"link",x),l.head.appendChild(O),h.instance=O);case"void":return null;default:throw Error(r(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(x=h.instance,h.state.loading|=4,Nv(x,p.precedence,l));return h.instance}function Nv(l,h,p){for(var x=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),O=x.length?x[x.length-1]:null,G=O,se=0;se<x.length;se++){var me=x[se];if(me.dataset.precedence===h)G=me;else if(G!==O)break}G?G.parentNode.insertBefore(l,G.nextSibling):(h=p.nodeType===9?p.head:p,h.insertBefore(l,h.firstChild))}function qw(l,h){l.crossOrigin==null&&(l.crossOrigin=h.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=h.referrerPolicy),l.title==null&&(l.title=h.title)}function Z3(l,h){l.crossOrigin==null&&(l.crossOrigin=h.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=h.referrerPolicy),l.integrity==null&&(l.integrity=h.integrity)}var ym=null;function DT(l,h,p){if(ym===null){var x=new Map,O=ym=new Map;O.set(p,x)}else O=ym,x=O.get(p),x||(x=new Map,O.set(p,x));if(x.has(l))return x;for(x.set(l,null),p=p.getElementsByTagName(l),O=0;O<p.length;O++){var G=p[O];if(!(G[or]||G[ye]||l==="link"&&G.getAttribute("rel")==="stylesheet")&&G.namespaceURI!=="http://www.w3.org/2000/svg"){var se=G.getAttribute(h)||"";se=l+se;var me=x.get(se);me?me.push(G):x.set(se,[G])}}return x}function BT(l,h,p){l=l.ownerDocument||l,l.head.insertBefore(p,h==="title"?l.querySelector("head > title"):null)}function GM(l,h,p){if(p===1||h.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return l=h.disabled,typeof h.precedence=="string"&&l==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function Us(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}var ro=null;function ZM(){}function QM(l,h,p){if(ro===null)throw Error(r(475));var x=ro;if(h.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var O=mm(p.href),G=l.querySelector(Hw(O));if(G){l=G._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(x.count++,x=Kw.bind(x),l.then(x,x)),h.state.loading|=4,h.instance=G,ki(G);return}G=l.ownerDocument||l,p=OT(p),(O=uc.get(O))&&qw(p,O),G=G.createElement("link"),ki(G);var se=G;se._p=new Promise(function(me,_e){se.onload=me,se.onerror=_e}),$s(G,"link",p),h.instance=G}x.stylesheets===null&&(x.stylesheets=new Map),x.stylesheets.set(h,l),(l=h.state.preload)&&(h.state.loading&3)===0&&(x.count++,h=Kw.bind(x),l.addEventListener("load",h),l.addEventListener("error",h))}}function XM(){if(ro===null)throw Error(r(475));var l=ro;return l.stylesheets&&l.count===0&&Q3(l,l.stylesheets),0<l.count?function(h){var p=setTimeout(function(){if(l.stylesheets&&Q3(l,l.stylesheets),l.unsuspend){var x=l.unsuspend;l.unsuspend=null,x()}},6e4);return l.unsuspend=h,function(){l.unsuspend=null,clearTimeout(p)}}:null}function Kw(){if(this.count--,this.count===0){if(this.stylesheets)Q3(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Rv=null;function Q3(l,h){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Rv=new Map,h.forEach(JM,l),Rv=null,Kw.call(l))}function JM(l,h){if(!(h.state.loading&4)){var p=Rv.get(l);if(p)var x=p.get(null);else{p=new Map,Rv.set(l,p);for(var O=l.querySelectorAll("link[data-precedence],style[data-precedence]"),G=0;G<O.length;G++){var se=O[G];(se.nodeName==="LINK"||se.getAttribute("media")!=="not all")&&(p.set(se.dataset.precedence,se),x=se)}x&&p.set(null,x)}O=h.instance,se=O.getAttribute("data-precedence"),G=p.get(se)||x,G===x&&p.set(null,O),p.set(se,O),this.count++,x=Kw.bind(this),O.addEventListener("load",x),O.addEventListener("error",x),G?G.parentNode.insertBefore(O,G.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(O,l.firstChild)),h.state.loading|=4}}var bm={$$typeof:I,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function ek(l,h,p,x,O,G,se,me){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.hiddenUpdates=Ut(null),this.identifierPrefix=x,this.onUncaughtError=O,this.onCaughtError=G,this.onRecoverableError=se,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=me,this.incompleteTransitions=new Map}function LT(l,h,p,x,O,G,se,me,_e,We,ct,gt){return l=new ek(l,h,p,se,me,_e,We,gt),h=1,G===!0&&(h|=24),G=va(3,null,null,h),l.current=G,G.stateNode=l,h=VE(),h.refCount++,l.pooledCache=h,h.refCount++,G.memoizedState={element:x,isDehydrated:p,cache:h},hp(G),l}function $T(l){return l?(l=sp,l):sp}function X3(l,h,p,x,O,G){O=$T(O),x.context===null?x.context=O:x.pendingContext=O,x=Mh(h),x.payload={element:p},G=G===void 0?null:G,G!==null&&(x.callback=G),p=wd(l,x,h),p!==null&&(lc(p,l,h),ow(p,l,h))}function J3(l,h){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var p=l.retryLane;l.retryLane=p!==0&&p<h?p:h}}function eA(l,h){J3(l,h),(l=l.alternate)&&J3(l,h)}function UT(l){if(l.tag===13){var h=ip(l,67108864);h!==null&&lc(h,l,67108864),eA(l,67108864)}}var Mv=!0;function tk(l,h,p,x){var O=R.T;R.T=null;var G=P.p;try{P.p=2,tA(l,h,p,x)}finally{P.p=G,R.T=O}}function vm(l,h,p,x){var O=R.T;R.T=null;var G=P.p;try{P.p=8,tA(l,h,p,x)}finally{P.p=G,R.T=O}}function tA(l,h,p,x){if(Mv){var O=nA(x);if(O===null)Id(l,h,x,kv,p),zT(l,x);else if(rk(O,l,h,p,x))x.stopPropagation();else if(zT(l,x),h&4&&-1<nk.indexOf(l)){for(;O!==null;){var G=ga(O);if(G!==null)switch(G.tag){case 3:if(G=G.stateNode,G.current.memoizedState.isDehydrated){var se=Te(G.pendingLanes);if(se!==0){var me=G;for(me.pendingLanes|=2,me.entangledLanes|=2;se;){var _e=1<<31-yt(se);me.entanglements[1]|=_e,se&=~_e}xu(G),(di&6)===0&&(cm=At()+500,Uw(0))}}break;case 13:me=ip(G,2),me!==null&&lc(me,G,2),gv(),eA(G,2)}if(G=nA(x),G===null&&Id(l,h,x,kv,p),G===O)break;O=G}O!==null&&x.stopPropagation()}else Id(l,h,x,null,p)}}function nA(l){return l=CE(l),rA(l)}var kv=null;function rA(l){if(kv=null,l=Rr(l),l!==null){var h=s(l);if(h===null)l=null;else{var p=h.tag;if(p===13){if(l=o(h),l!==null)return l;l=null}else if(p===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;l=null}else h!==l&&(l=null)}}return kv=l,null}function jT(l){switch(l){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Wt()){case yn:return 2;case Yt:return 8;case Jt:case bn:return 32;case Kt:return 268435456;default:return 32}default:return 32}}var Ov=!1,Nd=null,Kh=null,Yh=null,Yw=new Map,Gw=new Map,Gh=[],nk="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".split(" ");function zT(l,h){switch(l){case"focusin":case"focusout":Nd=null;break;case"dragenter":case"dragleave":Kh=null;break;case"mouseover":case"mouseout":Yh=null;break;case"pointerover":case"pointerout":Yw.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gw.delete(h.pointerId)}}function Zw(l,h,p,x,O,G){return l===null||l.nativeEvent!==G?(l={blockedOn:h,domEventName:p,eventSystemFlags:x,nativeEvent:G,targetContainers:[O]},h!==null&&(h=ga(h),h!==null&&UT(h)),l):(l.eventSystemFlags|=x,h=l.targetContainers,O!==null&&h.indexOf(O)===-1&&h.push(O),l)}function rk(l,h,p,x,O){switch(h){case"focusin":return Nd=Zw(Nd,l,h,p,x,O),!0;case"dragenter":return Kh=Zw(Kh,l,h,p,x,O),!0;case"mouseover":return Yh=Zw(Yh,l,h,p,x,O),!0;case"pointerover":var G=O.pointerId;return Yw.set(G,Zw(Yw.get(G)||null,l,h,p,x,O)),!0;case"gotpointercapture":return G=O.pointerId,Gw.set(G,Zw(Gw.get(G)||null,l,h,p,x,O)),!0}return!1}function FT(l){var h=Rr(l.target);if(h!==null){var p=s(h);if(p!==null){if(h=p.tag,h===13){if(h=o(p),h!==null){l.blockedOn=h,te(l.priority,function(){if(p.tag===13){var x=To();x=tr(x);var O=ip(p,x);O!==null&&lc(O,p,x),eA(p,x)}});return}}else if(h===3&&p.stateNode.current.memoizedState.isDehydrated){l.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}l.blockedOn=null}function Pv(l){if(l.blockedOn!==null)return!1;for(var h=l.targetContainers;0<h.length;){var p=nA(l.nativeEvent);if(p===null){p=l.nativeEvent;var x=new p.constructor(p.type,p);gb=x,p.target.dispatchEvent(x),gb=null}else return h=ga(p),h!==null&&UT(h),l.blockedOn=p,!1;h.shift()}return!0}function WT(l,h,p){Pv(l)&&p.delete(h)}function ik(){Ov=!1,Nd!==null&&Pv(Nd)&&(Nd=null),Kh!==null&&Pv(Kh)&&(Kh=null),Yh!==null&&Pv(Yh)&&(Yh=null),Yw.forEac
vendor: 1,076 bytes, line 42
42h(WT),Gw.forEach(WT)}function Dv(l,h){l.blockedOn===h&&(l.blockedOn=null,Ov||(Ov=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,ik)))}var Bv=null;function HT(l){Bv!==l&&(Bv=l,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bv===l&&(Bv=null);for(var h=0;h<l.length;h+=3){var p=l[h],x=l[h+1],O=l[h+2];if(typeof x!="function"){if(rA(x||p)===null)continue;break}var G=ga(p);G!==null&&(l.splice(h,3),h-=3,ww(G,{pending:!0,data:O,method:p.method,action:x},x,O))}}))}function Qw(l){function h(_e){return Dv(_e,l)}Nd!==null&&Dv(Nd,l),Kh!==null&&Dv(Kh,l),Yh!==null&&Dv(Yh,l),Yw.forEach(h),Gw.forEach(h);for(var p=0;p<Gh.length;p++){var x=Gh[p];x.blockedOn===l&&(x.blockedOn=null)}for(;0<Gh.length&&(p=Gh[0],p.blockedOn===null);)FT(p),p.blockedOn===null&&Gh.shift();if(p=(l.ownerDocument||l).$$reactFormReplay,p!=null)for(x=0;x<p.length;x+=3){var O=p[x],G=p[x+1],se=O[Ce]||null;if(typeof G=="function")se||HT(p);else if(se){var me=null;if(G&&G.hasAttribute("formAction")){if(O=G,se=G[Ce]||null)me=se.formAction;else if(rA(O)!==null)continue}else me=se.action;
vendor: 2,341 bytes, line 42
42typeof me=="function"?p[x+1]=me:(p.splice(x,3),x-=3),HT(p)}}}function iA(l){this._internalRoot=l}Lv.prototype.render=iA.prototype.render=function(l){var h=this._internalRoot;if(h===null)throw Error(r(409));var p=h.current,x=To();X3(p,x,l,h,null,null)},Lv.prototype.unmount=iA.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var h=l.containerInfo;X3(l.current,2,null,l,null,null),gv(),h[ke]=null}};function Lv(l){this._internalRoot=l}Lv.prototype.unstable_scheduleHydration=function(l){if(l){var h=de();l={blockedOn:null,target:l,priority:h};for(var p=0;p<Gh.length&&h!==0&&h<Gh[p].priority;p++);Gh.splice(p,0,l),p===0&&FT(l)}};var VT=e.version;if(VT!=="19.1.1")throw Error(r(527,VT,"19.1.1"));P.findDOMNode=function(l){var h=l._reactInternals;if(h===void 0)throw typeof l.render=="function"?Error(r(188)):(l=Object.keys(l).join(","),Error(r(268,l)));return l=c(h),l=l!==null?u(l):null,l=l===null?null:l.stateNode,l};var sk={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$v.isDisabled&&$v.supportsFiber)try{at=$v.inject(sk),rt=$v}catch{}}return oA.createRoot=function(l,h){if(!i(l))throw Error(r(299));var p=!1,x="",O=w3,G=tv,se=R5,me=null;return h!=null&&(h.unstable_strictMode===!0&&(p=!0),h.identifierPrefix!==void 0&&(x=h.identifierPrefix),h.onUncaughtError!==void 0&&(O=h.onUncaughtError),h.onCaughtError!==void 0&&(G=h.onCaughtError),h.onRecoverableError!==void 0&&(se=h.onRecoverableError),h.unstable_transitionCallbacks!==void 0&&(me=h.unstable_transitionCallbacks)),h=LT(l,1,!1,null,null,p,x,O,G,se,me,null),l[ke]=h.current,V3(l),new iA(h)},oA.hydrateRoot=function(l,h,p){if(!i(l))throw Error(r(299));var x=!1,O="",G=w3,se=tv,me=R5,_e=null,We=null;return p!=null&&(p.unstable_strictMode===!0&&(x=!0),p.identifierPrefix!==void 0&&(O=p.identifierPrefix),p.onUncaughtError!==void 0&&(G=p.onUncaughtError),p.onCaughtError!==void 0&&(se=p.onCaughtError),p.onRecoverableError!==void 0&&(me=p.onRecoverableError),p.unstable_transitionCallbacks!==void 0&&(_e=p.unstable_transitionCallbacks),p.formState!==void 0&&(We=p.formState)),h=LT(l,1,!0,h,p??null,x,O,G,se,me,_e,We),h.context=$T(null),p=h.current,x=To(),x=tr(x),O=Mh(x),O.callback=null,w
vendor: 25,397 bytes, lines 42-47
42d(p,O,x),p=x,h.current.lanes=p,_n(h,p),xu(h),l[ke]=h.current,V3(l),new Lv(h)},oA.version="19.1.1",oA}var Tz;function $le(){if(Tz)return dk.exports;Tz=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),dk.exports=Lle(),dk.exports}var Ule=$le(),jL={},I8={};I8.byteLength=Fle;I8.toByteArray=Hle;I8.fromByteArray=Kle;var vf=[],Lu=[],jle=typeof Uint8Array<"u"?Uint8Array:Array,gk="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Uv=0,zle=gk.length;Uv<zle;++Uv)vf[Uv]=gk[Uv],Lu[gk.charCodeAt(Uv)]=Uv;Lu[45]=62;Lu[95]=63;function AX(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function Fle(n){var e=AX(n),t=e[0],r=e[1];return(t+r)*3/4-r}function Wle(n,e,t){return(e+t)*3/4-t}function Hle(n){var e,t=AX(n),r=t[0],i=t[1],s=new jle(Wle(n,r,i)),o=0,a=i>0?r-4:r,c;for(c=0;c<a;c+=4)e=Lu[n.charCodeAt(c)]<<18|Lu[n.charCodeAt(c+1)]<<12|Lu[n.charCodeAt(c+2)]<<6|Lu[n.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Lu[n.charCodeAt(c)]<<2|Lu[n.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Lu[n.charCodeAt(c)]<<10|Lu[n.charCodeAt(c+1)]<<4|Lu[n.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Vle(n){return vf[n>>18&63]+vf[n>>12&63]+vf[n>>6&63]+vf[n&63]}function qle(n,e,t){for(var r,i=[],s=e;s<t;s+=3)r=(n[s]<<16&16711680)+(n[s+1]<<8&65280)+(n[s+2]&255),i.push(Vle(r));return i.join("")}function Kle(n){for(var e,t=n.length,r=t%3,i=[],s=16383,o=0,a=t-r;o<a;o+=s)i.push(qle(n,o,o+s>a?a:o+s));return r===1?(e=n[t-1],i.push(vf[e>>2]+vf[e<<4&63]+"==")):r===2&&(e=(n[t-2]<<8)+n[t-1],i.push(vf[e>>10]+vf[e>>4&63]+vf[e<<2&63]+"=")),i.join("")}var zL={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */zL.read=function(n,e,t,r,i){var s,o,a=i*8-r-1,c=(1<<a)-1,u=c>>1,d=-7,f=t?i-1:0,m=t?-1:1,w=n[e+f];for(f+=m,s=w&(1<<-d)-1,w>>=-d,d+=a;d>0;s=s*256+n[e+f],f+=m,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=r;d>0;o=o*256+n[e+f],f+=m,d-=8);if(s===0)s=1-u;else{if(s===c)return o?NaN:(w?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-u}return(w?-1:1)*o*Math.pow(2,s-r)};zL.write=function(n,e,t,r,i,s){var o,a,c,u=s*8-i-1,d=(1<<u)-1,f=d>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=r?0:s-1,y=r?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=m/c:e+=m*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=d?(a=0,o=d):o+f>=1?(a=(e*c-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;n[t+w]=a&255,w+=y,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;n[t+w]=o&255,w+=y,o/=256,u-=8);n[t+w-y]|=b*128};/*! 43 * The buffer module from node.js, for the browser. 44 * 45 * @author Feross Aboukhadijeh <https://feross.org> 46 * @license MIT 47 */(function(n){const e=I8,t=zL,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=d,n.SlowBuffer=L,n.INSPECT_MAX_BYTES=50;const i=2147483647;n.kMaxLength=i;const{Uint8Array:s,ArrayBuffer:o,SharedArrayBuffer:a}=globalThis;d.TYPED_ARRAY_SUPPORT=c(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const oe=new s(1),Q={foo:function(){return 42}};return Object.setPrototypeOf(Q,s.prototype),Object.setPrototypeOf(oe,Q),oe.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function u(oe){if(oe>i)throw new RangeError('The value "'+oe+'" is invalid for option "size"');const Q=new s(oe);return Object.setPrototypeOf(Q,d.prototype),Q}function d(oe,Q,ee){if(typeof oe=="number"){if(typeof Q=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(oe)}return f(oe,Q,ee)}d.poolSize=8192;function f(oe,Q,ee){if(typeof oe=="string")return b(oe,Q);if(o.isView(oe))return T(oe);if(oe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oe);if(Xe(oe,o)||oe&&Xe(oe.buffer,o)||typeof a<"u"&&(Xe(oe,a)||oe&&Xe(oe.buffer,a)))return N(oe,Q,ee);if(typeof oe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const fe=oe.valueOf&&oe.valueOf();if(fe!=null&&fe!==oe)return d.from(fe,Q,ee);const Ee=I(oe);if(Ee)return Ee;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof oe[Symbol.toPrimitive]=="function")return d.from(oe[Symbol.toPrimitive]("string"),Q,ee);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oe)}d.from=function(oe,Q,ee){return f(oe,Q,ee)},Object.setPrototypeOf(d.prototype,s.prototype),Object.setPrototypeOf(d,s);function m(oe){if(typeof oe!="number")throw new TypeError('"size" argument must be of type number');if(oe<0)throw new RangeError('The value "'+oe+'" is invalid for option "size"')}function w(oe,Q,ee){return m(oe),oe<=0?u(oe):Q!==void 0?typeof ee=="string"?u(oe).fill(Q,ee):u(oe).fill(Q):u(oe)}d.alloc=function(oe,Q,ee){return w(oe,Q,ee)};function y(oe){return m(oe),u(oe<0?0:H(oe)|0)}d.allocUnsafe=function(oe){return y(oe)},d.allocUnsafeSlow=function(oe){return y(oe)};function b(oe,Q){if((typeof Q!="string"||Q==="")&&(Q="utf8"),!d.isEncoding(Q))throw new TypeError("Unknown encoding: "+Q);const ee=U(oe,Q)|0;let fe=u(ee);const Ee=fe.write(oe,Q);return Ee!==ee&&(fe=fe.slice(0,Ee)),fe}function E(oe){const Q=oe.length<0?0:H(oe.length)|0,ee=u(Q);for(let fe=0;fe<Q;fe+=1)ee[fe]=oe[fe]&255;return ee}function T(oe){if(Xe(oe,s)){const Q=new s(oe);return N(Q.buffer,Q.byteOffset,Q.byteLength)}return E(oe)}function N(oe,Q,ee){if(Q<0||oe.byteLength<Q)throw new RangeError('"offset" is outside of buffer bounds');if(oe.byteLength<Q+(ee||0))throw new RangeError('"length" is outside of buffer bounds');let fe;return Q===void 0&&ee===void 0?fe=new s(oe):ee===void 0?fe=new s(oe,Q):fe=new s(oe,Q,ee),Object.setPrototypeOf(fe,d.prototype),fe}function I(oe){if(d.isBuffer(oe)){const Q=H(oe.length)|0,ee=u(Q);return ee.length===0||oe.copy(ee,0,0,Q),ee}if(oe.length!==void 0)return typeof oe.length!="number"||at(oe.length)?u(0):E(oe);if(oe.type==="Buffer"&&Array.isArray(oe.data))return E(oe.data)}function H(oe){if(oe>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return oe|0}function L(oe){return+oe!=oe&&(oe=0),d.alloc(+oe)}d.isBuffer=function(Q){return Q!=null&&Q._isBuffer===!0&&Q!==d.prototype},d.compare=function(Q,ee){if(Xe(Q,s)&&(Q=d.from(Q,Q.offset,Q.byteLength)),Xe(ee,s)&&(ee=d.from(ee,ee.offset,ee.byteLength)),!d.isBuffer(Q)||!d.isBuffer(ee))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Q===ee)return 0;let fe=Q.length,Ee=ee.length;for(let Te=0,De=Math.min(fe,Ee);Te<De;++Te)if(Q[Te]!==ee[Te]){fe=Q[Te],Ee=ee[Te];break}return fe<Ee?-1:Ee<fe?1:0},d.isEncoding=function(Q){switch(String(Q).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(Q,ee){if(!Array.isArray(Q))throw new TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return d.alloc(0);let fe;if(ee===void 0)for(ee=0,fe=0;fe<Q.length;++fe)ee+=Q[fe].length;const Ee=d.allocUnsafe(ee);let Te=0;for(fe=0;fe<Q.length;++fe){let De=Q[fe];if(Xe(De,s))Te+De.length>Ee.length?(d.isBuffer(De)||(De=d.from(De)),De.copy(Ee,Te)):s.prototype.set.call(Ee,De,Te);else if(d.isBuffer(De))De.copy(Ee,Te);else throw new TypeError('"list" argument must be an Array of Buffers');Te+=De.length}return Ee};function U(oe,Q){if(d.isBuffer(oe))return oe.length;if(o.isView(oe)||Xe(oe,o))return oe.byteLength;if(typeof oe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof oe);const ee=oe.length,fe=arguments.length>2&&arguments[2]===!0;if(!fe&&ee===0)return 0;let Ee=!1;for(;;)switch(Q){case"ascii":case"latin1":case"binary":return ee;case"utf8":case"utf-8":return Yt(oe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee*2;case"hex":return ee>>>1;case"base64":return Kt(oe).length;default:if(Ee)return fe?-1:Yt(oe).length;Q=(""+Q).toLowerCase(),Ee=!0}}d.byteLength=U;function K(oe,Q,ee){let fe=!1;if((Q===void 0||Q<0)&&(Q=0),Q>this.length||((ee===void 0||ee>this.length)&&(ee=this.length),ee<=0)||(ee>>>=0,Q>>>=0,ee<=Q))return"";for(oe||(oe="utf8");;)switch(oe){case"hex":return C(this,Q,ee);case"utf8":case"utf-8":return P(this,Q,ee);case"ascii":return z(this,Q,ee);case"latin1":case"binary":return B(this,Q,ee);case"base64":return R(this,Q,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,Q,ee);default:if(fe)throw new TypeError("Unknown encoding: "+oe);oe=(oe+"").toLowerCase(),fe=!0}}d.prototype._isBuffer=!0;function Y(oe,Q,ee){const fe=oe[Q];oe[Q]=oe[ee],oe[ee]=fe}d.prototype.swap16=function(){const Q=this.length;if(Q%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ee=0;ee<Q;ee+=2)Y(this,ee,ee+1);return this},d.prototype.swap32=function(){const Q=this.length;if(Q%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let ee=0;ee<Q;ee+=4)Y(this,ee,ee+3),Y(this,ee+1,ee+2);return this},d.prototype.swap64=function(){const Q=this.length;if(Q%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let ee=0;ee<Q;ee+=8)Y(this,ee,ee+7),Y(this,ee+1,ee+6),Y(this,ee+2,ee+5),Y(this,ee+3,ee+4);return this},d.prototype.toString=function(){const Q=this.length;return Q===0?"":arguments.length===0?P(this,0,Q):K.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(Q){if(!d.isBuffer(Q))throw new TypeError("Argument must be a Buffer");return this===Q?!0:d.compare(this,Q)===0},d.prototype.inspect=function(){let Q="";const ee=n.INSPECT_MAX_BYTES;return Q=this.toString("hex",0,ee).replace(/(.{2})/g,"$1 ").trim(),this.length>ee&&(Q+=" ... "),"<Buffer "+Q+">"},r&&(d.prototype[r]=d.prototype.inspect),d.prototype.compare=function(Q,ee,fe,Ee,Te){if(Xe(Q,s)&&(Q=d.from(Q,Q.offset,Q.byteLength)),!d.isBuffer(Q))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Q);if(ee===void 0&&(ee=0),fe===void 0&&(fe=Q?Q.length:0),Ee===void 0&&(Ee=0),Te===void 0&&(Te=this.length),ee<0||fe>Q.length||Ee<0||Te>this.length)throw new RangeError("out of range index");if(Ee>=Te&&ee>=fe)return 0;if(Ee>=Te)return-1;if(ee>=fe)return 1;if(ee>>>=0,fe>>>=0,Ee>>>=0,Te>>>=0,this===Q)return 0;let De=Te-Ee,vt=fe-ee;const jt=Math.min(De,vt),kt=this.slice(Ee,Te),dn=Q.slice(ee,fe);for(let Ut=0;Ut<jt;++Ut)if(kt[Ut]!==dn[Ut]){De=kt[Ut],vt=dn[Ut];break}return De<vt?-1:vt<De?1:0};function k(oe,Q,ee,fe,Ee){if(oe.length===0)return-1;if(typeof ee=="string"?(fe=ee,ee=0):ee>2147483647?ee=2147483647:ee<-2147483648&&(ee=-2147483648),ee=+ee,at(ee)&&(ee=Ee?0:oe.length-1),ee<0&&(ee=oe.length+ee),ee>=oe.length){if(Ee)return-1;ee=oe.length-1}else if(ee<0)if(Ee)ee=0;else return-1;if(typeof Q=="string"&&(Q=d.from(Q,fe)),d.isBuffer(Q))return Q.length===0?-1:j(oe,Q,ee,fe,Ee);if(typeof Q=="number")return Q=Q&255,typeof s.prototype.indexOf=="function"?Ee?s.prototype.indexOf.call(oe,Q,ee):s.prototype.lastIndexOf.call(oe,Q,ee):j(oe,[Q],ee,fe,Ee);throw new TypeError("val must be string, number or Buffer")}function j(oe,Q,ee,fe,Ee){let Te=1,De=oe.length,vt=Q.length;if(fe!==void 0&&(fe=String(fe).toLowerCase(),fe==="ucs2"||fe==="ucs-2"||fe==="utf16le"||fe==="utf-16le")){if(oe.length<2||Q.length<2)return-1;Te=2,De/=2,vt/=2,ee/=2}function jt(dn,Ut){return Te===1?dn[Ut]:dn.readUInt16BE(Ut*Te)}let kt;if(Ee){let dn=-1;for(kt=ee;kt<De;kt++)if(jt(oe,kt)===jt(Q,dn===-1?0:kt-dn)){if(dn===-1&&(dn=kt),kt-dn+1===vt)return dn*Te}else dn!==-1&&(kt-=kt-dn),dn=-1}else for(ee+vt>De&&(ee=De-vt),kt=ee;kt>=0;kt--){let dn=!0;for(let Ut=0;Ut<vt;Ut++)if(jt(oe,kt+Ut)!==jt(Q,Ut)){dn=!1;break}if(dn)return kt}return-1}d.prototype.includes=function(Q,ee,fe){return this.indexOf(Q,ee,fe)!==-1},d.prototype.indexOf=function(Q,ee,fe){return k(this,Q,ee,fe,!0)},d.prototype.lastIndexOf=function(Q,ee,fe){return k(this,Q,ee,fe,!1)};function V(oe,Q,ee,fe){ee=Number(ee)||0;const Ee=oe.length-ee;fe?(fe=Number(fe),fe>Ee&&(fe=Ee)):fe=Ee;const Te=Q.length;fe>Te/2&&(fe=Te/2);let De;for(De=0;De<fe;++De){const vt=parseInt(Q.substr(De*2,2),16);if(at(vt))return De;oe[ee+De]=vt}return De}function W(oe,Q,ee,fe){return En(Yt(Q,oe.length-ee),oe,ee,fe)}function $(oe,Q,ee,fe){return En(Jt(Q),oe,ee,fe)}function A(oe,Q,ee,fe){return En(Kt(Q),oe,ee,fe)}function _(oe,Q,ee,fe){return En(bn(Q,oe.length-ee),oe,ee,fe)}d.prototype.write=function(Q,ee,fe,Ee){if(ee===void 0)Ee="utf8",fe=this.length,ee=0;else if(fe===void 0&&typeof ee=="string")Ee=ee,fe=this.length,ee=0;else if(isFinite(ee))ee=ee>>>0,isFinite(fe)?(fe=fe>>>0,Ee===void 0&&(Ee="utf8")):(Ee=fe,fe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Te=this.length-ee;if((fe===void 0||fe>Te)&&(fe=Te),Q.length>0&&(fe<0||ee<0)||ee>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ee||(Ee="utf8");let De=!1;for(;;)switch(Ee){case"hex":return V(this,Q,ee,fe);case"utf8":case"utf-8":return W(this,Q,ee,fe);case"ascii":case"latin1":case"binary":return $(this,Q,ee,fe);case"base64":return A(this,Q,ee,fe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,Q,ee,fe);default:if(De)throw new TypeError("Unknown encoding: "+Ee);Ee=(""+Ee).toLowerCase(),De=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(oe,Q,ee){return Q===0&&ee===oe.length?e.fromByteArray(oe):e.fromByteArray(oe.slice(Q,ee))}function P(oe,Q,ee){ee=Math.min(oe.length,ee);const fe=[];let Ee=Q;for(;Ee<ee;){const Te=oe[Ee];let De=null,vt=Te>239?4:Te>223?3:Te>191?2:1;if(Ee+vt<=ee){let jt,kt,dn,Ut;switch(vt){case 1:Te<128&&(De=Te);break;case 2:jt=oe[Ee+1],(jt&192)===128&&(Ut=(Te&31)<<6|jt&63,Ut>127&&(De=Ut));break;case 3:jt=oe[Ee+1],kt=oe[Ee+2],(jt&192)===128&&(kt&192)===128&&(Ut=(Te&15)<<12|(jt&63)<<6|kt&63,Ut>2047&&(Ut<55296||Ut>57343)&&(De=Ut));break;case 4:jt=oe[Ee+1],kt=oe[Ee+2],dn=oe[Ee+3],(jt&192)===128&&(kt&192)===128&&(dn&192)===128&&(Ut=(Te&15)<<18|(jt&63)<<12|(kt&63)<<6|dn&63,Ut>65535&&Ut<1114112&&(De=Ut))}}De===null?(De=65533,vt=1):De>65535&&(De-=65536,fe.push(De>>>10&1023|55296),De=56320|De&1023),fe.push(De),Ee+=vt}return F(fe)}const q=4096;function F(oe){const Q=oe.length;if(Q<=q)return String.fromCharCode.apply(String,oe);let ee="",fe=0;for(;fe<Q;)ee+=String.fromCharCode.apply(String,oe.slice(fe,fe+=q));return ee}function z(oe,Q,ee){let fe="";ee=Math.min(oe.length,ee);for(let Ee=Q;Ee<ee;++Ee)fe+=String.fromCharCode(oe[Ee]&127);return fe}function B(oe,Q,ee){let fe="";ee=Math.min(oe.length,ee);for(let Ee=Q;Ee<ee;++Ee)fe+=String.fromCharCode(oe[Ee]);return fe}function C(oe,Q,ee){const fe=oe.length;(!Q||Q<0)&&(Q=0),(!ee||ee<0||ee>fe)&&(ee=fe);let Ee="";for(let Te=Q;Te<ee;++Te)Ee+=rt[oe[Te]];return Ee}function M(oe,Q,ee){const fe=oe.slice(Q,ee);let Ee="";for(let Te=0;Te<fe.length-1;Te+=2)Ee+=String.fromCharCode(fe[Te]+fe[Te+1]*256);return Ee}d.prototype.slice=function(Q,ee){const fe=this.length;Q=~~Q,ee=ee===void 0?fe:~~ee,Q<0?(Q+=fe,Q<0&&(Q=0)):Q>fe&&(Q=fe),ee<0?(ee+=fe,ee<0&&(ee=0)):ee>fe&&(ee=fe),ee<Q&&(ee=Q);const Ee=this.subarray(Q,ee);return Object.setPrototypeOf(Ee,d.prototype),Ee};function Z(oe,Q,ee){if(oe%1!==0||oe<0)throw new RangeError("offset is not uint");if(oe+Q>ee)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(Q,ee,fe){Q=Q>>>0,ee=ee>>>0,fe||Z(Q,ee,this.length);let Ee=this[Q],Te=1,De=0;for(;++De<ee&&(Te*=256);)Ee+=this[Q+De]*Te;return Ee},d.prototype.readUintBE=d.prototype.readUIntBE=function(Q,ee,fe){Q=Q>>>0,ee=ee>>>0,fe||Z(Q,ee,this.length);let Ee=this[Q+--ee],Te=1;for(;ee>0&&(Te*=256);)Ee+=this[Q+--ee]*Te;return Ee},d.prototype.readUint8=d.prototype.readUInt8=function(Q,ee){return Q=Q>>>0,ee||Z(Q,1,this.length),this[Q]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,2,this.length),this[Q]|this[Q+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,2,this.length),this[Q]<<8|this[Q+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,4,this.length),(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,4,this.length),this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])},d.prototype.readBigUInt64LE=lt(function(Q){Q=Q>>>0,Dt(Q,"offset");const ee=this[Q],fe=this[Q+7];(ee===void 0||fe===void 0)&&At(Q,this.length-8);const Ee=ee+this[++Q]*2**8+this[++Q]*2**16+this[++Q]*2**24,Te=this[++Q]+this[++Q]*2**8+this[++Q]*2**16+fe*2**24;return BigInt(Ee)+(BigInt(Te)<<BigInt(32))}),d.prototype.readBigUInt64BE=lt(function(Q){Q=Q>>>0,Dt(Q,"offset");const ee=this[Q],fe=this[Q+7];(ee===void 0||fe===void 0)&&At(Q,this.length-8);const Ee=ee*2**24+this[++Q]*2**16+this[++Q]*2**8+this[++Q],Te=this[++Q]*2**24+this[++Q]*2**16+this[++Q]*2**8+fe;return(BigInt(Ee)<<BigInt(32))+BigInt(Te)}),d.prototype.readIntLE=function(Q,ee,fe){Q=Q>>>0,ee=ee>>>0,fe||Z(Q,ee,this.length);let Ee=this[Q],Te=1,De=0;for(;++De<ee&&(Te*=256);)Ee+=this[Q+De]*Te;return Te*=128,Ee>=Te&&(Ee-=Math.pow(2,8*ee)),Ee},d.prototype.readIntBE=function(Q,ee,fe){Q=Q>>>0,ee=ee>>>0,fe||Z(Q,ee,this.length);let Ee=ee,Te=1,De=this[Q+--Ee];for(;Ee>0&&(Te*=256);)De+=this[Q+--Ee]*Te;return Te*=128,De>=Te&&(De-=Math.pow(2,8*ee)),De},d.prototype.readInt8=function(Q,ee){return Q=Q>>>0,ee||Z(Q,1,this.length),this[Q]&128?(255-this[Q]+1)*-1:this[Q]},d.prototype.readInt16LE=function(Q,ee){Q=Q>>>0,ee||Z(Q,2,this.length);const fe=this[Q]|this[Q+1]<<8;return fe&32768?fe|4294901760:fe},d.prototype.readInt16BE=function(Q,ee){Q=Q>>>0,ee||Z(Q,2,this.length);const fe=this[Q+1]|this[Q]<<8;return fe&32768?fe|4294901760:fe},d.prototype.readInt32LE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,4,this.length),this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24},d.prototype.readInt32BE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,4,this.length),this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]},d.prototype.readBigInt64LE=lt(function(Q){Q=Q>>>0,Dt(Q,"offset");const ee=this[Q],fe=this[Q+7];(ee===void 0||fe===void 0)&&At(Q,this.length-8);const Ee=this[Q+4]+this[Q+5]*2**8+this[Q+6]*2**16+(fe<<24);return(BigInt(Ee)<<BigInt(32))+BigInt(ee+this[++Q]*2**8+this[++Q]*2**16+this[++Q]*2**24)}),d.prototype.readBigInt64BE=lt(function(Q){Q=Q>>>0,Dt(Q,"offset");const ee=this[Q],fe=this[Q+7];(ee===void 0||fe===void 0)&&At(Q,this.length-8);const Ee=(ee<<24)+this[++Q]*2**16+this[++Q]*2**8+this[++Q];return(BigInt(Ee)<<BigInt(32))+BigInt(this[++Q]*2**24+this[++Q]*2**16+this[++Q]*2**8+fe)}),d.prototype.readFloatLE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,4,this.length),t.read(this,Q,!0,23,4)},d.prototype.readFloatBE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,4,this.length),t.read(this,Q,!1,23,4)},d.prototype.readDoubleLE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,8,this.length),t.read(this,Q,!0,52,8)},d.prototype.readDoubleBE=function(Q,ee){return Q=Q>>>0,ee||Z(Q,8,this.length),t.read(this,Q,!1,52,8)};function J(oe,Q,ee,fe,Ee,Te){if(!d.isBuffer(oe))throw new TypeError('"buffer" argument must be a Buffer instance');if(Q>Ee||Q<Te)throw new RangeError('"value" argument is out of bounds');if(ee+fe>oe.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(Q,ee,fe,Ee){if(Q=+Q,ee=ee>>>0,fe=fe>>>0,!Ee){const vt=Math.pow(2,8*fe)-1;J(this,Q,ee,fe,vt,0)}let Te=1,De=0;for(this[ee]=Q&255;++De<fe&&(Te*=256);)this[ee+De]=Q/Te&255;return ee+fe},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(Q,ee,fe,Ee){if(Q=+Q,ee=ee>>>0,fe=fe>>>0,!Ee){const vt=Math.pow(2,8*fe)-1;J(this,Q,ee,fe,vt,0)}let Te=fe-1,De=1;for(this[ee+Te]=Q&255;--Te>=0&&(De*=256);)this[ee+Te]=Q/De&255;return ee+fe},d.prototype.writeUint8=d.prototype.writeUInt8=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,1,255,0),this[ee]=Q&255,ee+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,2,65535,0),this[ee]=Q&255,this[ee+1]=Q>>>8,ee+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,2,65535,0),this[ee]=Q>>>8,this[ee+1]=Q&255,ee+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,4,4294967295,0),this[ee+3]=Q>>>24,this[ee+2]=Q>>>16,this[ee+1]=Q>>>8,this[ee]=Q&255,ee+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,4,4294967295,0),this[ee]=Q>>>24,this[ee+1]=Q>>>16,this[ee+2]=Q>>>8,this[ee+3]=Q&255,ee+4};function ae(oe,Q,ee,fe,Ee){ht(Q,fe,Ee,oe,ee,7);let Te=Number(Q&BigInt(4294967295));oe[ee++]=Te,Te=Te>>8,oe[ee++]=Te,Te=Te>>8,oe[ee++]=Te,Te=Te>>8,oe[ee++]=Te;let De=Number(Q>>BigInt(32)&BigInt(4294967295));return oe[ee++]=De,De=De>>8,oe[ee++]=De,De=De>>8,oe[ee++]=De,De=De>>8,oe[ee++]=De,ee}function we(oe,Q,ee,fe,Ee){ht(Q,fe,Ee,oe,ee,7);let Te=Number(Q&BigInt(4294967295));oe[ee+7]=Te,Te=Te>>8,oe[ee+6]=Te,Te=Te>>8,oe[ee+5]=Te,Te=Te>>8,oe[ee+4]=Te;let De=Number(Q>>BigInt(32)&BigInt(4294967295));return oe[ee+3]=De,De=De>>8,oe[ee+2]=De,De=De>>8,oe[ee+1]=De,De=De>>8,oe[ee]=De,ee+8}d.prototype.writeBigUInt64LE=lt(function(Q,ee=0){return ae(this,Q,ee,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=lt(function(Q,ee=0){return we(this,Q,ee,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(Q,ee,fe,Ee){if(Q=+Q,ee=ee>>>0,!Ee){const jt=Math.pow(2,8*fe-1);J(this,Q,ee,fe,jt-1,-jt)}let Te=0,De=1,vt=0;for(this[ee]=Q&255;++Te<fe&&(De*=256);)Q<0&&vt===0&&this[ee+Te-1]!==0&&(vt=1),this[ee+Te]=(Q/De>>0)-vt&255;return ee+fe},d.prototype.writeIntBE=function(Q,ee,fe,Ee){if(Q=+Q,ee=ee>>>0,!Ee){const jt=Math.pow(2,8*fe-1);J(this,Q,ee,fe,jt-1,-jt)}let Te=fe-1,De=1,vt=0;for(this[ee+Te]=Q&255;--Te>=0&&(De*=256);)Q<0&&vt===0&&this[ee+Te+1]!==0&&(vt=1),this[ee+Te]=(Q/De>>0)-vt&255;return ee+fe},d.prototype.writeInt8=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,1,127,-128),Q<0&&(Q=255+Q+1),this[ee]=Q&255,ee+1},d.prototype.writeInt16LE=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,2,32767,-32768),this[ee]=Q&255,this[ee+1]=Q>>>8,ee+2},d.prototype.writeInt16BE=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,2,32767,-32768),this[ee]=Q>>>8,this[ee+1]=Q&255,ee+2},d.prototype.writeInt32LE=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,4,2147483647,-2147483648),this[ee]=Q&255,this[ee+1]=Q>>>8,this[ee+2]=Q>>>16,this[ee+3]=Q>>>24,ee+4},d.prototype.writeInt32BE=function(Q,ee,fe){return Q=+Q,ee=ee>>>0,fe||J(this,Q,ee,4,2147483647,-2147483648),Q<0&&(Q=4294967295+Q+1),this[ee]=Q>>>24,this[ee+1]=Q>>>16,this[ee+2]=Q>>>8,this[ee+3]=Q&255,ee+4},d.prototype.writeBigInt64LE=lt(function(Q,ee=0){return ae(this,Q,ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=lt(function(Q,ee=0){return we(this,Q,ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function he(oe,Q,ee,fe,Ee,Te){if(ee+fe>oe.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("Index out of range")}function xe(oe,Q,ee,fe,Ee){return Q=+Q,ee=ee>>>0,Ee||he(oe,Q,ee,4),t.write(oe,Q,ee,fe,23,4),ee+4}d.prototype.writeFloatLE=function(Q,ee,fe){return xe(this,Q,ee,!0,fe)},d.prototype.writeFloatBE=function(Q,ee,fe){return xe(this,Q,ee,!1,fe)};function Se(oe,Q,ee,fe,Ee){return Q=+Q,ee=ee>>>0,Ee||he(oe,Q,ee,8),t.write(oe,Q,ee,fe,52,8),ee+8}d.prototype.writeDoubleLE=function(Q,ee,fe){return Se(this,Q,ee,!0,fe)},d.prototype.writeDoubleBE=function(Q,ee,fe){return Se(this,Q,ee,!1,fe)},d.prototype.copy=function(Q,ee,fe,Ee){if(!d.isBuffer(Q))throw new TypeError("argument should be a Buffer");if(fe||(fe=0),!Ee&&Ee!==0&&(Ee=this.length),ee>=Q.length&&(ee=Q.length),ee||(ee=0),Ee>0&&Ee<fe&&(Ee=fe),Ee===fe||Q.length===0||this.length===0)return 0;if(ee<0)throw new RangeError("targetStart out of bounds");if(fe<0||fe>=this.length)throw new RangeError("Index out of range");if(Ee<0)throw new RangeError("sourceEnd out of bounds");Ee>this.length&&(Ee=this.length),Q.length-ee<Ee-fe&&(Ee=Q.length-ee+fe);const Te=Ee-fe;return this===Q&&typeof s.prototype.copyWithin=="function"?this.copyWithin(ee,fe,Ee):s.prototype.set.call(Q,this.subarray(fe,Ee),ee),Te},d.prototype.fill=function(Q,ee,fe,Ee){if(typeof Q=="string"){if(typeof ee=="string"?(Ee=ee,ee=0,fe=this.length):typeof fe=="string"&&(Ee=fe,fe=this.length),Ee!==void 0&&typeof Ee!="string")throw new TypeError("encoding must be a string");if(typeof Ee=="string"&&!d.isEncoding(Ee))throw new TypeError("Unknown encoding: "+Ee);
vendor: 4,479 bytes, line 47
47if(Q.length===1){const De=Q.charCodeAt(0);(Ee==="utf8"&&De<128||Ee==="latin1")&&(Q=De)}}else typeof Q=="number"?Q=Q&255:typeof Q=="boolean"&&(Q=Number(Q));if(ee<0||this.length<ee||this.length<fe)throw new RangeError("Out of range index");if(fe<=ee)return this;ee=ee>>>0,fe=fe===void 0?this.length:fe>>>0,Q||(Q=0);let Te;if(typeof Q=="number")for(Te=ee;Te<fe;++Te)this[Te]=Q;else{const De=d.isBuffer(Q)?Q:d.from(Q,Ee),vt=De.length;if(vt===0)throw new TypeError('The value "'+Q+'" is invalid for argument "value"');for(Te=0;Te<fe-ee;++Te)this[Te+ee]=De[Te%vt]}return this};const Re={};function et(oe,Q,ee){Re[oe]=class extends ee{constructor(){super(),Object.defineProperty(this,"message",{value:Q.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${oe}]`,this.stack,delete this.name}get code(){return oe}set code(Ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ee,writable:!0})}toString(){return`${this.name} [${oe}]: ${this.message}`}}}et("ERR_BUFFER_OUT_OF_BOUNDS",function(oe){return oe?`${oe} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),et("ERR_INVALID_ARG_TYPE",function(oe,Q){return`The "${oe}" argument must be of type number. Received type ${typeof Q}`},TypeError),et("ERR_OUT_OF_RANGE",function(oe,Q,ee){let fe=`The value of "${oe}" is out of range.`,Ee=ee;return Number.isInteger(ee)&&Math.abs(ee)>2**32?Ee=Me(String(ee)):typeof ee=="bigint"&&(Ee=String(ee),(ee>BigInt(2)**BigInt(32)||ee<-(BigInt(2)**BigInt(32)))&&(Ee=Me(Ee)),Ee+="n"),fe+=` It must be ${Q}. Received ${Ee}`,fe},RangeError);function Me(oe){let Q="",ee=oe.length;const fe=oe[0]==="-"?1:0;for(;ee>=fe+4;ee-=3)Q=`_${oe.slice(ee-3,ee)}${Q}`;return`${oe.slice(0,ee)}${Q}`}function Fe(oe,Q,ee){Dt(Q,"offset"),(oe[Q]===void 0||oe[Q+ee]===void 0)&&At(Q,oe.length-(ee+1))}function ht(oe,Q,ee,fe,Ee,Te){if(oe>ee||oe<Q){const De=typeof Q=="bigint"?"n":"";let vt;throw Q===0||Q===BigInt(0)?vt=`>= 0${De} and < 2${De} ** ${(Te+1)*8}${De}`:vt=`>= -(2${De} ** ${(Te+1)*8-1}${De}) and < 2 ** ${(Te+1)*8-1}${De}`,new Re.ERR_OUT_OF_RANGE("value",vt,oe)}Fe(fe,Ee,Te)}function Dt(oe,Q){if(typeof oe!="number")throw new Re.ERR_INVALID_ARG_TYPE(Q,"number",oe)}function At(oe,Q,ee){throw Math.floor(oe)!==oe?(Dt(oe,ee),new Re.ERR_OUT_OF_RANGE("offset","an integer",oe)):Q<0?new Re.ERR_BUFFER_OUT_OF_BOUNDS:new Re.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Q}`,oe)}const Wt=/[^+/0-9A-Za-z-_]/g;function yn(oe){if(oe=oe.split("=")[0],oe=oe.trim().replace(Wt,""),oe.length<2)return"";for(;oe.length%4!==0;)oe=oe+"=";return oe}function Yt(oe,Q){Q=Q||1/0;let ee;const fe=oe.length;let Ee=null;const Te=[];for(let De=0;De<fe;++De){if(ee=oe.charCodeAt(De),ee>55295&&ee<57344){if(!Ee){if(ee>56319){(Q-=3)>-1&&Te.push(239,191,189);continue}else if(De+1===fe){(Q-=3)>-1&&Te.push(239,191,189);continue}Ee=ee;continue}if(ee<56320){(Q-=3)>-1&&Te.push(239,191,189),Ee=ee;continue}ee=(Ee-55296<<10|ee-56320)+65536}else Ee&&(Q-=3)>-1&&Te.push(239,191,189);if(Ee=null,ee<128){if((Q-=1)<0)break;Te.push(ee)}else if(ee<2048){if((Q-=2)<0)break;Te.push(ee>>6|192,ee&63|128)}else if(ee<65536){if((Q-=3)<0)break;Te.push(ee>>12|224,ee>>6&63|128,ee&63|128)}else if(ee<1114112){if((Q-=4)<0)break;Te.push(ee>>18|240,ee>>12&63|128,ee>>6&63|128,ee&63|128)}else throw new Error("Invalid code point")}return Te}function Jt(oe){const Q=[];for(let ee=0;ee<oe.length;++ee)Q.push(oe.charCodeAt(ee)&255);return Q}function bn(oe,Q){let ee,fe,Ee;const Te=[];for(let De=0;De<oe.length&&!((Q-=2)<0);++De)ee=oe.charCodeAt(De),fe=ee>>8,Ee=ee%256,Te.push(Ee),Te.push(fe);return Te}function Kt(oe){return e.toByteArray(yn(oe))}function En(oe,Q,ee,fe){let Ee;for(Ee=0;Ee<fe&&!(Ee+ee>=Q.length||Ee>=oe.length);++Ee)Q[Ee+ee]=oe[Ee];return Ee}function Xe(oe,Q){return oe instanceof Q||oe!=null&&oe.constructor!=null&&oe.constructor.name!=null&&oe.constructor.name===Q.name}function at(oe){return oe!==oe}const rt=function(){const oe="0123456789abcdef",Q=new Array(256);for(let ee=0;ee<16;++ee){const fe=ee*16;for(let Ee=0;Ee<16;++Ee)Q[fe+Ee]=oe[ee]+oe[Ee]}return Q}();function lt(oe){return typeof BigInt>"u"?yt:oe}function yt(){throw new Error("BigInt not supported")}})(jL);const pn=jL.Buffer,Ot=jL.Buffer,SX=X.createContext(null);function Yle({appKit:n,children:e}){return S.jsx(SX.Provider,{value:n,children:e})}function FL(){var e,t,r,i,s,o;const n=X.useContext(SX);if(!n)throw new Error("useAppKit must be used within an AppKitProvider and appKit must be initialized");
47return{open:(e=n.open)==null?void 0:e.bind(n),disconnect:(t=n.disconnect)==null?void 0:t.bind(n),signTransaction:(r=n.signTransaction)==null?void 0:r.bind(n),signAndSendTransaction:(i=n.signAndSendTransaction)==null?void 0:i.bind(n),address:((o=(s=n.getCaipAddress)==null?void 0:s.call(n))==null?void 0:o.split(":")[2])||null}}const Gle=Symbol(),WL=Symbol(),GA="a",_X="f",Iz="p",CX="c",TX="t",HL="h",lS="w",VL="o",qL="k";let Zle=(n,e)=>new Proxy(n,e);const TD=Object.getPrototypeOf,ID=new WeakMap,IX=n=>n&&(ID.has(n)?ID.get(n):TD(n)===Object.prototype||TD(n)===Array.prototype),L6=n=>typeof n=="object"&&n!==null,Qle=n=>Object.values(Object.getOwnPropertyDescriptors(n)).some(e=>!e.configurable&&!e.writable),Xle=n=>{if(Array.isArray(n))return Array.from(n);const e=Object.getOwnPropertyDescriptors(n);return Object.values(e).forEach(t=>{t.configurable=!0}),Object.create(TD(n),e)},Jle=(n,e)=>{const t={[_X]:e};let r=!1;const i=(a,c)=>{if(!r){let u=t[GA].get(n);if(u||(u={},t[GA].set(n,u)),a===lS)u[lS]=!0;else{let d=u[a];d||(d=new Set,u[a]=d),d.add(c)}}},s=()=>{r=!0,t[GA].delete(n)},o={get(a,c){return c===WL?n:(i(qL,c),NX(Reflect.get(a,c),t[GA],t[CX],t[TX]))},has(a,c){return c===Gle?(s(),!0):(i(HL,c),Reflect.has(a,c))},getOwnPropertyDescriptor(a,c){return i(VL,c),Reflect.getOwnPropertyDescriptor(a,c)},ownKeys(a){return i(lS),Reflect.ownKeys(a)}};return e&&(o.set=o.deleteProperty=()=>!1),[o,t]},KL=n=>n[WL]||n,NX=(n,e,t,r)=>{if(!IX(n))return n;let i=r&&r.get(n);if(!i){const c=KL(n);Qle(c)?i=[c,Xle(c)]:i=[c],r==null||r.set(n,i)}const[s,o]=i;let a=t&&t.get(s);return(!a||a[1][_X]!==!!o)&&(a=Jle(s,!!o),a[1][Iz]=Zle(o||s,a[0]),t&&t.set(s,a)),a[1][GA]=e,a[1][CX]=t,a[1][TX]=r,a[1][Iz]},eue=(n,e)=>{const t=Reflect.ownKeys(n),r=Reflect.ownKeys(e);return t.length!==r.length||t.some((i,s)=>i!==r[s])},RX=(n,e,t,r,i=Object.is)=>{if(i(n,e))return!1;if(!L6(n)||!L6(e))return!0;const s=t.get(KL(n));if(!s)return!0;if(r){if(r.get(n)===e)return!1;r.set(n,e)}let o=null;for(const a of s[HL]||[])if(o=Reflect.has(n,a)!==Reflect.has(e,a),o)return o;if(s[lS]===!0){if(o=eue(n,e),o)return o}else for(const a of s[VL]||[]){const c=!!Reflect.getOwnPropertyDescriptor(n,a),u=!!Reflect.getOwnPropertyDescriptor(e,a);if(o=c!==u,o)return o}for(const a of s[qL]||[])if(o=RX(n[a],e[a],t,r,i),o)return o;if(o===null)throw new Error("invalid used");return o},tue=n=>IX(n)&&n[WL]||null,Nz=(n,e=!0)=>{ID.set(n,e)},nue=(n,e,t)=>{const r=[],i=new WeakSet,s=(o,a)=>{var c,u,d;if(i.has(o))return;L6(o)&&i.add(o);const f=L6(o)&&e.get(KL(o));if(f){if((c=f[HL])===null||c===void 0||c.forEach(m=>{const w=`:has(${String(m)})`;r.push(a?[...a,w]:[w])}),f[lS]===!0){const m=":ownKeys";r.push(a?[...a,m]:[m])}else(u=f[VL])===null||u===void 0||u.forEach(m=>{const w=`:hasOwn(${String(m)})`;r.push(a?[...a,w]:[w])});(d=f[qL])===null||d===void 0||d.forEach(m=>{"value"in(Object.getOwnPropertyDescriptor(o,m)||{})&&s(o[m],a?[...a,m]:[m])})}else a&&r.push(a)};return s(n),r},$6={},YL=n=>typeof n=="object"&&n!==null,rue=n=>YL(n)&&!IC.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer)&&!(n instanceof Promise),MX=(n,e)=>{const t=ND.get(n);if((t==null?void 0:t[0])===e)return t[1];const r=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return Nz(r,!0),ND.set(n,[e,r]),Reflect.ownKeys(n).forEach(i=>{if(Object.getOwnPropertyDescriptor(r,i))return;const s=Reflect.get(n,i),{enumerable:o}=Reflect.getOwnPropertyDescriptor(n,i),a={value:s,enumerable:o,configurable:!0};if(IC.has(s))Nz(s,!1);else if(u0.has(s)){const[c,u]=u0.get(s);a.value=MX(c,u())}Object.defineProperty(r,i,a)}),Object.preventExtensions(r)},iue=(n,e,t,r)=>({deleteProperty(i,s){const o=Reflect.get(i,s);t(s);const a=Reflect.deleteProperty(i,s);return a&&r(["delete",[s],o]),a},set(i,s,o,a){const c=!n()&&Reflect.has(i,s),u=Reflect.get(i,s,a);if(c&&(Rz(u,o)||GS.has(o)&&Rz(u,GS.get(o))))return!0;t(s),YL(o)&&(o=tue(o)||o);const d=!u0.has(o)&&oue(o)?Mi(o):o;return e(s,d),Reflect.set(i,s,d,a),r(["set",[s],o,u]),!0}}),u0=new WeakMap,IC=new WeakSet,ND=new WeakMap,ZA=[1,1],GS=new WeakMap;let Rz=Object.is,sue=(n,e)=>new Proxy(n,e),oue=rue,aue=MX,cue=iue;function Mi(n={}){if(!YL(n))throw new Error("object required");const e=GS.get(n);if(e)return e;let t=ZA[0];const r=new Set,i=(E,T=++ZA[0])=>{t!==T&&(t=T,r.forEach(N=>N(E,T)))};let s=ZA[1];const o=(E=++ZA[1])=>
47(s!==E&&!r.size&&(s=E,c.forEach(([T])=>{const N=T[1](E);N>t&&(t=N)})),t),a=E=>(T,N)=>{const I=[...T];I[1]=[E,...I[1]],i(I,N)},c=new Map,u=(E,T)=>{const N=!IC.has(T)&&u0.get(T);if(N){if(($6?"production":void 0)!=="production"&&c.has(E))throw new Error("prop listener already exists");if(r.size){const I=N[2](a(E));c.set(E,[N,I])}else c.set(E,[N])}},d=E=>{var T;const N=c.get(E);N&&(c.delete(E),(T=N[1])==null||T.call(N))},f=E=>(r.add(E),r.size===1&&c.forEach(([N,I],H)=>{if(($6?"production":void 0)!=="production"&&I)throw new Error("remove already exists");const L=N[2](a(H));c.set(H,[N,L])}),()=>{r.delete(E),r.size===0&&c.forEach(([N,I],H)=>{I&&(I(),c.set(H,[N]))})});let m=!0;const w=cue(()=>m,u,d,i),y=sue(n,w);GS.set(n,y);const b=[n,o,f];return u0.set(y,b),Reflect.ownKeys(n).forEach(E=>{const T=Object.getOwnPropertyDescriptor(n,E);"value"in T&&T.writable&&(y[E]=n[E])}),m=!1,y}function Qs(n,e,t){const r=u0.get(n);($6?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let i;const s=[],o=r[2];let a=!1;const u=o(d=>{s.push(d),i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,u()}}function r1(n){const e=u0.get(n);($6?"production":void 0)!=="production"&&!e&&console.warn("Please use proxy object");const[t,r]=e;return aue(t,r())}function d0(n){return IC.add(n),n}function lue(){return{proxyStateMap:u0,refSet:IC,snapCache:ND,versionHolder:ZA,proxyCache:GS}}function Eo(n,e,t,r){let i=n[e];return Qs(n,()=>{const s=n[e];Object.is(i,s)||t(i=s)})}const{proxyStateMap:uue,snapCache:due}=lue(),qT=n=>uue.has(n);function hue(n){const e=[];let t=0;const r=new Map,i=new WeakMap,s=()=>{const u=due.get(a),d=u==null?void 0:u[1];if(d&&!i.has(d)){const f=new Map(r);i.set(d,f)}},o=u=>i.get(u)||r,a={data:e,index:t,epoch:0,get size(){return qT(this)||s(),o(this).size},get(u){const f=o(this).get(u);if(f===void 0){this.epoch;return}return this.data[f]},has(u){const d=o(this);return this.epoch,d.has(u)},set(u,d){if(!qT(this))throw new Error("Cannot perform mutations on a snapshot");const f=r.get(u);return f===void 0?(r.set(u,this.index),this.data[this.index++]=d):this.data[f]=d,this.epoch++,this},delete(u){if(!qT(this))throw new Error("Cannot perform mutations on a snapshot");const d=r.get(u);return d===void 0?!1:(delete this.data[d],r.delete(u),this.epoch++,!0)},clear(){if(!qT(this))throw new Error("Cannot perform mutations on a snapshot");this.data.length=0,this.index=0,this.epoch++,r.clear()},forEach(u){this.epoch,o(this).forEach((f,m)=>{u(this.data[f],m,this)})},*entries(){this.epoch;const u=o(this);for(const[d,f]of u)yield[d,this.data[f]]},*keys(){this.epoch;const u=o(this);for(const d of u.keys())yield d},*values(){this.epoch;const u=o(this);for(const d of u.values())yield this.data[d]},[Symbol.iterator](){return this.entries()},get[Symbol.toStringTag](){return"Map"},toJSON(){return new Map(this.entries())}},c=Mi(a);return Object.defineProperties(c,{size:{enumerable:!1},index:{enumerable:!1},epoch:{enumerable:!1},data:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(c),c}var s6={exports:{}},fue=s6.exports,Mz;function pue(){return Mz||(Mz=1,function(n,e){(function(t,r){n.exports=r()})(fue,function(){var t=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",u="day",d="week",f="month",m="quarter",w="year",y="date",b="Invalid Date",E=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|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,N={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(A){var _=["th","st","nd","rd"],R=A%100;return"["+A+(_[(R-20)%10]||_[R]||_[0])+"]"}},I=function(A,_,R){var P=String(A);return!P||P.length>=_?A:""+Array(_+1-P.length).join(R)+A},H={s:I,z:function(A){var _=-A.utcOffset(),R=Math.abs(_),P=Math.floor(R/60),q=R%60;return(_<=0?"+":"-")+I(P,2,"0")+":"+I(q,2,"0")}
vendor: 4,928 bytes, line 47
47,m:function A(_,R){if(_.date()<R.date())return-A(R,_);var P=12*(R.year()-_.year())+(R.month()-_.month()),q=_.clone().add(P,f),F=R-q<0,z=_.clone().add(P+(F?-1:1),f);return+(-(P+(R-q)/(F?q-z:z-q))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:f,y:w,w:d,d:u,D:y,h:c,m:a,s:o,ms:s,Q:m}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},L="en",U={};U[L]=N;var K="$isDayjsObject",Y=function(A){return A instanceof W||!(!A||!A[K])},k=function A(_,R,P){var q;if(!_)return L;if(typeof _=="string"){var F=_.toLowerCase();U[F]&&(q=F),R&&(U[F]=R,q=F);var z=_.split("-");if(!q&&z.length>1)return A(z[0])}else{var B=_.name;U[B]=_,q=B}return!P&&q&&(L=q),q||!P&&L},j=function(A,_){if(Y(A))return A.clone();var R=typeof _=="object"?_:{};return R.date=A,R.args=arguments,new W(R)},V=H;V.l=k,V.i=Y,V.w=function(A,_){return j(A,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var W=function(){function A(R){this.$L=k(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[K]=!0}var _=A.prototype;return _.parse=function(R){this.$d=function(P){var q=P.date,F=P.utc;if(q===null)return new Date(NaN);if(V.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var z=q.match(E);if(z){var B=z[2]-1||0,C=(z[7]||"0").substring(0,3);return F?new Date(Date.UTC(z[1],B,z[3]||1,z[4]||0,z[5]||0,z[6]||0,C)):new Date(z[1],B,z[3]||1,z[4]||0,z[5]||0,z[6]||0,C)}}return new Date(q)}(R),this.init()},_.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},_.$utils=function(){return V},_.isValid=function(){return this.$d.toString()!==b},_.isSame=function(R,P){var q=j(R);return this.startOf(P)<=q&&q<=this.endOf(P)},_.isAfter=function(R,P){return j(R)<this.startOf(P)},_.isBefore=function(R,P){return this.endOf(P)<j(R)},_.$g=function(R,P,q){return V.u(R)?this[P]:this.set(q,R)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(R,P){var q=this,F=!!V.u(P)||P,z=V.p(R),B=function(xe,Se){var Re=V.w(q.$u?Date.UTC(q.$y,Se,xe):new Date(q.$y,Se,xe),q);return F?Re:Re.endOf(u)},C=function(xe,Se){return V.w(q.toDate()[xe].apply(q.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(Se)),q)},M=this.$W,Z=this.$M,J=this.$D,ae="set"+(this.$u?"UTC":"");switch(z){case w:return F?B(1,0):B(31,11);case f:return F?B(1,Z):B(0,Z+1);case d:var we=this.$locale().weekStart||0,he=(M<we?M+7:M)-we;return B(F?J-he:J+(6-he),Z);case u:case y:return C(ae+"Hours",0);case c:return C(ae+"Minutes",1);case a:return C(ae+"Seconds",2);case o:return C(ae+"Milliseconds",3);default:return this.clone()}},_.endOf=function(R){return this.startOf(R,!1)},_.$set=function(R,P){var q,F=V.p(R),z="set"+(this.$u?"UTC":""),B=(q={},q[u]=z+"Date",q[y]=z+"Date",q[f]=z+"Month",q[w]=z+"FullYear",q[c]=z+"Hours",q[a]=z+"Minutes",q[o]=z+"Seconds",q[s]=z+"Milliseconds",q)[F],C=F===u?this.$D+(P-this.$W):P;if(F===f||F===w){var M=this.clone().set(y,1);M.$d[B](C),M.init(),this.$d=M.set(y,Math.min(this.$D,M.daysInMonth())).$d}else B&&this.$d[B](C);return this.init(),this},_.set=function(R,P){return this.clone().$set(R,P)},_.get=function(R){return this[V.p(R)]()},_.add=function(R,P){var q,F=this;R=Number(R);var z=V.p(P),B=function(Z){var J=j(F);return V.w(J.date(J.date()+Math.round(Z*R)),F)};if(z===f)return this.set(f,this.$M+R);if(z===w)return this.set(w,this.$y+R);if(z===u)return B(1);if(z===d)return B(7);var C=(q={},q[a]=r,q[c]=i,q[o]=t,q)[z]||1,M=this.$d.getTime()+R*C;return V.w(M,this)},_.subtract=function(R,P){return this.add(-1*R,P)},_.format=function(R){var P=this,q=this.$locale();if(!this.isValid())return q.invalidDate||b;var F=R||"YYYY-MM-DDTHH:mm:ssZ",z=V.z(this),B=this.$H,C=this.$m,M=this.$M,Z=q.weekdays,J=q.months,ae=q.meridiem,we=function(Se,Re,et,Me){return Se&&(Se[Re]||Se(P,F))||et[Re].slice(0,Me)},he=function(Se){return V.s(B%12||12,Se,"0")},xe=ae||function(Se,Re,et){var Me=Se<12?"AM":"PM";return et?Me.toLowerCase():Me};return F.replace(T,function(Se,Re){return Re||function(et){switch(et){case"YY":return String(P.$y).slice(-2);case"YYYY":return V.s(P.$y,4,"0");case"M":return M+1;case"MM":return V.s(M+1,2,"0");case"MMM":return we(q.monthsShort,M,J,3);case"MMMM":return we(J,M);case"D":return P.$D;case"DD":return V.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return we(q.weekdaysMin,P.$W,Z,2);case"ddd":return we(q.weekdaysShort,P.$W,Z,3);case"dddd":return Z[P.$W];case"H":return String(B);case"HH":return V.s(B,2,"0");case"h":return he(1);case"hh":return he(2);case"a":return xe(B,C,!0);case"A":return xe(B,C,!1);case"m":return String(C);case"mm":return V.s(C,2,"0");case"s":return String(P.$s);case"ss":return V.s(P.$s,2,"0");case"SSS":return V.s(P.$ms,3,"0");case"Z":return z}return null}(Se)||z.replace(":","")})}
47,_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(R,P,q){var F,z=this,B=V.p(P),C=j(R),M=(C.utcOffset()-this.utcOffset())*r,Z=this-C,J=function(){return V.m(z,C)};switch(B){case w:F=J()/12;break;case f:F=J();break;case m:F=J()/3;break;case d:F=(Z-M)/6048e5;break;case u:F=(Z-M)/864e5;break;case c:F=Z/i;break;case a:F=Z/r;break;case o:F=Z/t;break;default:F=Z}return q?F:V.a(F)},_.daysInMonth=function(){return this.endOf(f).$D},_.$locale=function(){return U[this.$L]},_.locale=function(R,P){if(!R)return this.$L;var q=this.clone(),F=k(R,P,!0);return F&&(q.$L=F),q},_.clone=function(){return V.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},A}(),$=W.prototype;return j.prototype=$,[["$ms",s],["$s",o],["$m",a],["$H",c],["$W",u],["$M",f],["$y",w],["$D",y]].forEach(function(A){$[A[1]]=function(_){return this.$g(_,A[0],A[1])}}),j.extend=function(A,_){return A.$i||(A(_,W,j),A.$i=!0),j},j.locale=k,j.isDayjs=Y,j.unix=function(A){return j(1e3*A)},j.en=U[L],j.Ls=U,j.p={},j})}(s6)),s6.exports}var gue=pue();const F2=xo(gue);var o6={exports:{}},mue=o6.exports,kz;function wue(){return kz||(kz=1,function(n,e){(function(t,r){n.exports=r()})(mue,function(){return{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(t){var r=["th","st","nd","rd"],i=t%100;return"["+t+(r[(i-20)%10]||r[i]||r[0])+"]"}}})}(o6)),o6.exports}var yue=wue();const bue=xo(yue);var a6={exports:{}},vue=a6.exports,Oz;function xue(){return Oz||(Oz=1,function(n,e){(function(t,r){n.exports=r()})(vue,function(){return function(t,r,i){t=t||{};var s=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(u,d,f,m){return s.fromToBase(u,d,f,m)}i.en.relativeTime=o,s.fromToBase=function(u,d,f,m,w){for(var y,b,E,T=f.$locale().relativeTime||o,N=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],I=N.length,H=0;H<I;H+=1){var L=N[H];L.d&&(y=m?i(u).diff(f,L.d,!0):f.diff(u,L.d,!0));var U=(t.rounding||Math.round)(Math.abs(y));if(E=y>0,U<=L.r||!L.r){U<=1&&H>0&&(L=N[H-1]);var K=T[L.l];w&&(U=w(""+U)),b=typeof K=="string"?K.replace("%d",U):K(U,d,L.l,E);break}}if(d)return b;var Y=E?T.future:T.past;return typeof Y=="function"?Y(b):Y.replace("%s",b)},s.to=function(u,d){return a(u,d,this,!0)},s.from=function(u,d){return a(u,d,this)};var c=function(u){return u.$u?i.utc():i()};s.toNow=function(u){return this.to(c(this),u)},s.fromNow=function(u){return this.from(c(this),u)}}})}(a6)),a6.exports}var Eue=xue();const Aue=xo(Eue);var c6={exports:{}},Sue=c6.exports,Pz;function _ue(){return Pz||(Pz=1,function(n,e){(function(t,r){n.exports=r()})(Sue,function(){return function(t,r,i){i.updateLocale=function(s,o){var a=i.Ls[s];if(a)return(o?Object.keys(o):[]).forEach(function(c){a[c]=o[c]}),a}}})}(c6)),c6.exports}var Cue=_ue();const Tue=xo(Cue);F2.extend(Aue);F2.extend(Tue);const Iue={...bue,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}},Nue=["January","February","March","April","May","June","July","August","September","October","November","December"];F2.locale("en-web3-modal",Iue);const RD={getMonthNameByIndex(n){return Nue[n]},getYear(n=new Date().toISOString()){return F2(n).year()},getRelativeDateFromNow(n){return F2(n).locale("en-web3-modal").fromNow(!0)},formatDate(n,e="DD MMM"){return F2(n).format(e)}};var Dz={};const Be={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CONNECTOR_ID:{WALLET_CONNECT:"walletConnect",INJECTED:"injected",WALLET_STANDARD:"announced",COINBASE:"coinbaseWallet",COINBASE_SDK:"coinbaseWalletSDK",SAFE:"safe",LEDGER:"ledger",OKX:"okx",EIP6963:"eip6963",AUTH:"ID_AUTH"},CONNECTOR_NAMES:{AUTH:"Auth"},AUTH_CONNECTOR_SUPPORTED_CHAINS:["eip155","solana"],LIMITS:{PENDING_TRANSACTIONS:99},CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot",BITCOIN:"bip122"}
47,CHAIN_NAME_MAP:{eip155:"EVM Networks",solana:"Solana",polkadot:"Polkadot",bip122:"Bitcoin",cosmos:"Cosmos",sui:"Sui",stacks:"Stacks"},ADAPTER_TYPES:{BITCOIN:"bitcoin",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"],HTTP_STATUS_CODES:{SERVER_ERROR:500,TOO_MANY_REQUESTS:429,SERVICE_UNAVAILABLE:503,FORBIDDEN:403},UNSUPPORTED_NETWORK_NAME:"Unknown Network",SECURE_SITE_SDK_ORIGIN:(typeof Ji<"u"&&typeof Dz<"u"?Dz.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",REMOTE_FEATURES_ALERTS:{MULTI_WALLET_NOT_ENABLED:{DEFAULT:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com."},CONNECTIONS_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnections hook."},CONNECTION_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnection hook."}}}},kX={caipNetworkIdToNumber(n){return n?Number(n.split(":")[1]):void 0},parseEvmChainId(n){return typeof n=="string"?this.caipNetworkIdToNumber(n):n},getNetworksByNamespace(n,e){return(n==null?void 0:n.filter(t=>t.chainNamespace===e))||[]},getFirstNetworkByNamespace(n,e){return this.getNetworksByNamespace(n,e)[0]},getNetworkNameByCaipNetworkId(n,e){var i;if(!e)return;const t=n.find(s=>s.caipNetworkId===e);if(t)return t.name;const[r]=e.split(":");return((i=Be.CHAIN_NAME_MAP)==null?void 0:i[r])||void 0}},OX=["eip155","solana","polkadot","bip122","cosmos","sui","stacks"];var Rue=20,Mue=1,i1=1e6,Bz=1e6,kue=-7,Oue=21,Pue=!1,NC="[big.js] ",$1=NC+"Invalid ",N8=$1+"decimal places",Due=$1+"rounding mode",PX=NC+"Division by zero",Ri={},Cf=void 0,Bue=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function DX(){function n(e){var t=this;if(!(t instanceof n))return e===Cf?DX():new n(e);if(e instanceof n)t.s=e.s,t.e=e.e,t.c=e.c.slice();else{if(typeof e!="string"){if(n.strict===!0&&typeof e!="bigint")throw TypeError($1+"value");e=e===0&&1/e<0?"-0":String(e)}Lue(t,e)}t.constructor=n}return n.prototype=Ri,n.DP=Rue,n.RM=Mue,n.NE=kue,n.PE=Oue,n.strict=Pue,n.roundDown=0,n.roundHalfUp=1,n.roundHalfEven=2,n.roundUp=3,n}function Lue(n,e){var t,r,i;if(!Bue.test(e))throw Error($1+"number");for(n.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(t=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(t<0&&(t=r),t+=+e.slice(r+1),e=e.substring(0,r)):t<0&&(t=e.length),i=e.length,r=0;r<i&&e.charAt(r)=="0";)++r;if(r==i)n.c=[n.e=0];else{for(;i>0&&e.charAt(--i)=="0";);for(n.e=t-r-1,n.c=[],t=0;r<=i;)n.c[t++]=+e.charAt(r++)}return n}function U1(n,e,t,r){var i=n.c;if(t===Cf&&(t=n.constructor.RM),t!==0&&t!==1&&t!==2&&t!==3)throw Error(Due);if(e<1)r=t===3&&(r||!!i[0])||e===0&&(t===1&&i[0]>=5||t===2&&(i[0]>5||i[0]===5&&(r||i[1]!==Cf))),i.length=1,r?(n.e=n.e-e+1,i[0]=1):i[0]=n.e=0;else if(e<i.length){if(r=t===1&&i[e]>=5||t===2&&(i[e]>5||i[e]===5&&(r||i[e+1]!==Cf||i[e-1]&1))||t===3&&(r||!!i[0]),i.length=e,r){for(;++i[--e]>9;)if(i[e]=0,e===0){++n.e,i.unshift(1);break}}for(e=i.length;!i[--e];)i.pop()}return n}function j1(n,e,t){var r=n.e,i=n.c.join(""),s=i.length;if(e)i=i.charAt(0)+(s>1?"."+i.slice(1):"")+(r<0?"e":"e+")+r;else if(r<0){for(;++r;)i="0"+i;i="0."+i}else if(r>0)if(++r>s)for(r-=s;r--;)i+="0";else r<s&&(i=i.slice(0,r)+"."+i.slice(r));else s>1&&(i=i.charAt(0)+"."+i.slice(1));return n.s<0&&t?"-"+i:i}Ri.abs=function(){var n=new this.constructor(this);return n.s=1,n};Ri.cmp=function(n){var e,t=this,r=t.c,i=(n=new t.constructor(n)).c,s=t.s,o=n.s,a=t.e,c=n.e;if(!r[0]||!i[0])return r[0]?s:i[0]?-o:0;if(s!=o)return s;if(e=s<0,a!=c)return a>c^e?1:-1;for(o=(a=r.length)<(c=i.length)?a:c,s=-1;++s<o;)if(r[s]!=i[s])return r[s]>i[s]^e?1:-1;return a==c?0:a>c^e?1:-1};Ri.div=function(n){var e=this,t=e.constructor,r=e.c,i=(n=new t(n)).c,s=e.s==n.s?1:-1,o=t.DP;if(o!==~~o||o<0||o>i1)throw Error(N8);if(!i[0])throw Error(PX);if(!r[0])return n.s=s,n.c=[n.e=0],n;var a,c,u,d,f,m=i.slice(),w=a=i.length,y=r.length,b=r.slice(0,a),E=b.length,T=n,N=T.c=[],I=0,H=o+(T.e=e.e-n.e)+1;for(T.s=s,s=H<0?0:H,m.unshift(0);E++<a;)b.push(0);do{for(u=0;
47u<10;u++){if(a!=(E=b.length))d=a>E?1:-1;else for(f=-1,d=0;++f<a;)if(i[f]!=b[f]){d=i[f]>b[f]?1:-1;break}if(d<0){for(c=E==a?i:m;E;){if(b[--E]<c[E]){for(f=E;f&&!b[--f];)b[f]=9;--b[f],b[E]+=10}b[E]-=c[E]}for(;!b[0];)b.shift()}else break}N[I++]=d?u:++u,b[0]&&d?b[E]=r[w]||0:b=[r[w]]}while((w++<y||b[0]!==Cf)&&s--);return!N[0]&&I!=1&&(N.shift(),T.e--,H--),I>H&&U1(T,H,t.RM,b[0]!==Cf),T};Ri.eq=function(n){return this.cmp(n)===0};Ri.gt=function(n){return this.cmp(n)>0};Ri.gte=function(n){return this.cmp(n)>-1};Ri.lt=function(n){return this.cmp(n)<0};Ri.lte=function(n){return this.cmp(n)<1};Ri.minus=Ri.sub=function(n){var e,t,r,i,s=this,o=s.constructor,a=s.s,c=(n=new o(n)).s;if(a!=c)return n.s=-c,s.plus(n);var u=s.c.slice(),d=s.e,f=n.c,m=n.e;if(!u[0]||!f[0])return f[0]?n.s=-c:u[0]?n=new o(s):n.s=1,n;if(a=d-m){for((i=a<0)?(a=-a,r=u):(m=d,r=f),r.reverse(),c=a;c--;)r.push(0);r.reverse()}else for(t=((i=u.length<f.length)?u:f).length,a=c=0;c<t;c++)if(u[c]!=f[c]){i=u[c]<f[c];break}if(i&&(r=u,u=f,f=r,n.s=-n.s),(c=(t=f.length)-(e=u.length))>0)for(;c--;)u[e++]=0;for(c=e;t>a;){if(u[--t]<f[t]){for(e=t;e&&!u[--e];)u[e]=9;--u[e],u[t]+=10}u[t]-=f[t]}for(;u[--c]===0;)u.pop();for(;u[0]===0;)u.shift(),--m;return u[0]||(n.s=1,u=[m=0]),n.c=u,n.e=m,n};Ri.mod=function(n){var e,t=this,r=t.constructor,i=t.s,s=(n=new r(n)).s;if(!n.c[0])throw Error(PX);return t.s=n.s=1,e=n.cmp(t)==1,t.s=i,n.s=s,e?new r(t):(i=r.DP,s=r.RM,r.DP=r.RM=0,t=t.div(n),r.DP=i,r.RM=s,this.minus(t.times(n)))};Ri.neg=function(){var n=new this.constructor(this);return n.s=-n.s,n};Ri.plus=Ri.add=function(n){var e,t,r,i=this,s=i.constructor;if(n=new s(n),i.s!=n.s)return n.s=-n.s,i.minus(n);var o=i.e,a=i.c,c=n.e,u=n.c;if(!a[0]||!u[0])return u[0]||(a[0]?n=new s(i):n.s=i.s),n;if(a=a.slice(),e=o-c){for(e>0?(c=o,r=u):(e=-e,r=a),r.reverse();e--;)r.push(0);r.reverse()}for(a.length-u.length<0&&(r=u,u=a,a=r),e=u.length,t=0;e;a[e]%=10)t=(a[--e]=a[e]+u[e]+t)/10|0;for(t&&(a.unshift(t),++c),e=a.length;a[--e]===0;)a.pop();return n.c=a,n.e=c,n};Ri.pow=function(n){var e=this,t=new e.constructor("1"),r=t,i=n<0;if(n!==~~n||n<-Bz||n>Bz)throw Error($1+"exponent");for(i&&(n=-n);n&1&&(r=r.times(e)),n>>=1,!!n;)e=e.times(e);return i?t.div(r):r};Ri.prec=function(n,e){if(n!==~~n||n<1||n>i1)throw Error($1+"precision");return U1(new this.constructor(this),n,e)};Ri.round=function(n,e){if(n===Cf)n=0;else if(n!==~~n||n<-i1||n>i1)throw Error(N8);return U1(new this.constructor(this),n+this.e+1,e)};Ri.sqrt=function(){var n,e,t,r=this,i=r.constructor,s=r.s,o=r.e,a=new i("0.5");if(!r.c[0])return new i(r);if(s<0)throw Error(NC+"No square root");s=Math.sqrt(+j1(r,!0,!0)),s===0||s===1/0?(e=r.c.join(""),e.length+o&1||(e+="0"),s=Math.sqrt(e),o=((o+1)/2|0)-(o<0||o&1),n=new i((s==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+o)):n=new i(s+""),o=n.e+(i.DP+=4);do t=n,n=a.times(t.plus(r.div(t)));while(t.c.slice(0,o).join("")!==n.c.slice(0,o).join(""));return U1(n,(i.DP-=4)+n.e+1,i.RM)};Ri.times=Ri.mul=function(n){var e,t=this,r=t.constructor,i=t.c,s=(n=new r(n)).c,o=i.length,a=s.length,c=t.e,u=n.e;if(n.s=t.s==n.s?1:-1,!i[0]||!s[0])return n.c=[n.e=0],n;for(n.e=c+u,o<a&&(e=i,i=s,s=e,u=o,o=a,a=u),e=new Array(u=o+a);u--;)e[u]=0;for(c=a;c--;){for(a=0,u=o+c;u>c;)a=e[u]+s[c]*i[u-c-1]+a,e[u--]=a%10,a=a/10|0;e[u]=a}for(a?++n.e:e.shift(),c=e.length;!e[--c];)e.pop();return n.c=e,n};Ri.toExponential=function(n,e){var t=this,r=t.c[0];if(n!==Cf){if(n!==~~n||n<0||n>i1)throw Error(N8);for(t=U1(new t.constructor(t),++n,e);t.c.length<n;)t.c.push(0)}return j1(t,!0,!!r)};Ri.toFixed=function(n,e){var t=this,r=t.c[0];if(n!==Cf){if(n!==~~n||n<0||n>i1)throw Error(N8);for(t=U1(new t.constructor(t),n+t.e+1,e),n=n+t.e+1;t.c.length<n;)t.c.push(0)}return j1(t,!1,!!r)};Ri[Symbol.for("nodejs.util.inspect.custom")]=Ri.toJSON=Ri.toString=function(){var n=this,e=n.constructor;return j1(n,n.e<=e.NE||n.e>=e.PE,!!n.c[0])};Ri.toNumber=function(){var n=+j1(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(n.toString()))throw Error(NC+"Imprecise conversion");return n};Ri.toPrecision=function(n,e){var t=this,r=t.constructor,i=t.c[0];if(n!==Cf){if(n!==~~n||n<1||n>i1)throw Error($1+"precision");for(t=U1(new r(t),n,e);t.c.length<n;)t.c.push(0)}return j1(t,n<=t.e||t.e<=r.NE||t.e>=r.PE,!!i)};Ri.valueOf=function(){var n=this,e=n.constructor;if(e.strict===!0)throw Error(NC+"valueOf disallowed");return j1(n,n.e<=e.NE||n.e>=e.PE,!0)};var aA=DX();const $ue={bigNumber(n){return n?new aA(n):new aA(0)},multiply(n,e){if(n===void 0||e===void 0)return new aA(0);const t=new aA(n),r=new aA(e);return t.times(r)},formatNumberToLocalString(n,e=2){return n===void 0?"0.00":typeof n=="number"?n.toLocaleStr
47ing("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(n).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})},parseLocalStringToNumber(n){return n===void 0?0:parseFloat(n.replace(/,/gu,""))}},Uue=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],jue=[{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],zue=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],Fue={getERC20Abi:n=>Be.USDT_CONTRACT_ADDRESSES.includes(n)?zue:Uue,getSwapAbi:()=>jue},Wue={URLS:{FAQ:"https://walletconnect.com/faq"}},Ha={validateCaipAddress(n){var e;if(((e=n.split(":"))==null?void 0:e.length)!==3)throw new Error("Invalid CAIP Address");return n},parseCaipAddress(n){const e=n.split(":");if(e.length!==3)throw new Error(`Invalid CAIP-10 address: ${n}`);const[t,r,i]=e;if(!t||!r||!i)throw new Error(`Invalid CAIP-10 address: ${n}`);return{chainNamespace:t,chainId:r,address:i}},parseCaipNetworkId(n){const e=n.split(":");if(e.length!==2)throw new Error(`Invalid CAIP-2 network id: ${n}`);const[t,r]=e;if(!t||!r)throw new Error(`Invalid CAIP-2 network id: ${n}`);return{chainNamespace:t,chainId:r}}},jn={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit-wallet/SOCIAL_USERNAME",RECENT_WALLETS:"@appkit/recent_wallets",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",ACTIVE_NAMESPACE:"@appkit/active_namespace",CONNECTED_NAMESPACES:"@appkit/connected_namespaces",CONNECTION_STATUS:"@appkit/connection_status",SIWX_AUTH_TOKEN:"@appkit/siwx-auth-token",SIWX_NONCE_TOKEN:"@appkit/siwx-nonce-token",TELEGRAM_SOCIAL_PROVIDER:"@appkit/social_provider",NATIVE_BALANCE_CACHE:"@appkit/native_balance_cache",PORTFOLIO_CACHE:"@appkit/portfolio_cache",ENS_CACHE:"@appkit/ens_cache",IDENTITY_CACHE:"@appkit/identity_cache",PREFERRED_ACCOUNT_TYPES:"@appkit/preferred_account_types",CONNECTIONS:"@appkit/connections",DISCONNECTED_CONNECTOR_IDS:"@appkit/disconnected_connector_ids",HISTORY_TRANSACTIONS_CACHE:"@appkit/history_transactions_cache",TOKEN_PRICE_CACHE:"@appkit/token_price_cache",RECENT_EMAILS:"@appkit/recent_emails"};function mk(n){if(!n)throw new Error("Namespace is required for CONNECTED_CONNECTOR_ID");return`@appkit/${n}:connected_connector_id`}const Pn={setItem(n,e){A2()&&e!==void 0&&localStorage.setItem(n,e)},getItem(n){if(A2())return localStorage.getItem(n)||void 0},removeItem(n){A2()&&localStorage.removeItem(n)},clear(){A2()&&localStorage.clear()}};function A2(){return typeof window<"u"&&typeof localStorage<"u"}function Xp(n,e){return e==="light"?{"--w3m-accent":(n==null?void 0:n["--w3m-accent"])||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":(n==null?void 0:n["--w3m-accent"])||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}var Lz={};const wk=(typeof Ji<"u"&&typeof Lz<"u"?Lz.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",BX=[{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],Hue="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",sr={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,FIVE_SEC_MS:5e3,THREE_SEC_MS:3e3,ONE_SEC_MS:1e3,SECURE_SITE:wk,SECURE_SITE_DASHBOARD:`${wk}/dashboard`,SECURE_SITE_FAVICON:`${wk}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],BALANCE_SUPPORTED_CHAINS:[Be.CHAIN.EVM,Be.CHAIN.SOLANA],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:
4756","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NAMES_SUPPORTED_CHAIN_NAMESPACES:[Be.CHAIN.EVM],ONRAMP_SUPPORTED_CHAIN_NAMESPACES:[Be.CHAIN.EVM,Be.CHAIN.SOLANA],ACTIVITY_ENABLED_CHAIN_NAMESPACES:[Be.CHAIN.EVM],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x",bip122:"0x",cosmos:"0x",sui:"0x",stacks:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,CONNECT_LABELS:{MOBILE:"Open and continue in the wallet app",WEB:"Open and continue in the wallet app"},SEND_SUPPORTED_NAMESPACES:[Be.CHAIN.EVM,Be.CHAIN.SOLANA],DEFAULT_REMOTE_FEATURES:{swaps:["1inch"],onramp:["meld"],email:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],activity:!0,reownBranding:!0,multiWallet:!1,emailCapture:!1},DEFAULT_REMOTE_FEATURES_DISABLED:{email:!1,socials:!1,swaps:!1,onramp:!1,activity:!1,reownBranding:!1,emailCapture:!1},DEFAULT_FEATURES:{receive:!0,send:!0,emailShowWallets:!0,connectorTypeOrder:["walletConnect","recent","injected","featured","custom","external","recommended"],analytics:!0,allWallets:!0,legalCheckbox:!1,smartSessions:!1,collapseWallets:!1,walletFeaturesOrder:["onramp","swaps","receive","send"],connectMethodsOrder:void 0,pay:!1},DEFAULT_SOCIALS:["google","x","farcaster","discord","apple","github","facebook"],DEFAULT_ACCOUNT_TYPES:{bip122:"payment",eip155:"smartAccount",polkadot:"eoa",solana:"eoa"},ADAPTER_TYPES:{UNIVERSAL:"universal",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",BITCOIN:"bitcoin"},SIWX_DEFAULTS:{signOutOnDisconnect:!0}},wt={cacheExpiry:{portfolio:3e4,nativeBalance:3e4,ens:3e5,identity:3e5,transactionsHistory:15e3,tokenPrice:15e3},isCacheExpired(n,e){return Date.now()-n>e},getActiveNetworkProps(){const n=wt.getActiveNamespace(),e=wt.getActiveCaipNetworkId(),t=e?e.split(":")[1]:void 0,r=t?isNaN(Number(t))?t:Number(t):void 0;return{namespace:n,caipNetworkId:e,chainId:r}},setWalletConnectDeepLink({name:n,href:e}){try{Pn.setItem(jn.DEEPLINK_CHOICE,JSON.stringify({href:e,name:n}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const n=Pn.getItem(jn.DEEPLINK_CHOICE);if(n)return JSON.parse(n)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{Pn.removeItem(jn.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setActiveNamespace(n){try{Pn.setItem(jn.ACTIVE_NAMESPACE,n)}catch{console.info("Unable to set active namespace")}},setActiveCaipNetworkId(n){try{Pn.setItem(jn.ACTIVE_CAIP_NETWORK_ID,n),wt.setActiveNamespace(n.split(":")[0])}catch{console.info("Unable to set active caip network id")}},getActiveCaipNetworkId(){try{return Pn.getItem(jn.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to get active caip network id");return}},deleteActiveCaipNetworkId(){try{Pn.removeItem(jn.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to delete active caip network id")}},deleteConnectedConnectorId(n){try{const e=mk(n);Pn.removeItem(e)}catch{console.info("Unable to delete connected connector id")}},setAppKitRecent(n){try{const e=wt.getRecentWallets();e.find(r=>r.id===n.id)||(e.unshift(n),e.length>2&&e.pop(),Pn.setItem(jn.RECENT_WALLETS,JSON.stringify(e)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{const n=Pn.getItem(jn.RECENT_WALLETS);return n?JSON.parse(n):[]}catch{console.info("Unable to get AppKit recent")}return[]},setConnectedConnectorId(n,e){try{const t=mk(n);Pn.setItem(t,e)}catch{console.info("Unable to set Connected Connector Id")}},getActiveNamespace(){try{return Pn.getItem(jn.ACTIVE_NAMESPACE)}catch{console.info("Unable to get active namespace")}},getConnectedConnectorId(n){if(n)try{const e=mk(n);return Pn.getItem(e)}catch{console.info("Unable to get connected connector id in namespace",n)}},setConnectedSocialProvider(n){try{Pn.setItem(jn.CONNECTED_SOCIAL,n)}catch{console.info("Unable to set connected social provider")}},getConnectedSocialProvider(){try{return Pn.getItem(jn.CONNECTED_SOCIAL)}catch{console.info("Unable to get connected social provider")}},deleteConnectedSocialProvider(){try{Pn.removeItem(jn.CONNECTED_SOCIAL)}catch{console.info("Unable to delete connected social provider")}},getConnectedSocialUsername(){try{return Pn.getItem(jn.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get connected social username")}},getStoredActiveCaipNetworkId(){var t;const n=Pn.getItem(jn.ACTIVE_CAIP_NETWORK_ID);return(t=n==null?void 0:n.split(":"))==null?void 0:t[1]},setConnectionStatus(n){try{Pn.setItem(jn.CONNECTION_STATUS,n)}catch{console.info("Unable to set connection status")}},getConnectionStatus(){try{return Pn.getItem(jn.CONNECTION_STATUS)}catch{return}},getConnectedNamespaces(){try{const n=Pn.getItem(jn.CONNECTED_NAMESPACES);return n!=null&&n.length?n.split(","):[]}catch{return[]}},setConnectedNamespaces(n){try{const e=Array.from(new Set(n));Pn.setItem(jn.CONNECTED_NAMESPACES,e.join(","))}catch{console.info("Unable to set namespaces in storage")}},addConnectedNamespace(n){try{const e=wt.getConnectedNamespaces();e.includes(n)||(e.push(n),wt.setConnectedNamespaces(e))}catch{console.info("Unable to add connected namespace")}},removeConnectedNamespace(n){try{const e=wt.getConnectedNamespaces(),t=e.indexOf(n);t>-1&&(e.splice(t,1),wt.setConnectedNamespaces(e))}catch{console.info("Unable to remove connected namespace")}},getTelegramSocialProvider(){try{return Pn.getItem(jn.TELEGRAM_SOCIAL_PROVIDER)}catch{return console.info("Unable to get telegram social provider"),null}},setTelegramSocialProvider(n){try{Pn.setItem(jn.TELEGRAM_SOCIAL_PROVIDER,n)}catch{console.info("Unable to set telegram social provider")}},removeTelegramSocialProvider(){try{Pn.removeItem(jn.TELEGRAM_SOCIAL_PROVIDER)}catch{console.info("Unable to remove telegram social provider")}},getBalanceCache(){let n={};try{const e=Pn.getItem(jn.PORTFOLIO_CACHE);n=e?JSON.parse(e):{}}catch{console.info("Unable to get balance cache")}return n},removeAddressFromBalanceCache(n){try{const e=wt.getBalanceCache();Pn.setItem(jn.PORTFOLIO_CACHE,JSON.stringify({...e,[n]:void 0}))}catch{console.info("Unable to remove address from balance cache",n)}},getBalanceCacheForCaipAddress(n){try{const t=wt.getBalanceCache()[n];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.portfolio))return t.balance;wt.removeAddressFromBalanceCache(n)}catch{console.info("Unable to get balance cache for address",n)}},updateBalanceCache(n){try{const e=wt.getBalanceCache();e[n.caipAddress]=n,Pn.setItem(jn.PORTFOLIO_CACHE,JSON.stringify(e))}catch{console.info("Unable to update balance cache",n)}},getNativeBalanceCache(){let n={};try{const e=Pn.getItem(jn.NATIVE_BALANCE_CACHE);n=e?JSON.parse(e):{}}catch{console.info("Unable to get balance cache")}return n},removeAddressFromNativeBalanceCache(n){try{const e=wt.getBalanceCache();Pn.setItem(jn.NATIVE_BALANCE_CACHE,JSON.stringify({...e,[n]:void 0}))}catch{console.info("Unable to remove address from balance cache",n)}},getNativeBalanceCacheForCaipAddress(n){try{const t=wt.getNativeBalanceCache()[n];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.nativeBalance))return t;console.info("Discarding cache for address",n),wt.removeAddressFromBalanceCache(n)}catch{console.info("Unable to get balance cache for address",n)}},updateNativeBalanceCache(n){try{const e=wt.getNativeBalanceCache();e[n.caipAddress]=n,Pn.setItem(jn.NATIVE_BALANCE_CACHE,JSON.stringify(e))}catch{console.info("Unable to update balance cache",n)}},getEnsCache(){let n={};try{const e=Pn.getItem(jn.ENS_CACHE);n=e?JSON.parse(e):{}}catch{console.info("Unable to get ens name cache")}return n}
vendor: 4,556 bytes, line 47
47,getEnsFromCacheForAddress(n){try{const t=wt.getEnsCache()[n];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.ens))return t.ens;wt.removeEnsFromCache(n)}catch{console.info("Unable to get ens name from cache",n)}},updateEnsCache(n){try{const e=wt.getEnsCache();e[n.address]=n,Pn.setItem(jn.ENS_CACHE,JSON.stringify(e))}catch{console.info("Unable to update ens name cache",n)}},removeEnsFromCache(n){try{const e=wt.getEnsCache();Pn.setItem(jn.ENS_CACHE,JSON.stringify({...e,[n]:void 0}))}catch{console.info("Unable to remove ens name from cache",n)}},getIdentityCache(){let n={};try{const e=Pn.getItem(jn.IDENTITY_CACHE);n=e?JSON.parse(e):{}}catch{console.info("Unable to get identity cache")}return n},getIdentityFromCacheForAddress(n){try{const t=wt.getIdentityCache()[n];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.identity))return t.identity;wt.removeIdentityFromCache(n)}catch{console.info("Unable to get identity from cache",n)}},updateIdentityCache(n){try{const e=wt.getIdentityCache();e[n.address]={identity:n.identity,timestamp:n.timestamp},Pn.setItem(jn.IDENTITY_CACHE,JSON.stringify(e))}catch{console.info("Unable to update identity cache",n)}},removeIdentityFromCache(n){try{const e=wt.getIdentityCache();Pn.setItem(jn.IDENTITY_CACHE,JSON.stringify({...e,[n]:void 0}))}catch{console.info("Unable to remove identity from cache",n)}},clearAddressCache(){try{Pn.removeItem(jn.PORTFOLIO_CACHE),Pn.removeItem(jn.NATIVE_BALANCE_CACHE),Pn.removeItem(jn.ENS_CACHE),Pn.removeItem(jn.IDENTITY_CACHE),Pn.removeItem(jn.HISTORY_TRANSACTIONS_CACHE)}catch{console.info("Unable to clear address cache")}},setPreferredAccountTypes(n){try{Pn.setItem(jn.PREFERRED_ACCOUNT_TYPES,JSON.stringify(n))}catch{console.info("Unable to set preferred account types",n)}},getPreferredAccountTypes(){try{const n=Pn.getItem(jn.PREFERRED_ACCOUNT_TYPES);return n?JSON.parse(n):{}}catch{console.info("Unable to get preferred account types")}return{}},setConnections(n,e){try{const t=wt.getConnections(),r=t[e]??[],i=new Map;for(const o of r)i.set(o.connectorId,{...o});for(const o of n){const a=i.get(o.connectorId),c=o.connectorId===Be.CONNECTOR_ID.AUTH;if(a&&!c){const u=new Set(a.accounts.map(f=>f.address.toLowerCase())),d=o.accounts.filter(f=>!u.has(f.address.toLowerCase()));a.accounts.push(...d)}else i.set(o.connectorId,{...o})}const s={...t,[e]:Array.from(i.values())};Pn.setItem(jn.CONNECTIONS,JSON.stringify(s))}catch(t){console.error("Unable to sync connections to storage",t)}},getConnections(){try{const n=Pn.getItem(jn.CONNECTIONS);return n?JSON.parse(n):{}}catch(n){return console.error("Unable to get connections from storage",n),{}}},deleteAddressFromConnection({connectorId:n,address:e,namespace:t}){try{const r=wt.getConnections(),i=r[t]??[],s=new Map(i.map(a=>[a.connectorId,a])),o=s.get(n);o&&(o.accounts.filter(c=>c.address.toLowerCase()!==e.toLowerCase()).length===0?s.delete(n):s.set(n,{...o,accounts:o.accounts.filter(c=>c.address.toLowerCase()!==e.toLowerCase())})),Pn.setItem(jn.CONNECTIONS,JSON.stringify({...r,[t]:Array.from(s.values())}))}catch{console.error(`Unable to remove address "${e}" from connector "${n}" in namespace "${t}"`)}},getDisconnectedConnectorIds(){try{const n=Pn.getItem(jn.DISCONNECTED_CONNECTOR_IDS);return n?JSON.parse(n):{}}catch{console.info("Unable to get disconnected connector ids")}return{}},addDisconnectedConnectorId(n,e){try{const t=wt.getDisconnectedConnectorIds(),r=t[e]??[];r.push(n),Pn.setItem(jn.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...t,[e]:Array.from(new Set(r))}))}catch{console.error(`Unable to set disconnected connector id "${n}" for namespace "${e}"`)}},removeDisconnectedConnectorId(n,e){try{const t=wt.getDisconnectedConnectorIds();let r=t[e]??[];r=r.filter(i=>i.toLowerCase()!==n.toLowerCase()),Pn.setItem(jn.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...t,[e]:Array.from(new Set(r))}))}catch{console.error(`Unable to remove disconnected connector id "${n}" for namespace "${e}"`)}},isConnectorDisconnected(n,e){try{return(wt.getDisconnectedConnectorIds()[e]??[]).some(i=>i.toLowerCase()===n.toLowerCase())}catch{console.info(`Unable to get disconnected connector id "${n}" for namespace "${e}"`)}return!1},getTransactionsCache(){try{const n=Pn.getItem(jn.HISTORY_TRANSACTIONS_CACHE);return n?JSON.parse(n):{}}catch{console.info("Unable to get transactions cache")}return{}},getTransactionsCacheForAddress({address:n,chainId:e=""}){var t;try{const i=(t=wt.getTransactionsCache()[n])==null?void 0:t[e];if(i&&!this.isCacheExpired(i.timestamp,this.cacheExpiry.transactionsHistory)
47)return i.transactions;wt.removeTransactionsCache({address:n,chainId:e})}catch{console.info("Unable to get transactions cache")}},updateTransactionsCache({address:n,chainId:e="",timestamp:t,transactions:r}){try{const i=wt.getTransactionsCache();i[n]={...i[n],[e]:{timestamp:t,transactions:r}},Pn.setItem(jn.HISTORY_TRANSACTIONS_CACHE,JSON.stringify(i))}catch{console.info("Unable to update transactions cache",{address:n,chainId:e,timestamp:t,transactions:r})}},removeTransactionsCache({address:n,chainId:e}){try{const t=wt.getTransactionsCache(),r=(t==null?void 0:t[n])||{},{[e]:i,...s}=r;Pn.setItem(jn.HISTORY_TRANSACTIONS_CACHE,JSON.stringify({...t,[n]:s}))}catch{console.info("Unable to remove transactions cache",{address:n,chainId:e})}},getTokenPriceCache(){try{const n=Pn.getItem(jn.TOKEN_PRICE_CACHE);return n?JSON.parse(n):{}}catch{console.info("Unable to get token price cache")}return{}},getTokenPriceCacheForAddresses(n){try{const t=wt.getTokenPriceCache()[n.join(",")];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.tokenPrice))return t.tokenPrice;wt.removeTokenPriceCache(n)}catch{console.info("Unable to get token price cache for addresses",n)}},updateTokenPriceCache(n){try{const e=wt.getTokenPriceCache();e[n.addresses.join(",")]={timestamp:n.timestamp,tokenPrice:n.tokenPrice},Pn.setItem(jn.TOKEN_PRICE_CACHE,JSON.stringify(e))}catch{console.info("Unable to update token price cache",n)}},removeTokenPriceCache(n){try{const e=wt.getTokenPriceCache();Pn.setItem(jn.TOKEN_PRICE_CACHE,JSON.stringify({...e,[n.join(",")]:void 0}))}catch{console.info("Unable to remove token price cache",n)}}},tt={isMobile(){var n;return this.isClient()?!!(window!=null&&window.matchMedia&&typeof window.matchMedia=="function"&&((n=window.matchMedia("(pointer:coarse)"))!=null&&n.matches)||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(n,e=""){return n==null?void 0:n.caipNetworkId.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){if(!this.isMobile())return!1;const n=window==null?void 0:window.navigator.userAgent.toLowerCase();return tt.isMobile()&&n.includes("android")},isIos(){if(!this.isMobile())return!1;const n=window==null?void 0:window.navigator.userAgent.toLowerCase();return n.includes("iphone")||n.includes("ipad")},isSafari(){return this.isClient()?(window==null?void 0:window.navigator.userAgent.toLowerCase()).includes("safari"):!1},isClient(){return typeof window<"u"},isPairingExpired(n){return n?n-Date.now()<=sr.TEN_SEC_MS:!0},isAllowedRetry(n,e=sr.ONE_SEC_MS){return Date.now()-n>=e},copyToClopboard(n){navigator.clipboard.writeText(n)},isIframe(){try{return(window==null?void 0:window.self)!==(window==null?void 0:window.top)}catch{return!1}},isSafeApp(){var n,e;if(tt.isClient()&&window.self!==window.top)try{const t=(e=(n=window==null?void 0:window.location)==null?void 0:n.ancestorOrigins)==null?void 0:e[0],r="https://app.safe.global";if(t){const i=new URL(t),s=new URL(r);return i.hostname===s.hostname}}catch{return!1}return!1},getPairingExpiry(){return Date.now()+sr.FOUR_MINUTES_MS},getNetworkId(n){return n==null?void 0:n.split(":")[1]},getPlainAddress(n){return n==null?void 0:n.split(":")[2]},async wait(n){return new Promise(e=>{setTimeout(e,n)})},debounce(n,e=500){let t;return(...r)=>{function i(){n(...r)}t&&clearTimeout(t),t=setTimeout(i,e)}},isHttpUrl(n){return n.startsWith("http://")||n.startsWith("https://")},formatNativeUrl(n,e,t=null){if(tt.isHttpUrl(n))return this.formatUniversalUrl(n,e);let r=n,i=t;r.includes("://")||(r=n.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),i&&!(i!=null&&i.endsWith("/"))&&(i=`${i}/`),this.isTelegram()&&this.isAndroid()&&(e=encodeURIComponent(e));const s=encodeURIComponent(e);return{redirect:`${r}wc?uri=${s}`,redirectUniversalLink:i?`${i}wc?uri=${s}`:void 0,href:r}},formatUniversalUrl(n,e){if(!tt.isHttpUrl(n))return this.formatNativeUrl(n,e);let t=n;t.endsWith("/")||(t=`${t}/`);const r=encodeURIComponent(e);return{redirect:`${t}wc?uri=${r}`,href:t}},getOpenTargetForPlatform(n){return n==="popupWindow"?n:this.isTelegram()?wt.getTelegramSocialProvider()?"_top":"_blank":n},openHref(n,e,t){window==null||window.open(n,this.getOpenTargetForPlatform(e),t||"noreferrer noopener")},returnOpenHref(n,e,t){return window==null?void 0:window.open(n,this.getOpenTargetForPlatform(e),t||"noreferrer noopener")},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},isPWA(){var t,r;if(typeof window>"u")return!1;const n=window!=null&&window.matchMedia&&typeof window.matchMedia=="function"?(t=window.matchMedia("(display-mode: standalone)"))==null?void 0:t.matches:!1,e=(r=window==null?void 0:window.navigator)==null?void 0:r.standalone;return!!(n||e)},async preloadImage(n){const e=new Promise((t,r)=>{const i=new Image;i.onload=t,i.onerror=r,i.crossOrigin="anonymous",i.src=n});return Promise.race([e,tt.wait(2e3)])},formatBalance(n,e){let t="0.000";if(typeof n=="string"){const r=Number(n);if(r){const i=Math.floor(r*1e3)/1e3;i&&(t=i.toString())}}return`${t}${e?` ${e}`:""}`},formatBalance2(n,e){var r;let t;if(n==="0")t="0";else if(typeof n=="string"){const i=Number(n);i&&(t=(r=i.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:r[0])}
47return{value:t??"0",rest:t==="0"?"000":"",symbol:e}},getApiUrl(){return Be.W3M_API_URL},getBlockchainApiUrl(){return Be.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return Be.PULSE_API_URL},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,n=>{const e=Math.random()*16|0;return(n==="x"?e:e&3|8).toString(16)})},parseError(n){var e,t;return typeof n=="string"?n:typeof((t=(e=n==null?void 0:n.issues)==null?void 0:e[0])==null?void 0:t.message)=="string"?n.issues[0].message:n instanceof Error?n.message:"Unknown error"},sortRequestedNetworks(n,e=[]){const t={};return e&&n&&(n.forEach((r,i)=>{t[r]=i}),e.sort((r,i)=>{const s=t[r.id],o=t[i.id];return s!==void 0&&o!==void 0?s-o:s!==void 0?-1:o!==void 0?1:0})),e},calculateBalance(n){let e=0;for(const t of n)e+=t.value??0;return e},formatTokenBalance(n){const e=n.toFixed(2),[t,r]=e.split(".");return{dollars:t,pennies:r}},isAddress(n,e="eip155"){switch(e){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(n)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(n)||/^(?:0x)?[0-9A-F]{40}$/iu.test(n))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(n);default:return!1}},uniqueBy(n,e){const t=new Set;return n.filter(r=>{const i=r[e];return t.has(i)?!1:(t.add(i),!0)})},generateSdkVersion(n,e,t){const i=n.length===0?sr.ADAPTER_TYPES.UNIVERSAL:n.map(s=>s.adapterType).join(",");return`${e}-${i}-${t}`},createAccount(n,e,t,r,i){return{namespace:n,address:e,type:t,publicKey:r,path:i}},isCaipAddress(n){if(typeof n!="string")return!1;const e=n.split(":"),t=e[0];return e.filter(Boolean).length===3&&t in Be.CHAIN_NAME_MAP},getAccount(n){return n?typeof n=="string"?{address:n,chainId:void 0}:{address:n.address,chainId:n.chainId}:{address:void 0,chainId:void 0}},isMac(){const n=window==null?void 0:window.navigator.userAgent.toLowerCase();return n.includes("macintosh")&&!n.includes("safari")},formatTelegramSocialLoginUrl(n){const e=`--${encodeURIComponent(window==null?void 0:window.location.href)}`,t="state=";if(new URL(n).host==="auth.magic.link"){const i="provider_authorization_url=",s=n.substring(n.indexOf(i)+i.length),o=this.injectIntoUrl(decodeURIComponent(s),t,e);return n.replace(s,encodeURIComponent(o))}return this.injectIntoUrl(n,t,e)},injectIntoUrl(n,e,t){const r=n.indexOf(e);if(r===-1)throw new Error(`${e} parameter not found in the URL: ${n}`);const i=n.indexOf("&",r),s=e.length,o=i!==-1?i:n.length,a=n.substring(0,r+s),c=n.substring(r+s,o),u=n.substring(i),d=c+t;return a+d+u}};async function cA(...n){const e=await fetch(...n);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class RC{constructor({baseUrl:e,clientId:t}){this.baseUrl=e,this.clientId=t}async get({headers:e,signal:t,cache:r,...i}){const s=this.createUrl(i);return(await cA(s,{method:"GET",headers:e,signal:t,cache:r})).json()}async getBlob({headers:e,signal:t,...r}){const i=this.createUrl(r);return(await cA(i,{method:"GET",headers:e,signal:t})).blob()}async post({body:e,headers:t,signal:r,...i}){const s=this.createUrl(i);return(await cA(s,{method:"POST",headers:t,body:e?JSON.stringify(e):void 0,signal:r})).json()}async put({body:e,headers:t,signal:r,...i}){const s=this.createUrl(i);return(await cA(s,{method:"PUT",headers:t,body:e?JSON.stringify(e):void 0,signal:r})).json()}async delete({body:e,headers:t,signal:r,...i}){const s=this.createUrl(i);return(await cA(s,{method:"DELETE",headers:t,body:e?JSON.stringify(e):void 0,signal:r})).json()}createUrl({path:e,params:t}){const r=new URL(e,this.baseUrl);return t&&Object.entries(t).forEach(([i,s])=>{s&&r.searchParams.append(i,s)}),this.clientId&&r.searchParams.append("clientId",this.clientId),r}}const Vue={getFeatureValue(n,e){const t=e==null?void 0:e[n];return t===void 0?sr.DEFAULT_FEATURES[n]:t},filterSocialsByPlatform(n){if(!n||!n.length)return n;if(tt.isTelegram()){if(tt.isIos())return n.filter(e=>e!=="google");if(tt.isMac())return n.filter(e=>e!=="x");if(tt.isAndroid())return n.filter(e=>!["facebook","x"].includes(e))}return n}},In=Mi({features:sr.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined",defaultAccountTypes:sr.DEFAULT_ACCOUNT_TYPES,enableNetworkSwitch:!0,experimental_preferUniversalLinks:!1,remoteFeatures:{}}),Ue={state:In,subscribeKey(n,e){return Eo(In,n,e)},setOptions(n){Object.assign(In,n)},setRemoteFeatures(n){var t,r;if(!n)return;const e={...In.remoteFeatures,...n};In.remoteFeatures=e,(t=In.remoteFeatures)!=null&&t.socials&&(In.remoteFeatures.socials=Vue.filterSocialsByPlatform(In.remoteFeatures.socials)),(r=In.features)!=null&&r.pay&&(In.remoteFeatures.email=!1,In.remoteFeatures.socials=!1)},setFeatures(n){var t;if(!n)return;In.features||(In.features=sr.DEFAULT_FEATURES);const e={...In.features,...n};In.features=e,(t=In.features)!=null&&t.pay&&In.remoteFeatures&&(In.remoteFeatures.email=!1,In.remoteFeatures.socials=!1)},setProjectId(n){In.projectId=n},setCustomRpcUrls(n){In.customRpcUrls=n},setAllWallets(n){In.allWallets=n},setIncludeWalletIds(n){In.includeWalletIds=n},setExcludeWalletIds(n){In.excludeWalletIds=n},setFeaturedWalletIds(n){In.featuredWalletIds=n},setTokens(n){In.tokens=n},setTermsConditionsUrl(n){In.termsConditionsUrl=n},setPrivacyPolicyUrl(n){In.privacyPolicyUrl=n},setCustomWallets(n){In.customWallets=n},setIsSiweEnabled(n){In.isSiweEnabled=n},setIsUniversalProvider(n){In.isUniversalProvider=n},setSdkVersion(n){In.sdkVersion=n},setMetadata(n){In.metadata=n},setDisableAppend(n){In.disableAppend=n},setEIP6963Enabled(n){In.enableEIP6963=n},setDebug(n){In.debug=n},setEnableWalletConnect(n){In.enableWalletConnect=n},setEnableWalletGuide(n){In.enableWalletGuide=n},setEnableAuthLogger(n){In.enableAuthLogger=n},setEnableWallets(n){In.enableWallets=n},setPreferUniversalLinks(n){In.experimental_preferUniversalLinks=n}
47,setSIWX(n){if(n)for(const[e,t]of Object.entries(sr.SIWX_DEFAULTS))n[e]??(n[e]=t);In.siwx=n},setConnectMethodsOrder(n){In.features={...In.features,connectMethodsOrder:n}},setWalletFeaturesOrder(n){In.features={...In.features,walletFeaturesOrder:n}},setSocialsOrder(n){In.remoteFeatures={...In.remoteFeatures,socials:n}},setCollapseWallets(n){In.features={...In.features,collapseWallets:n}},setEnableEmbedded(n){In.enableEmbedded=n},setAllowUnsupportedChain(n){In.allowUnsupportedChain=n},setManualWCControl(n){In.manualWCControl=n},setEnableNetworkSwitch(n){In.enableNetworkSwitch=n},setEnableReconnect(n){In.enableReconnect=n},setDefaultAccountTypes(n={}){Object.entries(n).forEach(([e,t])=>{t&&(In.defaultAccountTypes[e]=t)})},setUniversalProviderConfigOverride(n){In.universalProviderConfigOverride=n},getUniversalProviderConfigOverride(){return In.universalProviderConfigOverride},getSnapshot(){return r1(In)}},que=Object.freeze({enabled:!0,events:[]}),Kue=new RC({baseUrl:tt.getAnalyticsUrl(),clientId:null}),Yue=5,Gue=60*1e3,xm=Mi({...que}),Zue={state:xm,subscribeKey(n,e){return Eo(xm,n,e)},async sendError(n,e){if(!xm.enabled)return;const t=Date.now();if(xm.events.filter(s=>{const o=new Date(s.properties.timestamp||"").getTime();return t-o<Gue}).length>=Yue)return;const i={type:"error",event:e,properties:{errorType:n.name,errorMessage:n.message,stackTrace:n.stack,timestamp:new Date().toISOString()}};xm.events.push(i);try{if(typeof window>"u")return;const{projectId:s,sdkType:o,sdkVersion:a}=Ue.state;await Kue.post({path:"/e",params:{projectId:s,st:o,sv:a||"html-wagmi-4.2.2"},body:{eventId:tt.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:new Date().toISOString(),props:{type:"error",event:e,errorType:n.name,errorMessage:n.message,stackTrace:n.stack}}})}catch{}},enable(){xm.enabled=!0},disable(){xm.enabled=!1},clearEvents(){xm.events=[]}};class sx extends Error{constructor(e,t,r){super(e),this.name="AppKitError",this.category=t,this.originalError=r,Object.setPrototypeOf(this,sx.prototype);let i=!1;if(r instanceof Error&&typeof r.stack=="string"&&r.stack){const s=r.stack,o=s.indexOf(` 48`);if(o>-1){const a=s.substring(o+1);this.stack=`${this.name}: ${this.message} 49${a}`,i=!0}}i||(Error.captureStackTrace?Error.captureStackTrace(this,sx):this.stack||(this.stack=`${this.name}: ${this.message}`))}}function $z(n,e){const t=n instanceof sx?n:new sx(n instanceof Error?n.message:String(n),e,n);throw Zue.sendError(t,t.category),t}function wl(n,e="INTERNAL_SDK_ERROR"){const t={};return Object.keys(n).forEach(r=>{const i=n[r];if(typeof i=="function"){let s=i;i.constructor.name==="AsyncFunction"?s=async(...o)=>{try{return await i(...o)}catch(a){return $z(a,e)}}:s=(...o)=>{try{return i(...o)}catch(a){return $z(a,e)}},t[r]=s}else t[r]=i}),t}var ox={};const Que="https://secure.walletconnect.org/sdk",Xue=(typeof Ji<"u"&&typeof ox<"u"?ox.NEXT_PUBLIC_SECURE_SITE_SDK_URL:void 0)||Que,Jue=(typeof Ji<"u"&&typeof ox<"u"?ox.NEXT_PUBLIC_DEFAULT_LOG_LEVEL:void 0)||"error",ede=(typeof Ji<"u"&&typeof ox<"u"?ox.NEXT_PUBLIC_SECURE_SITE_SDK_VERSION:void 0)||"4",fn={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",APP_RELOAD:"@w3m-app/RELOAD",APP_RPC_ABORT:"@w3m-app/RPC_ABORT",FRAME_SWITCH_NETWORK_E
49RROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",FRAME_READY:"@w3m-frame/READY",FRAME_RELOAD_SUCCESS:"@w3m-frame/RELOAD_SUCCESS",FRAME_RELOAD_ERROR:"@w3m-frame/RELOAD_ERROR",FRAME_RPC_ABORT_SUCCESS:"@w3m-frame/RPC_ABORT_SUCCESS",FRAME_RPC_ABORT_ERROR:"@w3m-frame/RPC_ABORT_ERROR",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},fi={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints","wallet_getAssets"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","wallet_revokePermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RP
49C_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}},wf={PHANTOM:{id:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",url:"https://phantom.app"},SOLFLARE:{id:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",url:"https://solflare.com"},COINBASE:{id:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",url:"https://go.cb-w.com"}},tde={handleMobileDeeplinkRedirect(n,e){const t=window.location.href,r=encodeURIComponent(t);if(n===wf.PHANTOM.id&&!("phantom"in window)){const i=t.startsWith("https")?"https":"http",s=t.split("/")[2],o=encodeURIComponent(`${i}://${s}`);window.location.href=`${wf.PHANTOM.url}/ul/browse/${r}?ref=${o}`}n===wf.SOLFLARE.id&&!("solflare"in window)&&(window.location.href=`${wf.SOLFLARE.url}/ul/v1/browse/${r}?ref=${r}`),e===Be.CHAIN.SOLANA&&n===wf.COINBASE.id&&!("coinbaseSolana"in window)&&(window.location.href=`${wf.COINBASE.url}/dapp?cb_url=${r}`)}},Ul=Mi({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),nde={state:Ul,subscribeNetworkImages(n){return Qs(Ul.networkImages,()=>n(Ul.networkImages))},subscribeKey(n,e){return Eo(Ul,n,e)},subscribe(n){return Qs(Ul,()=>n(Ul))},setWalletImage(n,e){Ul.walletImages[n]=e},setNetworkImage(n,e){Ul.networkImages[n]=e},setChainImage(n,e){Ul.chainImages[n]=e},setConnectorImage(n,e){Ul.connectorImages={...Ul.connectorImages,[n]:e}},setTokenImage(n,e){Ul.tokenImages[n]=e},setCurrencyImage(n,e){Ul.currencyImages[n]=e}},bo=wl(nde),rde={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:"",bip122:"0b4838db-0161-4ffe-022d-532bf03dba00",cosmos:"",sui:"",stacks:""},yk=Mi({networkImagePromises:{}}),Hr={async fetchWalletImage(n){if(n)return await Ft._fetchWalletImage(n),this.getWalletImageById(n)},async fetchNetworkImage(n){if(!n)return;const e=this.getNetworkImageById(n);return e||(yk.networkImagePromises[n]||(yk.networkImagePromises[n]=Ft._fetchNetworkImage(n)),await yk.networkImagePromises[n],this.getNetworkImageById(n))},getWalletImageById(n){if(n)return bo.state.walletImages[n]},getWalletImage(n){if(n!=null&&n.image_url)return n==null?void 0:n.image_url;if(n!=null&&n.image_id)return bo.state.walletImages[n.image_id]},getNetworkImage(n){var e,t,r;if((e=n==null?void 0:n.assets)!=null&&e.imageUrl)return(t=n==null?void 0:n.assets)==null?void 0:t.imageUrl;if((r=n==null?void 0:n.assets)!=null&&r.imageId)return bo.state.networkImages[n.assets.imageId]},getNetworkImageById(n){if(n)return bo.state.networkImages[n]},getConnectorImage(n){var e;if(n!=null&&n.imageUrl)return n.imageUrl;if((e=n==null?void 0:n.info)!=null&&e.icon)return n.info.icon;if(n!=null&&n.imageId)return bo.state.connectorImages[n.imageId]},getChainImage(n){return bo.state.networkImages[rde[n]]}},Em=Mi({message:"",variant:"info",open:!1}),ide={state:Em,subscribeKey(n,e){return Eo(Em,n,e)},open(n,e){const{debug:t}=Ue.state,{code:r,displayMessage:i,debugMessage:s}=n;i&&t&&(Em.message=i,Em.variant=e,Em.open=!0),s&&console.error(typeof s=="function"?s():s,r?{code:r}:void 0)},close(){Em.open=!1,Em.message="",Em.variant="info"}},Fs=wl(ide),sde=tt.getAnalyticsUrl(),ode=new RC({baseUrl:sde,clientId:null}),ade=["MODAL_CREATED"],Tp=Mi({timestamp:Date.now(),reportedErrors:{},data:{type:"track",event:"MODAL_CREATED"}}),xn={state:Tp,subscribe(n){return Qs(Tp,()=>n(Tp))},getSdkProperties(){const{projectId:n,sdkType:e,sdkVersion:t}=Ue.state;return{projectId:n,st:e,sv:t||"html-wagmi-4.2.2"}},async _sendAnalyticsEvent(n){try{const e=_t.state.address;if(ade.includes(n.data.event)||typeof window>"u")return;await ode.post({path:"/e",params:xn.getSdkProperties(),body:{eventId:tt.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:n.timestamp,props:{...n.data,address:e}}}),Tp.reportedErrors.FORBIDDEN=!1}catch(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===Be.HTTP_STATUS_CODES.FORBIDDEN&&!Tp.reportedErrors.FORBIDDEN&&(Fs.open({displayMessage:"Invalid App Configuration",debugMessage:`Origin ${A2()?window.origin:"uknown"} not found on Allowlist - update configuration on cloud.reown.com`},"error"),Tp.reportedErrors.FORBIDDEN=!0)}},sendEvent(n){var e;Tp.timestamp=Date.now(),Tp.data=n,((e=Ue.state.features)!=null&&e.analytics||n.event==="INITIALIZE")&&xn._sendAnalyticsEvent(Tp)}},cde=tt.getApiUrl(),qc=new RC({baseUrl:cde,clientId:null}),lde=40,Uz=4,ude=20,ur=Mi({promises:{},page:1,count:0,featured:[],allFeatured:[],recommended:[],allRecommended:[],wallets:[],filteredWallets:[],search:[],isAnalyticsEnabled:!1,excludedWallets:[],isFetchingRecommendedWallets:!1}),Ft={state:ur,subscribeKey(n,e){return Eo(ur,n,e)},_getSdkProperties(){const{projectId:n,sdkType:e,sdkVersion:t}=Ue.state;return{projectId:n,st:e||"appkit",sv:t||"html-wagmi-4.2.2"}},_filterOutExtensions(n){return Ue.state.isUniversalProvider?n.filter(e=>!!(e.mobile_link||e.desktop_link||e.webapp_link)):n},async _fetchWalletImage(n){const e=`${qc.baseUrl}/getWalletImage/${n}`,t=await qc.getBlob({path:e,params:Ft._getSdkProperties()});bo.setWalletImage(n,URL.createObjectURL(t))},async _fetchNetworkImage(n){const e=`${qc.baseUrl}/public/getAssetImage/${n}`,t=await qc.getBlob({path:e,params:Ft._getSdkProperties()});bo.setNetworkImage(n,URL.createObjectURL(t))},async _fetchConnectorImage(n){const e=`${qc.baseUrl}/public/getAssetImage/${n}`,t=await qc.getBlob({path:e,params:Ft._getSdkProperties()});bo.setConnectorImage(n,URL.createObjectURL(t))},async _fetchCurrencyImage(n){const e=`${qc.baseUrl}/public/getCurrencyImage/${n}`,t=await qc.getBlob({path:e,params:Ft._getSdkProperties()});bo.setCurrencyImage(n,URL.createObjectURL(t))},async _fetchTokenImage(n){const e=`${qc.baseUrl}/public/getTokenImage/${n}`,t=await qc.getBlob({path:e,params:Ft._getSdkProperties()});bo.setTokenImage(n,URL.createObjectURL(t))},_filterWalletsByPlatform(n){return tt.isMobile()?n==null?void 0:n.filter(t=>t.mobile_link||t.id===wf.COINBASE.id?!0:ue.state.activeChain==="solana"&&(t.id===wf.SOLFLARE.id||t.id===wf.PHANTOM.id)):n},async fetchProjectConfig(){return(await qc.get({path:"/appkit/v1/config",params:Ft._getSdkProperties()})).features},async fetchAllowedOrigins(){try{const{allowedOrigins:n}=await qc.get({path:"/projects/v1/origins",params:Ft._getSdkProperties()});return n}catch(n){if(n instanceof Error&&n.cause instanceof Response){const e=n.cause.status;if(e===Be.HTTP_STATUS_CODES.TOO_MANY_REQUESTS)throw new Error("RATE_LIMITED",{cause:n});if(e>=Be.HTTP_STATUS_CODES.SERVER_ERROR&&e<600)throw new Error("SERVER_ERROR",{cause:n});return[]}return[]}},async fetchNetworkImages(){const n=ue.getAllRequestedCaipNetworks(),e=n==null?void 0:n.map(({assets:t})=>
49t==null?void 0:t.imageId).filter(Boolean).filter(t=>!Hr.getNetworkImageById(t));e&&await Promise.allSettled(e.map(t=>Ft._fetchNetworkImage(t)))},async fetchConnectorImages(){const{connectors:n}=Ge.state,e=n.map(({imageId:t})=>t).filter(Boolean);await Promise.allSettled(e.map(t=>Ft._fetchConnectorImage(t)))},async fetchCurrencyImages(n=[]){await Promise.allSettled(n.map(e=>Ft._fetchCurrencyImage(e)))},async fetchTokenImages(n=[]){await Promise.allSettled(n.map(e=>Ft._fetchTokenImage(e)))},async fetchWallets(n){var s;const e=n.exclude??[];Ft._getSdkProperties().sv.startsWith("html-core-")&&e.push(...Object.values(wf).map(o=>o.id));const r=await qc.get({path:"/getWallets",params:{...Ft._getSdkProperties(),...n,page:String(n.page),entries:String(n.entries),include:(s=n.include)==null?void 0:s.join(","),exclude:e.join(",")}});return{data:Ft._filterWalletsByPlatform(r==null?void 0:r.data)||[],count:r==null?void 0:r.count}},async fetchFeaturedWallets(){const{featuredWalletIds:n}=Ue.state;if(n!=null&&n.length){const e={...Ft._getSdkProperties(),page:1,entries:(n==null?void 0:n.length)??Uz,include:n},{data:t}=await Ft.fetchWallets(e),r=[...t].sort((s,o)=>n.indexOf(s.id)-n.indexOf(o.id)),i=r.map(s=>s.image_id).filter(Boolean);await Promise.allSettled(i.map(s=>Ft._fetchWalletImage(s))),ur.featured=r,ur.allFeatured=r}},async fetchRecommendedWallets(){try{ur.isFetchingRecommendedWallets=!0;const{includeWalletIds:n,excludeWalletIds:e,featuredWalletIds:t}=Ue.state,r=[...e??[],...t??[]].filter(Boolean),i=ue.getRequestedCaipNetworkIds().join(","),s={page:1,entries:Uz,include:n,exclude:r,chains:i},{data:o,count:a}=await Ft.fetchWallets(s),c=wt.getRecentWallets(),u=o.map(f=>f.image_id).filter(Boolean),d=c.map(f=>f.image_id).filter(Boolean);await Promise.allSettled([...u,...d].map(f=>Ft._fetchWalletImage(f))),ur.recommended=o,ur.allRecommended=o,ur.count=a??0}catch{}finally{ur.isFetchingRecommendedWallets=!1}},async fetchWalletsByPage({page:n}){const{includeWalletIds:e,excludeWalletIds:t,featuredWalletIds:r}=Ue.state,i=ue.getRequestedCaipNetworkIds().join(","),s=[...ur.recommended.map(({id:d})=>d),...t??[],...r??[]].filter(Boolean),o={page:n,entries:lde,include:e,exclude:s,chains:i},{data:a,count:c}=await Ft.fetchWallets(o),u=a.slice(0,ude).map(d=>d.image_id).filter(Boolean);await Promise.allSettled(u.map(d=>Ft._fetchWalletImage(d))),ur.wallets=tt.uniqueBy([...ur.wallets,...Ft._filterOutExtensions(a)],"id").filter(d=>{var f;return(f=d.chains)==null?void 0:f.some(m=>i.includes(m))}),ur.count=c>ur.count?c:ur.count,ur.page=n},async initializeExcludedWallets({ids:n}){const e={page:1,entries:n.length,include:n},{data:t}=await Ft.fetchWallets(e);t&&t.forEach(r=>{ur.excludedWallets.push({rdns:r.rdns,name:r.name})})},async searchWallet({search:n,badge:e}){const{includeWalletIds:t,excludeWalletIds:r}=Ue.state,i=ue.getRequestedCaipNetworkIds().join(",");ur.search=[];const s={page:1,entries:100,search:n==null?void 0:n.trim(),badge_type:e,include:t,exclude:r,chains:i},{data:o}=await Ft.fetchWallets(s);xn.sendEvent({type:"track",event:"SEARCH_WALLET",properties:{badge:e??"",search:n??""}});const a=o.map(c=>c.image_id).filter(Boolean);await Promise.allSettled([...a.map(c=>Ft._fetchWalletImage(c)),tt.wait(300)]),ur.search=Ft._filterOutExtensions(o)},initPromise(n,e){const t=ur.promises[n];return t||(ur.promises[n]=e())},prefetch({fetchConnectorImages:n=!0,fetchFeaturedWallets:e=!0,fetchRecommendedWallets:t=!0,fetchNetworkImages:r=!0}={}){const i=[n&&Ft.initPromise("connectorImages",Ft.fetchConnectorImages),e&&Ft.initPromise("featuredWallets",Ft.fetchFeaturedWallets),t&&Ft.initPromise("recommendedWallets",Ft.fetchRecommendedWallets),r&&Ft.initPromise("networkImages",Ft.fetchNetworkImages)].filter(Boolean);return Promise.allSettled(i)},prefetchAnalyticsConfig(){var n;(n=Ue.state.features)!=null&&n.analytics&&Ft.fetchAnalyticsConfig()},async fetchAnalyticsConfig(){try{const{isAnalyticsEnabled:n}=await qc.get({path:"/getAnalyticsConfig",params:Ft._getSdkProperties()});Ue.setFeatures({analytics:n})}catch{Ue.setFeatures({analytics:!1})}},filterByNamespaces(n){if(!(n!=null&&n.length)){ur.featured=ur.allFeatured,ur.recommended=ur.allRecommended;return}const e=ue.getRequestedCaipNetworkIds().join(",");ur.featured=ur.allFeatured.filter(t=>{var r;return(r=t.chains)==null?void 0:r.some(i=>e.includes(i))}),ur.recommended=ur.allRecommended.filter(t=>{var r;return(r=t.chains)==null?void 0:r.some(i=>e.includes(i))}),ur.filteredWallets=ur.wallets.filter(t=>{var r;return(r=t.chains)==null?void 0:r.some(i=>e.includes(i))})},clearFilterByNamespaces(){ur.filteredWallets=[]},setFilterByNamespace(n){if(!n){ur.featured=ur.allFeatured,ur.recommended=ur.allRecommended;return}const e=ue.getRequestedCaipNetworkIds().join(",");ur.featured=ur.allFeatured.filter(t=>{var r;return(r=t.chains)==null?void 0:r.some(i=>e.includes(i))}),ur.recommended=ur.allRecommended.filter(t=>{var r;return(r=t.chains)==null?void 0:r.some(i=>e.includes(i))}),ur.filteredWallets=ur.wallets.filter(t=>{var r;return(r=t.chains)==null?void 0:r.some(i=>e.includes(i))})}},Pi=Mi({view:"Connect",history:["Connect"],transactionStack:[]}),dde={state:Pi,subscribeKey(n,e){return Eo(Pi,n,e)},pushTransactionStack(n){Pi.transactionStack.push(n)},popTransactionStack(n){const e=Pi.transactionStack.pop();if(!e)return;const{onSuccess:t,onError:r,onCancel:i}=e;switch(n){case"success":t==null||t();break;case"error":r==null||r(),it.goBack();break;case"cancel":i==null||i(),it.goBack();break}},push(n,e){n!==Pi.view&&(Pi.view=n,Pi.history.push(n),Pi.data=e)},reset(n,e){Pi.view=n,Pi.history=[n],Pi.data=e},replace(n,e){Pi.history.at(-1)===n||(Pi.view=n,Pi.history[Pi.history.length-1]=n,Pi.data=e)},goBack(){var r;const n=ue.state.activeCaipAddress,e=it.state.view==="ConnectingFarcaster",t=!n&&e;if(Pi.history.length>1){Pi.history.pop();const[i]=Pi.history.slice(-1);i&&(n&&i==="Connect"?Pi.view="Account":Pi.view=i)}else Yn.close();(r=Pi.data)!=null&&r.wallet&&(Pi.data.wallet=void 0),setTimeout(()=>{var i,s,o;if(t){_t.setFarcasterUrl(void 0,ue.state.activeChain);const a=Ge.getAuthConnector();(i=a==null?void 0:a.provider)==null||i.reload();const c=r1(Ue.state);(o=(s=a==null?void 0:a.provider)==null?void 0:s.syncDappData)==null||o.call(s,{metadata:c.metadata,sdkVersion:c.sdkVersion,projectId:c.projectId,sdkType:c.sdkType})}},100)},goBackToIndex(n){if(Pi.history.length>1){Pi.history=Pi.history.slice(0,n+1);const[e]=Pi.history.slice(-1);e&&(Pi.view=e)}},goBackOrCloseModal(){it.state.history.length>1?it.goBack():Yn.close()}},it=wl(dde),Ip=Mi({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),MD={state:Ip,subscribe(n){return Qs(Ip,()=>n(Ip))},setThemeMode(n){Ip.themeMode=n;try{const e=Ge.getAuthConnector();if(e){const t=MD.getSnapshot().themeVariables;e.provider.syncTheme({themeMode:n,themeVariables:t,w3mThemeVariables:Xp(t,n)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(n){Ip.themeVariables={...Ip.themeVariables,...n};try{const e=Ge.getAuthConnector();if(e){const t=MD.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:t,w3mThemeVariables:Xp(Ip.themeVariables,Ip.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot(){return r1(Ip)}},na=wl(MD),LX=Object.fromEntries(OX.map(n=>[n,void 0])),hde=Object.fromEntries(OX.map(n=>[n,!0])),ti=Mi({allConnectors:[],connectors:[],activeConnector:void 0,filterByNamespace:void 0,activeConnectorIds:LX,filterByNamespaceMap:hde}),fde={state:ti,subscribe(n){return Qs(ti,()=>{n(ti)})},subscribeKey(n,e){return Eo(ti,n,e)}
49,initialize(n){n.forEach(e=>{const t=wt.getConnectedConnectorId(e);t&&Ge.setConnectorId(t,e)})},setActiveConnector(n){n&&(ti.activeConnector=d0(n))},setConnectors(n){n.filter(i=>!ti.allConnectors.some(s=>s.id===i.id&&Ge.getConnectorName(s.name)===Ge.getConnectorName(i.name)&&s.chain===i.chain)).forEach(i=>{i.type!=="MULTI_CHAIN"&&ti.allConnectors.push(d0(i))});const t=Ge.getEnabledNamespaces(),r=Ge.getEnabledConnectors(t);ti.connectors=Ge.mergeMultiChainConnectors(r)},filterByNamespaces(n){Object.keys(ti.filterByNamespaceMap).forEach(e=>{ti.filterByNamespaceMap[e]=!1}),n.forEach(e=>{ti.filterByNamespaceMap[e]=!0}),Ge.updateConnectorsForEnabledNamespaces()},filterByNamespace(n,e){ti.filterByNamespaceMap[n]=e,Ge.updateConnectorsForEnabledNamespaces()},updateConnectorsForEnabledNamespaces(){const n=Ge.getEnabledNamespaces(),e=Ge.getEnabledConnectors(n),t=Ge.areAllNamespacesEnabled();ti.connectors=Ge.mergeMultiChainConnectors(e),t?Ft.clearFilterByNamespaces():Ft.filterByNamespaces(n)},getEnabledNamespaces(){return Object.entries(ti.filterByNamespaceMap).filter(([n,e])=>e).map(([n])=>n)},getEnabledConnectors(n){return ti.allConnectors.filter(e=>n.includes(e.chain))},areAllNamespacesEnabled(){return Object.values(ti.filterByNamespaceMap).every(n=>n)},mergeMultiChainConnectors(n){const e=Ge.generateConnectorMapByName(n),t=[];return e.forEach(r=>{const i=r[0],s=(i==null?void 0:i.id)===Be.CONNECTOR_ID.AUTH;r.length>1&&i?t.push({name:i.name,imageUrl:i.imageUrl,imageId:i.imageId,connectors:[...r],type:s?"AUTH":"MULTI_CHAIN",chain:"eip155",id:(i==null?void 0:i.id)||""}):i&&t.push(i)}),t},generateConnectorMapByName(n){const e=new Map;return n.forEach(t=>{const{name:r}=t,i=Ge.getConnectorName(r);if(!i)return;const s=e.get(i)||[];s.find(a=>a.chain===t.chain)||s.push(t),e.set(i,s)}),e},getConnectorName(n){return n&&({"Trust Wallet":"Trust"}[n]||n)},getUniqueConnectorsByName(n){const e=[];return n.forEach(t=>{e.find(r=>r.chain===t.chain)||e.push(t)}),e},addConnector(n){var e,t,r;if(n.id===Be.CONNECTOR_ID.AUTH){const i=n,s=r1(Ue.state),o=na.getSnapshot().themeMode,a=na.getSnapshot().themeVariables;(t=(e=i==null?void 0:i.provider)==null?void 0:e.syncDappData)==null||t.call(e,{metadata:s.metadata,sdkVersion:s.sdkVersion,projectId:s.projectId,sdkType:s.sdkType}),(r=i==null?void 0:i.provider)==null||r.syncTheme({themeMode:o,themeVariables:a,w3mThemeVariables:Xp(a,o)}),Ge.setConnectors([n])}else Ge.setConnectors([n])},getAuthConnector(n){var r;const e=n||ue.state.activeChain,t=ti.connectors.find(i=>i.id===Be.CONNECTOR_ID.AUTH);if(t)return(r=t==null?void 0:t.connectors)!=null&&r.length?t.connectors.find(s=>s.chain===e):t},getAnnouncedConnectorRdns(){return ti.connectors.filter(n=>n.type==="ANNOUNCED").map(n=>{var e;return(e=n.info)==null?void 0:e.rdns})},getConnectorById(n){return ti.allConnectors.find(e=>e.id===n)},getConnector({id:n,rdns:e,namespace:t}){const r=t||ue.state.activeChain;return ti.allConnectors.filter(s=>s.chain===r).find(s=>{var o;return s.explorerId===n||((o=s.info)==null?void 0:o.rdns)===e})},syncIfAuthConnector(n){var s,o;if(n.id!=="ID_AUTH")return;const e=n,t=r1(Ue.state),r=na.getSnapshot().themeMode,i=na.getSnapshot().themeVariables;(o=(s=e==null?void 0:e.provider)==null?void 0:s.syncDappData)==null||o.call(s,{metadata:t.metadata,sdkVersion:t.sdkVersion,sdkType:t.sdkType,projectId:t.projectId}),e.provider.syncTheme({themeMode:r,themeVariables:i,w3mThemeVariables:Xp(i,r)})},getConnectorsByNamespace(n){const e=ti.allConnectors.filter(t=>t.chain===n);return Ge.mergeMultiChainConnectors(e)},canSwitchToSmartAccount(n){return ue.checkIfSmartAccountEnabled()&&Xs(n)===fi.ACCOUNT_TYPES.EOA},selectWalletConnector(n){const e=Ge.getConnector({id:n.id,rdns:n.rdns});tde.handleMobileDeeplinkRedirect((e==null?void 0:e.explorerId)||n.id,ue.state.activeChain),e?it.push("ConnectingExternal",{connector:e,wallet:n}):it.push("ConnectingWalletConnect",{wallet:n})},getConnectors(n){return n?Ge.getConnectorsByNamespace(n):Ge.mergeMultiChainConnectors(ti.allConnectors)},setFilterByNamespace(n){ti.filterByNamespace=n,ti.connectors=Ge.getConnectors(n),Ft.setFilterByNamespace(n)},setConnectorId(n,e){n&&(ti.activeConnectorIds={...ti.activeConnectorIds,[e]:n},wt.setConnectedConnectorId(e,n))},removeConnectorId(n){ti.activeConnectorIds={...ti.activeConnectorIds,[n]:void 0},wt.deleteConnectedConnectorId(n)},getConnectorId(n){if(n)return ti.activeConnectorIds[n]},isConnected(n){return n?!!ti.activeConnectorIds[n]:Object.values(ti.activeConnectorIds).some(e=>!!e)},resetConnectorIds(){ti.activeConnectorIds={...LX}}},Ge=wl(fde),pde=1e3,lA={checkNamespaceConnectorId(n,e){return Ge.getConnectorId(n)===e},isSocialProvider(n){return sr.DEFAULT_REMOTE_FEATURES.socials.includes(n)},connectWalletConnect({walletConnect:n,connector:e,closeModalOnConnect:t=!0,redirectViewOnModalClose:r="Connect",onOpen:i,onConnect:s}){return new Promise((o,a)=>
49{if(n&&Ge.setActiveConnector(e),i==null||i(tt.isMobile()&&n),r){const u=Yn.subscribeKey("open",d=>{d||(it.state.view!==r&&it.replace(r),u(),a(new Error("Modal closed")))})}const c=ue.subscribeKey("activeCaipAddress",u=>{u&&(s==null||s(),t&&Yn.close(),c(),o(Ha.parseCaipAddress(u)))})})},connectExternal(n){return new Promise((e,t)=>{const r=ue.subscribeKey("activeCaipAddress",i=>{i&&(Yn.close(),r(),e(Ha.parseCaipAddress(i)))});nt.connectExternal(n,n.chain).catch(()=>{r(),t(new Error("Connection rejected"))})})},connectSocial({social:n,namespace:e,closeModalOnConnect:t=!0,onOpenFarcaster:r,onConnect:i}){let s=_t.state.socialWindow,o=_t.state.socialProvider,a=!1,c=null;const u=e||ue.state.activeChain,d=ue.subscribeKey("activeCaipAddress",f=>{f&&(t&&Yn.close(),d())});return new Promise((f,m)=>{async function w(b){var E,T;if((E=b.data)!=null&&E.resultUri)if(b.origin===Be.SECURE_SITE_SDK_ORIGIN){window.removeEventListener("message",w,!1);try{const N=Ge.getAuthConnector(u);if(N&&!a){s&&(s.close(),_t.setSocialWindow(void 0,u),s=_t.state.socialWindow),a=!0;const I=b.data.resultUri;if(o&&xn.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:o}}),o){wt.setConnectedSocialProvider(o),await nt.connectExternal({id:N.id,type:N.type,socialUri:I},N.chain);const H=ue.state.activeCaipAddress;if(!H){m(new Error("Failed to connect"));return}f(Ha.parseCaipAddress(H)),xn.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:o,caipNetworkId:(T=ue.getActiveCaipNetwork())==null?void 0:T.caipNetworkId}})}}}catch{o&&xn.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:o}}),m(new Error("Failed to connect"))}}else o&&xn.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:o}})}async function y(){if(n&&(_t.setSocialProvider(n,u),o=_t.state.socialProvider,xn.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:o}})),o==="farcaster"){r==null||r();const b=Yn.subscribeKey("open",T=>{!T&&n==="farcaster"&&(m(new Error("Popup closed")),i==null||i(),b())}),E=Ge.getAuthConnector();if(E&&!_t.state.farcasterUrl)try{const{url:T}=await E.provider.getFarcasterUri();_t.setFarcasterUrl(T,u)}catch{m(new Error("Failed to connect to farcaster"))}}else{const b=Ge.getAuthConnector();c=tt.returnOpenHref(`${Be.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes");try{if(b&&o){const{uri:E}=await b.provider.getSocialRedirectUri({provider:o});if(c&&E){_t.setSocialWindow(c,u),s=_t.state.socialWindow,c.location.href=E;const T=setInterval(()=>{s!=null&&s.closed&&!a&&(m(new Error("Popup closed")),clearInterval(T))},1e3);window.addEventListener("message",w,!1)}else c==null||c.close(),m(new Error("Failed to initiate social connection"))}}catch{m(new Error("Failed to initiate social connection")),c==null||c.close()}}}y()})},connectEmail({closeModalOnConnect:n=!0,redirectViewOnModalClose:e="Connect",onOpen:t,onConnect:r}){return new Promise((i,s)=>{if(t==null||t(),e){const a=Yn.subscribeKey("open",c=>{c||(it.state.view!==e&&it.replace(e),a(),s(new Error("Modal closed")))})}const o=ue.subscribeKey("activeCaipAddress",a=>{a&&(r==null||r(),n&&Yn.close(),o(),i(Ha.parseCaipAddress(a)))})})},async updateEmail(){const n=wt.getConnectedConnectorId(ue.state.activeChain),e=Ge.getAuthConnector();if(!e)throw new Error("No auth connector found");if(n!==Be.CONNECTOR_ID.AUTH)throw new Error("Not connected to email or social");const t=e.provider.getEmail()??"";return await Yn.open({view:"UpdateEmailWallet",data:{email:t,redirectView:void 0}}),new Promise((r,i)=>{const s=setInterval(()=>{const a=e.provider.getEmail()??"";a!==t&&(Yn.close(),clearInterval(s),o(),r({email:a}))},pde),o=Yn.subscribeKey("open",a=>{a||(it.state.view!=="Connect"&&it.push("Connect"),clearInterval(s),o(),i(new Error("Modal closed")))})})},canSwitchToSmartAccount(n){return ue.checkIfSmartAccountEnabled()&&Xs(n)===fi.ACCOUNT_TYPES.EOA}};function $X(){var r,i;const n=((r=ue.state.activeCaipNetwork)==null?void 0:r.chainNamespace)||"eip155",e=((i=ue.state.activeCaipNetwork)==null?void 0:i.id)||1,t=sr.NATIVE_TOKEN_ADDRESS[n];return`${n}:${e}:${t}`}function Xs(n){var t;return(t=ue.getAccountData(n))==null?void 0:t.preferredAccountType}function kD(n){var e,t;return n?(t=(e=ue.state.chains.get(n))==null?void 0:e.networkState)==null?void 0:t.caipNetwork:ue.state.activeCaipNetwork}const ju={getConnectionStatus(n,e){const t=Ge.state.activeConnectorIds[e],r=nt.getConnections(e);return!!t&&n.connectorId===t?"connected":r.some(o=>o.connectorId.toLowerCase()===n.connectorId.toLowerCase())?"active":"disconnected"},excludeConnectorAddressFromConnections({connections:n,connectorId:e,addresses:t}){return n.map(r=>{if((e?r.connectorId.toLowerCase()===e.toLowerCase():!1)&&t){const s=r.accounts.filter(o=>!t.some(c=>
49c.toLowerCase()===o.address.toLowerCase()));return{...r,accounts:s}}return r})},excludeExistingConnections(n,e){const t=new Set(n);return e.filter(r=>!t.has(r.connectorId))},getConnectionsByConnectorId(n,e){return n.filter(t=>t.connectorId.toLowerCase()===e.toLowerCase())},getConnectionsData(n){var a;const e=!!((a=Ue.state.remoteFeatures)!=null&&a.multiWallet),t=Ge.state.activeConnectorIds[n],r=nt.getConnections(n),s=(nt.state.recentConnections.get(n)??[]).filter(c=>Ge.getConnectorById(c.connectorId)),o=ju.excludeExistingConnections([...r.map(c=>c.connectorId),...t?[t]:[]],s);return e?{connections:r,recentConnections:o}:{connections:r.filter(c=>c.connectorId.toLowerCase()===(t==null?void 0:t.toLowerCase())),recentConnections:[]}}},hy=Object.freeze({message:"",variant:"success",svg:void 0,open:!1,autoClose:!0}),go=Mi({...hy}),gde={state:go,subscribeKey(n,e){return Eo(go,n,e)},showLoading(n,e={}){this._showMessage({message:n,variant:"loading",...e})},showSuccess(n){this._showMessage({message:n,variant:"success"})},showSvg(n,e){this._showMessage({message:n,svg:e})},showError(n){const e=tt.parseError(n);this._showMessage({message:e,variant:"error"})},hide(){go.message=hy.message,go.variant=hy.variant,go.svg=hy.svg,go.open=hy.open,go.autoClose=hy.autoClose},_showMessage({message:n,svg:e,variant:t="success",autoClose:r=hy.autoClose}){go.open?(go.open=!1,setTimeout(()=>{go.message=n,go.variant=t,go.svg=e,go.open=!0,go.autoClose=r},150)):(go.message=n,go.variant=t,go.svg=e,go.open=!0,go.autoClose=r)}},Ir=gde,us=Mi({transactions:[],transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),mde={state:us,subscribe(n){return Qs(us,()=>n(us))},setLastNetworkInView(n){us.lastNetworkInView=n},async fetchTransactions(n){var e;if(!n)throw new Error("Transactions can't be fetched without an accountAddress");us.loading=!0;try{const t=await Vn.fetchTransactions({account:n,cursor:us.next,chainId:(e=ue.state.activeCaipNetwork)==null?void 0:e.caipNetworkId}),r=mc.filterSpamTransactions(t.data),i=mc.filterByConnectedChain(r),s=[...us.transactions,...i];us.loading=!1,us.transactions=s,us.transactionsByYear=mc.groupTransactionsByYearAndMonth(us.transactionsByYear,i),us.empty=s.length===0,us.next=t.next?t.next:void 0}catch{const r=ue.state.activeChain;xn.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:n,projectId:Ue.state.projectId,cursor:us.next,isSmartAccount:Xs(r)===fi.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ir.showError("Failed to fetch transactions"),us.loading=!1,us.empty=!0,us.next=void 0}},groupTransactionsByYearAndMonth(n={},e=[]){const t=n;return e.forEach(r=>{const i=new Date(r.metadata.minedAt).getFullYear(),s=new Date(r.metadata.minedAt).getMonth(),o=t[i]??{},c=(o[s]??[]).filter(u=>u.id!==r.id);t[i]={...o,[s]:[...c,r].sort((u,d)=>new Date(d.metadata.minedAt).getTime()-new Date(u.metadata.minedAt).getTime())}}),t},filterSpamTransactions(n){return n.filter(e=>!e.transfers.every(r=>{var i;return((i=r.nft_info)==null?void 0:i.flags.is_spam)===!0}))},filterByConnectedChain(n){var r;const e=(r=ue.state.activeCaipNetwork)==null?void 0:r.caipNetworkId;return n.filter(i=>i.metadata.chain===e)},clearCursor(){us.next=void 0},resetTransactions(){us.transactions=[],us.transactionsByYear={},us.lastNetworkInView=void 0,us.loading=!1,us.empty=!1,us.next=void 0}},mc=wl(mde,"API_ERROR"),Vr=Mi({connections:new Map,recentConnections:new Map,isSwitchingConnection:!1,wcError:!1,buffering:!1,status:"disconnected"});let Xw;const wde={state:Vr,subscribe(n){return Qs(Vr,()=>n(Vr))},subscribeKey(n,e){return Eo(Vr,n,e)},_getClient(){return Vr._client},setClient(n){Vr._client=d0(n)},initialize(n){const e=n.filter(t=>!!t.namespace).map(t=>t.namespace);nt.syncStorageConnections(e)},syncStorageConnections(n){const e=wt.getConnections(),t=n??Array.from(ue.state.chains.keys());for(const r of t){const i=e[r]??[],s=new Map(Vr.recentConnections);s.set(r,i),Vr.recentConnections=s}},getConnections(n){return n?Vr.connections.get(n)??[]:[]},hasAnyConnection(n){const e=nt.state.connections;return Array.from(e.values()).flatMap(t=>t).some(({connectorId:t})=>t===n)},async connectWalletConnect(){var n,e,t,r;
49if(tt.isTelegram()||tt.isSafari()&&tt.isIos()){if(Xw){await Xw,Xw=void 0;return}if(!tt.isPairingExpired(Vr==null?void 0:Vr.wcPairingExpiry)){const i=Vr.wcUri;Vr.wcUri=i;return}Xw=(e=(n=nt._getClient())==null?void 0:n.connectWalletConnect)==null?void 0:e.call(n).catch(()=>{}),nt.state.status="connecting",await Xw,Xw=void 0,Vr.wcPairingExpiry=void 0,nt.state.status="connected"}else await((r=(t=nt._getClient())==null?void 0:t.connectWalletConnect)==null?void 0:r.call(t))},async connectExternal(n,e,t=!0){var i,s;const r=await((s=(i=nt._getClient())==null?void 0:i.connectExternal)==null?void 0:s.call(i,n));return t&&ue.setActiveNamespace(e),r},async reconnectExternal(n){var t,r;await((r=(t=nt._getClient())==null?void 0:t.reconnectExternal)==null?void 0:r.call(t,n));const e=n.chain||ue.state.activeChain;e&&Ge.setConnectorId(n.id,e)},async setPreferredAccountType(n,e){var r;if(!e)return;Yn.setLoading(!0,ue.state.activeChain);const t=Ge.getAuthConnector();t&&(_t.setPreferredAccountType(n,e),await t.provider.setPreferredAccount(n),wt.setPreferredAccountTypes(Object.entries(ue.state.chains).reduce((i,[s,o])=>{const a=s,c=Xs(a);return c!==void 0&&(i[a]=c),i},{}
49)),await nt.reconnectExternal(t),Yn.setLoading(!1,ue.state.activeChain),xn.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:n,network:((r=ue.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)||""}}))},async signMessage(n){var e;return(e=nt._getClient())==null?void 0:e.signMessage(n)},parseUnits(n,e){var t;return(t=nt._getClient())==null?void 0:t.parseUnits(n,e)},formatUnits(n,e){var t;return(t=nt._getClient())==null?void 0:t.formatUnits(n,e)},async sendTransaction(n){var e;return(e=nt._getClient())==null?void 0:e.sendTransaction(n)},async getCapabilities(n){var e;return(e=nt._getClient())==null?void 0:e.getCapabilities(n)},async grantPermissions(n){var e;return(e=nt._getClient())==null?void 0:e.grantPermissions(n)},async walletGetAssets(n){var e;return((e=nt._getClient())==null?void 0:e.walletGetAssets(n))??{}},async estimateGas(n){var e;return(e=nt._getClient())==null?void 0:e.estimateGas(n)},async writeContract(n){var e;return(e=nt._getClient())==null?void 0:e.writeContract(n)},async getEnsAddress(n){var e;return(e=nt._getClient())==null?void 0:e.getEnsAddress(n)},async getEnsAvatar(n){var e;return(e=nt._getClient())==null?void 0:e.getEnsAvatar(n)},checkInstalled(n){var e,t;return((t=(e=nt._getClient())==null?void 0:e.checkInstalled)==null?void 0:t.call(e,n))||!1},resetWcConnection(){Vr.wcUri=void 0,Vr.wcPairingExpiry=void 0,Vr.wcLinking=void 0,Vr.recentWallet=void 0,Vr.status="disconnected",mc.resetTransactions(),wt.deleteWalletConnectDeepLink()},resetUri(){Vr.wcUri=void 0,Vr.wcPairingExpiry=void 0,Xw=void 0},finalizeWcConnection(){var t,r,i;const{wcLinking:n,recentWallet:e}=nt.state;n&&wt.setWalletConnectDeepLink(n),e&&wt.setAppKitRecent(e),xn.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:n?"mobile":"qrcode",name:((r=(t=it.state.data)==null?void 0:t.wallet)==null?void 0:r.name)||"Unknown",caipNetworkId:(i=ue.getActiveCaipNetwork())==null?void 0:i.caipNetworkId}})},setWcBasic(n){Vr.wcBasic=n},setUri(n){Vr.wcUri=n,Vr.wcPairingExpiry=tt.getPairingExpiry()},setWcLinking(n){Vr.wcLinking=n},setWcError(n){Vr.wcError=n,Vr.buffering=!1},setRecentWallet(n){Vr.recentWallet=n},setBuffering(n){Vr.buffering=n},setStatus(n){Vr.status=n}
49,setIsSwitchingConnection(n){Vr.isSwitchingConnection=n},async disconnect({id:n,namespace:e,initialDisconnect:t}={}){var r;try{await((r=nt._getClient())==null?void 0:r.disconnect({id:n,chainNamespace:e,initialDisconnect:t}))}catch(i){throw new sx("Failed to disconnect","INTERNAL_SDK_ERROR",i)}},setConnections(n,e){const t=new Map(Vr.connections);t.set(e,n),Vr.connections=t},async handleAuthAccountSwitch({address:n,namespace:e}){var i,s;const t=(s=(i=_t.state.user)==null?void 0:i.accounts)==null?void 0:s.find(o=>o.type==="smartAccount"),r=t&&t.address.toLowerCase()===n.toLowerCase()&&lA.canSwitchToSmartAccount(e)?"smartAccount":"eoa";await nt.setPreferredAccountType(r,e)},async handleActiveConnection({connection:n,namespace:e,address:t}){const r=Ge.getConnectorById(n.connectorId),i=n.connectorId===Be.CONNECTOR_ID.AUTH;if(!r)throw new Error(`No connector found for connection: ${n.connectorId}`);if(i)i&&t&&await nt.handleAuthAccountSwitch({address:t,namespace:e});else{const s=await nt.connectExternal({id:r.id,type:r.type,provider:r.provider,address:t,chain:e},e);return s==null?void 0:s.address}return t},async handleDisconnectedConnection({connection:n,namespace:e,address:t,closeModalOnConnect:r}){var u,d;const i=Ge.getConnectorById(n.connectorId),s=(d=(u=n.auth)==null?void 0:u.name)==null?void 0:d.toLowerCase(),o=n.connectorId===Be.CONNECTOR_ID.AUTH,a=n.connectorId===Be.CONNECTOR_ID.WALLET_CONNECT;if(!i)throw new Error(`No connector found for connection: ${n.connectorId}`);let c;if(o)if(s&&lA.isSocialProvider(s)){const{address:f}=await lA.connectSocial({social:s,closeModalOnConnect:r,onOpenFarcaster(){Yn.open({view:"ConnectingFarcaster"})},onConnect(){it.replace("ProfileWallets")}});c=f}else{const{address:f}=await lA.connectEmail({closeModalOnConnect:r,onOpen(){Yn.open({view:"EmailLogin"})},onConnect(){it.replace("ProfileWallets")}});c=f}else if(a){const{address:f}=await lA.connectWalletConnect({walletConnect:!0,connector:i,closeModalOnConnect:r,onOpen(m){Yn.open({view:m?"AllWallets":"ConnectingWalletConnect"})},onConnect(){it.replace("ProfileWallets")}});c=f}else{const f=await nt.connectExternal({id:i.id,type:i.type,provider:i.provider,chain:e},e);f&&(c=f.address)}return o&&t&&await nt.handleAuthAccountSwitch({address:t,namespace:e}),c},async switchConnection({connection:n,address:e,namespace:t,closeModalOnConnect:r,onChange:i}){let s;const o=_t.getCaipAddress(t);if(o){const{address:c}=Ha.parseCaipAddress(o);s=c}const a=ju.getConnectionStatus(n,t);switch(a){case"connected":case"active":{const c=await nt.handleActiveConnection({connection:n,namespace:t,address:e});if(s&&c){const u=c.toLowerCase()!==s.toLowerCase();i==null||i({address:c,namespace:t,hasSwitchedAccount:u,hasSwitchedWallet:a==="active"})}break}case"disconnected":{const c=await nt.handleDisconnectedConnection({connection:n,namespace:t,address:e,closeModalOnConnect:r});c&&(i==null||i({address:c,namespace:t,hasSwitchedAccount:!0,hasSwitchedWallet:!0}));break}default:throw new Error(`Invalid connection status: ${a}`)}}},nt=wl(wde),jv=Mi({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0,initialized:!1}),Wd={state:jv,subscribe(n){return Qs(jv,()=>n(jv))},subscribeOpen(n){return Eo(jv,"open",n)},set(n){Object.assign(jv,{...jv,...n})}},yde={async getTokenList(){var r;const n=ue.state.activeCaipNetwork,e=await Vn.fetchSwapTokens({chainId:n==null?void 0:n.caipNetworkId});return((r=e==null?void 0:e.tokens)==null?void 0:r.map(i=>({...i,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0})))||[]},async fetchGasPrice(){var e;const n=ue.state.activeCaipNetwork;if(!n)return null;try{switch(n.chainNamespace){case"solana":const t=(e=await(nt==null?void 0:nt.estimateGas({chainNamespace:"solana"})))==null?void 0:e.toString();return{standard:t,fast:t,instant:t};case"eip155":default:return await Vn.fetchGasPrice({chainId:n.caipNetworkId})}}catch{return null}},async fetchSwapAllowance({tokenAddress:n,userAddress:e,sourceTokenAmount:t,sourceTokenDecimals:r}){const i=await Vn.fetchSwapAllowance({tokenAddress:n,userAddress:e});if(i!=null&&i.allowance&&t&&r){const s=nt.parseUnits(t,r)||0;return BigInt(i.allowance)>=s}return!1},async getMyTokensWithBalance(n){const e=await s$.getMyTokensWithBalance(n);return _t.setTokenBalance(e,ue.state.activeChain),this.mapBalancesToSwapTokens(e)},mapBalancesToSwapTokens(n){return(n==null?void 0:n.map(e=>({...e,address:e!=null&&e.address?e.address:$X(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1})))||[]}},_i=Mi({tokenBalances:[],loading:!1}),bde={state:_i,subscribe(n){return Qs(_i,()=>n(_i))},subscribeKey(n,e){return Eo(_i,n,e)}
49,setToken(n){n&&(_i.token=d0(n))},setTokenAmount(n){_i.sendTokenAmount=n},setReceiverAddress(n){_i.receiverAddress=n},setReceiverProfileImageUrl(n){_i.receiverProfileImageUrl=n},setReceiverProfileName(n){_i.receiverProfileName=n},setNetworkBalanceInUsd(n){_i.networkBalanceInUSD=n},setLoading(n){_i.loading=n},async sendToken(){var n;try{switch(ii.setLoading(!0),(n=ue.state.activeCaipNetwork)==null?void 0:n.chainNamespace){case"eip155":await ii.sendEvmToken();return;case"solana":await ii.sendSolanaToken();return;default:throw new Error("Unsupported chain")}}finally{ii.setLoading(!1)}},async sendEvmToken(){var t,r,i;const n=ue.state.activeChain;if(!n)throw new Error("SendController:sendEvmToken - activeChainNamespace is required");const e=Xs(n);if(!ii.state.sendTokenAmount||!ii.state.receiverAddress)throw new Error("An amount and receiver address are required");if(!ii.state.token)throw new Error("A token is required");(t=ii.state.token)!=null&&t.address?(xn.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:e===fi.ACCOUNT_TYPES.SMART_ACCOUNT,token:ii.state.token.address,amount:ii.state.sendTokenAmount,network:((r=ue.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)||""}}),await ii.sendERC20Token({receiverAddress:ii.state.receiverAddress,tokenAddress:ii.state.token.address,sendTokenAmount:ii.state.sendTokenAmount,decimals:ii.state.token.quantity.decimals})):(xn.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:e===fi.ACCOUNT_TYPES.SMART_ACCOUNT,token:ii.state.token.symbol||"",amount:ii.state.sendTokenAmount,network:((i=ue.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)||""}}),await ii.sendNativeToken({receiverAddress:ii.state.receiverAddress,sendTokenAmount:ii.state.sendTokenAmount,decimals:ii.state.token.quantity.decimals}))},async fetchTokenBalance(n){var s,o;_i.loading=!0;const e=(s=ue.state.activeCaipNetwork)==null?void 0:s.caipNetworkId,t=(o=ue.state.activeCaipNetwork)==null?void 0:o.chainNamespace,r=ue.state.activeCaipAddress,i=r?tt.getPlainAddress(r):void 0;if(_i.lastRetry&&!tt.isAllowedRetry(_i.lastRetry,30*sr.ONE_SEC_MS))return _i.loading=!1,[];try{if(i&&e&&t){const a=await s$.getMyTokensWithBalance();return _i.tokenBalances=a,_i.lastRetry=void 0,a}}catch(a){_i.lastRetry=Date.now(),n==null||n(a),Ir.showError("Token Balance Unavailable")}finally{_i.loading=!1}return[]},fetchNetworkBalance(){if(_i.tokenBalances.length===0)return;const n=yde.mapBalancesToSwapTokens(_i.tokenBalances);if(!n)return;const e=n.find(t=>t.address===$X());e&&(_i.networkBalanceInUSD=e?$ue.multiply(e.quantity.numeric,e.price).toString():"0")},async sendNativeToken(n){var s,o,a;it.pushTransactionStack({});const e=n.receiverAddress,t=_t.state.address,r=nt.parseUnits(n.sendTokenAmount.toString(),Number(n.decimals));await nt.sendTransaction({chainNamespace:Be.CHAIN.EVM,to:e,address:t,data:"0x",value:r??BigInt(0)}),xn.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:Xs("eip155")===fi.ACCOUNT_TYPES.SMART_ACCOUNT,token:((s=ii.state.token)==null?void 0:s.symbol)||"",amount:n.sendTokenAmount,network:((o=ue.state.activeCaipNetwork)==null?void 0:o.caipNetworkId)||""}}),(a=nt._getClient())==null||a.updateBalance("eip155"),ii.resetSend()},async sendERC20Token(n){it.pushTransactionStack({onSuccess(){it.replace("Account")}});const e=nt.parseUnits(n.sendTokenAmount.toString(),Number(n.decimals));if(_t.state.address&&n.sendTokenAmount&&n.receiverAddress&&n.tokenAddress){const t=tt.getPlainAddress(n.tokenAddress);if(!t)throw new Error("SendController:sendERC20Token - tokenAddress is required");await nt.writeContract({fromAddress:_t.state.address,tokenAddress:t,args:[n.receiverAddress,e??BigInt(0)],method:"transfer",abi:Fue.getERC20Abi(t),chainNamespace:Be.CHAIN.EVM}),ii.resetSend()}},async sendSolanaToken(){var n;if(!ii.state.sendTokenAmount||!ii.state.receiverAddress)throw new Error("An amount and receiver address are required");it.pushTransactionStack({onSuccess(){it.replace("Account")}}),await nt.sendTransaction({chainNamespace:"solana",to:ii.state.receiverAddress,value:ii.state.sendTokenAmount}),(n=nt._getClient())==null||n.updateBalance("solana"),ii.resetSend()},resetSend(){_i.token=void 0,_i.sendTokenAmount=void 0,_i.receiverAddress=void 0,_i.receiverProfileImageUrl=void 0,_i.receiverProfileName=void 0,_i.loading=!1,_i.tokenBalances=[]}},ii=wl(bde),bk={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,user:void 0,preferredAccountType:void 0},KT={caipNetwork:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},nn=Mi({chains:hue(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter
49:{networkControllerClient:void 0,connectionControllerClient:void 0},isSwitchingNamespace:!1}),vde={state:nn,subscribe(n){return Qs(nn,()=>{n(nn)})},subscribeKey(n,e){return Eo(nn,n,e)},subscribeChainProp(n,e,t){let r;return Qs(nn.chains,()=>{var s;const i=t||nn.activeChain;if(i){const o=(s=nn.chains.get(i))==null?void 0:s[n];r!==o&&(r=o,e(o))}})},initialize(n,e,t){const{chainId:r,namespace:i}=wt.getActiveNetworkProps(),s=e==null?void 0:e.find(d=>d.id.toString()===(r==null?void 0:r.toString())),a=n.find(d=>(d==null?void 0:d.namespace)===i)||(n==null?void 0:n[0]),c=n.map(d=>d.namespace).filter(d=>d!==void 0),u=Ue.state.enableEmbedded?new Set([...c]):new Set([...(e==null?void 0:e.map(d=>d.chainNamespace))??[]]);((n==null?void 0:n.length)===0||!a)&&(nn.noAdapters=!0),nn.noAdapters||(nn.activeChain=a==null?void 0:a.namespace,nn.activeCaipNetwork=s,ue.setChainNetworkData(a==null?void 0:a.namespace,{caipNetwork:s}),nn.activeChain&&Wd.set({activeChain:a==null?void 0:a.namespace})),u.forEach(d=>{const f=e==null?void 0:e.filter(y=>y.chainNamespace===d),m=wt.getPreferredAccountTypes()||{},w={...Ue.state.defaultAccountTypes,...m};ue.state.chains.set(d,{namespace:d,networkState:Mi({...KT,caipNetwork:f==null?void 0:f[0]}),accountState:Mi({...bk,preferredAccountType:w[d]}),caipNetworks:f??[],...t}),ue.setRequestedCaipNetworks(f??[],d)})},removeAdapter(n){var e,t;if(nn.activeChain===n){const r=Array.from(nn.chains.entries()).find(([i])=>i!==n);if(r){const i=(t=(e=r[1])==null?void 0:e.caipNetworks)==null?void 0:t[0];i&&ue.setActiveCaipNetwork(i)}}nn.chains.delete(n)},addAdapter(n,{networkControllerClient:e,connectionControllerClient:t},r){if(!n.namespace)throw new Error("ChainController:addAdapter - adapter must have a namespace");nn.chains.set(n.namespace,{namespace:n.namespace,networkState:{...KT,caipNetwork:r[0]},accountState:bk,caipNetworks:r,connectionControllerClient:t,networkControllerClient:e}),ue.setRequestedCaipNetworks((r==null?void 0:r.filter(i=>i.chainNamespace===n.namespace))??[],n.namespace)},addNetwork(n){var t;const e=nn.chains.get(n.chainNamespace);if(e){const r=[...e.caipNetworks||[]];(t=e.caipNetworks)!=null&&t.find(i=>i.id===n.id)||r.push(n),nn.chains.set(n.chainNamespace,{...e,caipNetworks:r}),ue.setRequestedCaipNetworks(r,n.chainNamespace),Ge.filterByNamespace(n.chainNamespace,!0)}},removeNetwork(n,e){var r,i,s;const t=nn.chains.get(n);if(t){const o=((r=nn.activeCaipNetwork)==null?void 0:r.id)===e,a=[...((i=t.caipNetworks)==null?void 0:i.filter(c=>c.id!==e))||[]];o&&((s=t==null?void 0:t.caipNetworks)!=null&&s[0])&&ue.setActiveCaipNetwork(t.caipNetworks[0]),nn.chains.set(n,{...t,caipNetworks:a}),ue.setRequestedCaipNetworks(a||[],n),a.length===0&&Ge.filterByNamespace(n,!1)}},setAdapterNetworkState(n,e){const t=nn.chains.get(n);t&&(t.networkState={...t.networkState||KT,...e},nn.chains.set(n,t))},setChainAccountData(n,e,t=!0){if(!n)throw new Error("Chain is required to update chain account data");const r=nn.chains.get(n);if(r){const i={...r.accountState||bk,...e};nn.chains.set(n,{...r,accountState:i}),(nn.chains.size===1||nn.activeChain===n)&&(e.caipAddress&&(nn.activeCaipAddress=e.caipAddress),_t.replaceState(i))}},setChainNetworkData(n,e){if(!n)return;const t=nn.chains.get(n);if(t){const r={...t.networkState||KT,...e};nn.chains.set(n,{...t,networkState:r})}},setAccountProp(n,e,t,r=!0){ue.setChainAccountData(t,{[n]:e},r)},setActiveNamespace(n){var r,i;nn.activeChain=n;const e=n?nn.chains.get(n):void 0,t=(r=e==null?void 0:e.networkState)==null?void 0:r.caipNetwork;t!=null&&t.id&&n&&(nn.activeCaipAddress=(i=e==null?void 0:e.accountState)==null?void 0:i.caipAddress,nn.activeCaipNetwork=t,ue.setChainNetworkData(n,{caipNetwork:t}),wt.setActiveCaipNetworkId(t==null?void 0:t.caipNetworkId),Wd.set({activeChain:n,selectedNetworkId:t==null?void 0:t.caipNetworkId}))},setActiveCaipNetwork(n){var r,i,s;if(!n)return;nn.activeChain!==n.chainNamespace&&ue.setIsSwitchingNamespace(!0);const e=nn.chains.get(n.chainNamespace);nn.activeChain=n.chainNamespace,nn.activeCaipNetwork=n,ue.setChainNetworkData(n.chainNamespace,{caipNetwork:n}),(r=e==null?void 0:e.accountState)!=null&&r.address?nn.activeCaipAddress=`${n.chainNamespace}:${n.id}:${(i=e==null?void 0:e.accountState)==null?void 0:i.address}`:nn.activeCaipAddress=void 0,ue.setAccountProp("caipAddress",nn.activeCaipAddress,n.chainNamespace),e&&_t.replaceState(e.accountState),ii.resetSend(),Wd.set({activeChain:nn.activeChain,selectedNetworkId:(s=nn.activeCaipNetwork)==null?void 0:s.caipNetworkId}),wt.setActiveCaipNetworkId(n.caipNetworkId),!ue.checkIfSupportedNetwork(n.chainNamespace)&&Ue.state.enableNetworkSwitch&&!Ue.state.allowUnsupportedChain&&!nt.state.wcBasic&&ue.showUnsupportedChainUI()},addCaipNetwork(n){var t;if(!n)return;const e=nn.chains.get(n.chainNamespace);e&&((t=e==null?void 0:e.caipNetworks)==null||t.push(n))},async switchActiveNamespace(n){var i;if(!n)return;const e=n!==ue.state.activeChain,t=(i=ue.getNetworkData(n))==null?void 0:i.caipNetwork,r=ue.getCaipNetworkByNamespace(n,t==null?void 0:t.id);e&&r&&await ue.switchActiveNetwork(r)},async switchActiveNetwork(n){var s;const e=ue.state.activeChain;if(!e)throw new Error("ChainController:switchActiveNetwork - namespace is required");const t=ue.state.chains.get(e),r=!((s=t==null?void 0:t.caipNetworks)!=null&&s.some(o=>{var a;return o.id===((a=nn.activeCaipNetwork)==null?void 0:a.id)})),i=ue.getNetworkControllerClient(n.chainNamespace);if(i){try{await i.switchCaipNetwork(n),r&&Yn.close()}catch{it.goBack()}xn.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:n.caipNetworkId}})}},getNetworkControllerClient(n){const e=n||nn.activeChain;if(!e)throw new Error("ChainController:getNetworkControllerClient - chain is required");const t=nn.chains.get(e);if(!t)throw new Error("Chain adapter not found");if(!t.networkControllerClient)throw new Error("NetworkController client not set");return t.networkControllerClient},getConnectionControllerClient(n){const e=n||nn.activeChain;if(!e)throw new Error("Chain is required to get connection controller client");const t=nn.chains.get(e);if(!(t!=null&&t.connectionControllerClient))throw new Error("ConnectionController client not set");return t.connectionControllerClient},getNetworkProp(n,e){var r;const t=(r=nn.chains.get(e))==null?void 0:r.networkState;if(t)return t[n]},getRequestedCaipNetworks(n){const e=nn.chains.get(n),{approvedCaipNetworkIds:t=[],requestedCaipNetworks:r=[]}=(e==null?void 0:e.networkState)||{};return tt.sortRequestedNetworks(t,r).filter(o=>o==null?void 0:o.id)},getAllRequestedCaipNetworks(){const n=[];
49return nn.chains.forEach(e=>{if(!e.namespace)throw new Error("ChainController:getAllRequestedCaipNetworks - chainAdapter must have a namespace");const t=ue.getRequestedCaipNetworks(e.namespace);n.push(...t)}),n},setRequestedCaipNetworks(n,e){ue.setAdapterNetworkState(e,{requestedCaipNetworks:n});const r=ue.getAllRequestedCaipNetworks().map(s=>s.chainNamespace),i=Array.from(new Set(r));Ge.filterByNamespaces(i)},getAllApprovedCaipNetworkIds(){const n=[];return nn.chains.forEach(e=>{if(!e.namespace)throw new Error("ChainController:getAllApprovedCaipNetworkIds - chainAdapter must have a namespace");const t=ue.getApprovedCaipNetworkIds(e.namespace);n.push(...t)}),n},getActiveCaipNetwork(n){var e,t;return n?(t=(e=nn.chains.get(n))==null?void 0:e.networkState)==null?void 0:t.caipNetwork:nn.activeCaipNetwork},getActiveCaipAddress(){return nn.activeCaipAddress},getApprovedCaipNetworkIds(n){var r;const e=nn.chains.get(n);return((r=e==null?void 0:e.networkState)==null?void 0:r.approvedCaipNetworkIds)||[]},async setApprovedCaipNetworksData(n){const e=ue.getNetworkControllerClient(),t=await(e==null?void 0:e.getApprovedCaipNetworksData());ue.setAdapterNetworkState(n,{approvedCaipNetworkIds:t==null?void 0:t.approvedCaipNetworkIds,supportsAllNetworks:t==null?void 0:t.supportsAllNetworks})},checkIfSupportedNetwork(n,e){var i;const t=e||((i=nn.activeCaipNetwork)==null?void 0:i.caipNetworkId),r=ue.getRequestedCaipNetworks(n);return r.length?r==null?void 0:r.some(s=>s.caipNetworkId===t):!0},checkIfSupportedChainId(n){if(!nn.activeChain)return!0;const e=ue.getRequestedCaipNetworks(nn.activeChain);return e==null?void 0:e.some(t=>t.id===n)},setSmartAccountEnabledNetworks(n,e){ue.setAdapterNetworkState(e,{smartAccountEnabledNetworks:n})},checkIfSmartAccountEnabled(){var r;const n=kX.caipNetworkIdToNumber((r=nn.activeCaipNetwork)==null?void 0:r.caipNetworkId),e=nn.activeChain;if(!e||!n)return!1;const t=ue.getNetworkProp("smartAccountEnabledNetworks",e);return!!(t!=null&&t.includes(Number(n)))},showUnsupportedChainUI(){Yn.open({view:"UnsupportedChain"})},checkIfNamesSupported(){const n=nn.activeCaipNetwork;return!!(n!=null&&n.chainNamespace&&sr.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(n.chainNamespace))},resetNetwork(n){ue.setAdapterNetworkState(n,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})},resetAccount(n){var i,s;const e=n;if(!e)throw new Error("Chain is required to set account prop");const t=(s=(i=ue.state.chains.get(e))==null?void 0:i.accountState)==null?void 0:s.preferredAccountType,r=Ue.state.defaultAccountTypes[e];nn.activeCaipAddress=void 0,ue.setChainAccountData(e,{smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:r||t,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,user:void 0,status:"disconnected"}),Ge.removeConnectorId(e)},setIsSwitchingNamespace(n){nn.isSwitchingNamespace=n},getFirstCaipNetworkSupportsAuthConnector(){var t,r;const n=[];let e;if(nn.chains.forEach(i=>{Be.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(s=>s===i.namespace)&&i.namespace&&n.push(i.namespace)}),n.length>0){const i=n[0];return e=i?(r=(t=nn.chains.get(i))==null?void 0:t.caipNetworks)==null?void 0:r[0]:void 0,e}},getAccountData(n){var t;const e=n||nn.activeChain;if(e)return(t=ue.state.chains.get(e))==null?void 0:t.accountState},getNetworkData(n){var t;const e=n||nn.activeChain;if(e)return(t=ue.state.chains.get(e))==null?void 0:t.networkState},getCaipNetworkByNamespace(n,e){var i,s,o;if(!n)return;const t=ue.state.chains.get(n),r=(i=t==null?void 0:t.caipNetworks)==null?void 0:i.find(a=>a.id===e);return r||((s=t==null?void 0:t.networkState)==null?void 0:s.caipNetwork)||((o=t==null?void 0:t.caipNetworks)==null?void 0:o[0])},getRequestedCaipNetworkIds(){const n=Ge.state.filterByNamespace;return(n?[nn.chains.get(n)]:Array.from(nn.chains.values())).flatMap(t=>(t==null?void 0:t.caipNetworks)||[]).map(t=>t.caipNetworkId)},getCaipNetworks(n){return n?ue.getRequestedCaipNetworks(n):ue.getAllRequestedCaipNetworks()},setLastConnectedSIWECaipNetwork(n){nn.lastConnectedSIWECaipNetwork=n},getLastConnectedSIWECaipNetwork(){return nn.lastConnectedSIWECaipNetwork}}
49,ue=wl(vde),xde={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},UX=tt.getBlockchainApiUrl(),Kc=Mi({clientId:null,api:new RC({baseUrl:UX,clientId:null}),supportedChains:{http:[],ws:[]}}),Vn={state:Kc,async get(n){const{st:e,sv:t}=Vn.getSdkProperties(),r=Ue.state.projectId,i={...n.params||{},st:e,sv:t,projectId:r};return Kc.api.get({...n,params:i})},getSdkProperties(){const{sdkType:n,sdkVersion:e}=Ue.state;return{st:n||"unknown",sv:e||"unknown"}},async isNetworkSupported(n){if(!n)return!1;try{Kc.supportedChains.http.length||await Vn.getSupportedNetworks()}catch{return!1}return Kc.supportedChains.http.includes(n)},async getSupportedNetworks(){try{const n=await Vn.get({path:"v1/supported-chains"});return Kc.supportedChains=n,n}catch{return Kc.supportedChains}},async fetchIdentity({address:n,caipNetworkId:e}){if(!await Vn.isNetworkSupported(e))return{avatar:"",name:""};const r=wt.getIdentityFromCacheForAddress(n);if(r)return r;const i=await Vn.get({path:`/v1/identity/${n}`,params:{sender:ue.state.activeCaipAddress?tt.getPlainAddress(ue.state.activeCaipAddress):void 0}});return wt.updateIdentityCache({address:n,identity:i,timestamp:Date.now()}),i},async fetchTransactions({account:n,cursor:e,signal:t,cache:r,chainId:i}){var c;if(!await Vn.isNetworkSupported((c=ue.state.activeCaipNetwork)==null?void 0:c.caipNetworkId))return{data:[],next:void 0};const o=wt.getTransactionsCacheForAddress({address:n,chainId:i});if(o)return o;const a=await Vn.get({path:`/v1/account/${n}/history`,params:{cursor:e,chainId:i},signal:t,cache:r});return wt.updateTransactionsCache({address:n,chainId:i,timestamp:Date.now(),transactions:a}),a},async fetchSwapQuote({amount:n,userAddress:e,from:t,to:r,gasPrice:i}){var o;return await Vn.isNetworkSupported((o=ue.state.activeCaipNetwork)==null?void 0:o.caipNetworkId)?Vn.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{amount:n,userAddress:e,from:t,to:r,gasPrice:i}}):{quotes:[]}},async fetchSwapTokens({chainId:n}){var t;return await Vn.isNetworkSupported((t=ue.state.activeCaipNetwork)==null?void 0:t.caipNetworkId)?Vn.get({path:"/v1/convert/tokens",params:{chainId:n}}):{tokens:[]}},async fetchTokenPrice({addresses:n}){var i;if(!await Vn.isNetworkSupported((i=ue.state.activeCaipNetwork)==null?void 0:i.caipNetworkId))return{fungibles:[]};const t=wt.getTokenPriceCacheForAddresses(n);if(t)return t;const r=await Kc.api.post({path:"/v1/fungible/price",body:{currency:"usd",addresses:n,projectId:Ue.state.projectId},headers:{"Content-Type":"application/json"}});return wt.updateTokenPriceCache({addresses:n,timestamp:Date.now(),tokenPrice:r}),r},async fetchSwapAllowance({tokenAddress:n,userAddress:e}){var r;return await Vn.isNetworkSupported((r=ue.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?Vn.get({path:"/v1/convert/allowance",params:{tokenAddress:n,userAddress:e},headers:{"Content-Type":"application/json"}}):{allowance:"0"}},async fetchGasPrice({chainId:n}){var i;const{st:e,sv:t}=Vn.getSdkProperties();if(!await Vn.isNetworkSupported((i=ue.state.activeCaipNetwork)==null?void 0:i.caipNetworkId))throw new Error("Network not supported for Gas Price");return Vn.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json"},params:{chainId:n,st:e,sv:t}})},async generateSwapCalldata({amount:n,from:e,to:t,userAddress:r,disableEstimate:i}){var o;if(!await Vn.isNetworkSupported((o=ue.state.activeCaipNetwork)==null?void 0:o.caipNetworkId))throw new Error("Network not supported for Swaps");return Kc.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:n,eip155:{slippage:sr.CONVERT_SLIPPAGE_TOLERANCE},projectId:Ue.state.projectId,from:e,to:t,userAddress:r,disableEstimate:i}})},async generateApproveCalldata({from:n,to:e,userAddress:t}){var o;const{st:r,sv:i}=Vn.getSdkProperties();if(!await Vn.isNetworkSupported((o=ue.state.activeCaipNetwork)==null?void 0:o.caipNetworkId))throw new Error("Network not supported for Swaps");return Vn.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json"},params:{userAddress:t,from:n,to:e,st:r,sv:i}})},async getBalance(n,e,t){var u;const{st:r,sv:i}=Vn.getSdkProperties();if(!await Vn.isNetworkSupported((u=ue.state.activeCaipNetwork)==null?void 0:u.caipNetworkId))return Ir.showError("Token Balance Unavailable"),{balances:[]};const o=`${e}:${n}`,a=wt.getBalanceCacheForCaipAddress(o);if(a)return a;const c=await Vn.get({path:`/v1/account/${n}/balance`,params:{currency:"usd",chainId:e,forceUpdate:t,st:r,sv:i}});return wt.updateBalanceCache({caipAddress:o,balance:c,timestamp:Date.now()}),c},async lookupEnsName(n){var t;return await Vn.isNetworkSupported((t=ue.state.activeCaipNetwork)==null?void 0:t.caipNetworkId)?Vn.get({path:`/v1/profile/account/${n}`,params:{apiVersion:"2"}}):{addresses:{},attributes:[]}},async reverseLookupEnsName({address:n}){var t;return await Vn.isNetworkSupported((t=ue.state.activeCaipNetwork)==null?void 0:t.caipNetworkId)?Vn.get({path:`/v1/profile/reverse/${n}`,params:{sender:_t.state.address,apiVersion:"2"}}):[]},async getEnsNameSuggestions(n){var t;return await Vn.isNetworkSupported((t=ue.state.activeCaipNetwork)==null?void 0:t.caipNetworkId)?Vn.get({path:`/v1/profile/suggestions/${n}`,params:{zone:"reown.id"}}):{suggestions:[]}},async registerEnsName({coinType:n,address:e,message:t,signature:r}){var s;return await Vn.isNetworkSupported((s=ue.state.activeCaipNetwork)==null?void 0:s.caipNetworkId)?Kc.api.post({path:"/v1/profile/account",body:{coin_type:n,address:e,message:t,signature:r},headers:{"Content-Type":"application/json"}}):{success:!1}},async generateOnRampURL({destinationWallets:n,partnerUserId:e,defaultNetwork:t,purchaseAmount:r,paymentAmount:i}){var a;return await Vn.isNetworkSupported((a=ue.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)?(await Kc.api.post({path:"/v1/generators/onrampurl",params:{projectId:Ue.state.projectId},body:{destinationWallets:n,defaultNetwork:t,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:r,presetFiatAmount:i}})).url:""},async getOnrampOptions(){var e;if(!await Vn.isNetworkSupported((e=ue.state.activeCaipNetwork)==null?void 0:e.caipNetworkId))return{paymentCurrencies:[],purchaseCurrencies:[]};try{return await Vn.get({path:"/v1/onramp/options"})}catch{return xde}},async getOnrampQuote({purchaseCurrency:n,paymentCurrency:e,amount:t,network:r}){var i;try{return await Vn.isNetworkSupported((i=ue.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)?await Kc.api.post({path:"/v1/onramp/quote",params:{projectId:Ue.state.projectId},body:{purchaseCurrency:n,paymentCurrency:e,amount:t,network:r}}):null}catch{return{networkFee:{amount:t,currency:e.id},paymentSubtotal:{amount:t,currency:e.id},paymentTotal:{amount:t,currency:e.id},purchaseAmount:{amount:t,currency:e.id},quoteId:"mocked-quote-id"}}},async getSmartSessions(n){var t;return await Vn.isNetworkSupported((t=ue.state.activeCaipNetwork)==null?void 0:t.caipNetworkId)?Vn.get({path:`/v1/sessions/${n}`}):[]},async revokeSmartSession(n,e,t){var i;return await Vn.isNetworkSupported((i=ue.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)?Kc.api.post({path:`/v1/sessions/${n}/revoke`,params:{projectId:Ue.state.projectId},body:{pci:e,signature:t}}):{success:!1}},setClientId(n){Kc.clientId=n,Kc.api=new RC({baseUrl:UX,clientId:n}
49)}};function Ede(n,{strict:e=!0}={}){return!n||typeof n!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(n):n.startsWith("0x")}function jz(n){return Ede(n,{strict:!1})?Math.ceil((n.length-2)/2):n.length}const jX="2.33.2";let uA={getDocsUrl:({docsBaseUrl:n,docsPath:e="",docsSlug:t})=>e?`${n??"https://viem.sh"}${e}${t?`#${t}`:""}`:void 0,version:`viem@${jX}`},Vf=class OD extends Error{constructor(e,t={}){var a;const r=(()=>{var c;return t.cause instanceof OD?t.cause.details:(c=t.cause)!=null&&c.message?t.cause.message:t.details})(),i=t.cause instanceof OD&&t.cause.docsPath||t.docsPath,s=(a=uA.getDocsUrl)==null?void 0:a.call(uA,{...t,docsPath:i}),o=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...uA.version?[`Version: ${uA.version}`]:[]].join(` 50`);super(o,t.cause?{cause:t.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=i,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=jX}walk(e){return zX(this,e)}};function zX(n,e){return e!=null&&e(n)?n:n&&typeof n=="object"&&"cause"in n&&n.cause!==void 0?zX(n.cause,e):e?null:n}let FX=class extends Vf{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}};function GL(n,{dir:e,size:t=32}={}){return typeof n=="string"?Ade(n,{dir:e,size:t}):Sde(n,{dir:e,size:t})}function Ade(n,{dir:e,size:t=32}={}){if(t===null)return n;const r=n.replace("0x","");if(r.length>t*2)throw new FX({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](t*2,"0")}`}function Sde(n,{dir:e,size:t=32}={}){if(t===null)return n;if(n.length>t)throw new FX({size:n.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let i=0;i<t;i++){const s=e==="right";r[s?i:t-i-1]=n[s?i:n.length-i-1]}return r}let _de=class extends Vf{constructor({max:e,min:t,signed:r,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}},Cde=class extends Vf{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function WX(n,{size:e}){if(jz(n)>e)throw new Cde({givenSize:jz(n),maxSize:e})}const Tde=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function zz(n,e={}){return typeof n=="number"||typeof n=="bigint"?Nde(n,e):typeof n=="string"?VX(n,e):typeof n=="boolean"?Ide(n,e):HX(n,e)}function Ide(n,e={}){const t=`0x${Number(n)}`;return typeof e.size=="number"?(WX(t,{size:e.size}),GL(t,{size:e.size})):t}function HX(n,e={}){let t="";for(let i=0;i<n.length;i++)t+=Tde[n[i]];const r=`0x${t}`;return typeof e.size=="number"?(WX(r,{size:e.size}),GL(r,{dir:"right",size:e.size})):r}function Nde(n,e={}){const{signed:t,size:r}=e,i=BigInt(n);let s;r?t?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof n=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&t?-s-1n:0;if(s&&i>s||i<o){const c=typeof n=="bigint"?"n":"";throw new _de({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:t,size:r,value:`${n}${c}`})}const a=`0x${(t&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?GL(a,{size:r}):a}const Rde=new TextEncoder;function VX(n,e={}){const t=Rde.encode(n);return HX(t,e)}const YT=BigInt(2**32-1),Fz=BigInt(32);function Mde(n,e=!1){return e?{h:Number(n&YT),l:Number(n>>Fz&YT)}:{h:Number(n>>Fz&YT)|0,l:Number(n&YT)|0}}function qX(n,e=!1){const t=n.length;let r=new Uint32Array(t),i=new Uint32Array(t);for(let s=0;s<t;s++){const{h:o,l:a}=Mde(n[s],e);[r[s],i[s]]=[o,a]}return[r,i]}const Wz=(n,e,t)=>n>>>t,Hz=(n,e,t)=>n<<32-t|e>>>t,zv=(n,e,t)=>n>>>t|e<<32-t,Fv=(n,e,t)=>n<<32-t|e>>>t,GT=(n,e,t)=>n<<64-t|e>>>t-32,ZT=(n,e,t)=>n>>>t-32|e<<64-t,kde=(n,e,t)=>n<<t|e>>>32-t,Ode=(n,e,t)=>e<<t|n>>>32-t,Pde=(n,e,t)=>e<<t-32|n>>>64-t,Dde=(n,e,t)=>n<<t-32|e>>>64-t;function Np(n,e,t,r){const i=(e>>>0)+(r>>>0);return{h:n+t+(i/2**32|0)|0,l:i|0}}const Bde=(n,e,t)=>(n>>>0)+(e>>>0)+(t>>>0),Lde=(n,e,t,r)=>e+t+r+(n/2**32|0)|0,$de=(n,e,t,r)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0),Ude=(n,e,t,r,i)=>e+t+r+i+(n/2**32|0)|0,jde=(n,e,t,r,i)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),zde=(n,e,t,r,i,s)=>e+t+r+i+s+(n/2**32|0)|0,Wv=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function z1(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function ax(n){if(!Number.isSafeInteger(n)||n<0)throw new Error("positive integer expected, got "+n)}function nu(n,...e){if(!z1(n))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(n.length))throw new Error("Uint8Array expected of length "+e+", got length="+n.length)}function KX(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");ax(n.outputLen),ax(n.blockLen)}function cx(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function YX(n,e){nu(n);const t=e.outputLen;if(n.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function Fde(n){return new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4))}function h0(...n){for(let e=0;e<n.length;e++)n[e].fill(0)}function vk(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function Qh(n,e){return n<<32-e|n>>>e}
vendor: 5,655 bytes, line 50
50const Wde=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Hde(n){return n<<24&4278190080|n<<8&16711680|n>>>8&65280|n>>>24&255}function Vde(n){for(let e=0;e<n.length;e++)n[e]=Hde(n[e]);return n}const Vz=Wde?n=>n:Vde,GX=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",qde=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function Jl(n){if(nu(n),GX)return n.toHex();let e="";for(let t=0;t<n.length;t++)e+=qde[n[t]];return e}const Rp={_0:48,_9:57,A:65,F:70,a:97,f:102};function qz(n){if(n>=Rp._0&&n<=Rp._9)return n-Rp._0;if(n>=Rp.A&&n<=Rp.F)return n-(Rp.A-10);if(n>=Rp.a&&n<=Rp.f)return n-(Rp.a-10)}function s1(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);if(GX)return Uint8Array.fromHex(n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let i=0,s=0;i<t;i++,s+=2){const o=qz(n.charCodeAt(s)),a=qz(n.charCodeAt(s+1));if(o===void 0||a===void 0){const c=n[s]+n[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[i]=o*16+a}return r}function Kde(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}function R8(n){return typeof n=="string"&&(n=Kde(n)),nu(n),n}function vo(...n){let e=0;for(let r=0;r<n.length;r++){const i=n[r];nu(i),e+=i.length}const t=new Uint8Array(e);for(let r=0,i=0;r<n.length;r++){const s=n[r];t.set(s,i),i+=s.length}return t}class ZL{}function QL(n){const e=r=>n().update(R8(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function MC(n=32){if(Wv&&typeof Wv.getRandomValues=="function")return Wv.getRandomValues(new Uint8Array(n));if(Wv&&typeof Wv.randomBytes=="function")return Uint8Array.from(Wv.randomBytes(n));throw new Error("crypto.getRandomValues must be defined")}const Yde=BigInt(0),dA=BigInt(1),Gde=BigInt(2),Zde=BigInt(7),Qde=BigInt(256),Xde=BigInt(113),ZX=[],QX=[],XX=[];for(let n=0,e=dA,t=1,r=0;n<24;n++){[t,r]=[r,(2*t+3*r)%5],ZX.push(2*(5*r+t)),QX.push((n+1)*(n+2)/2%64);let i=Yde;for(let s=0;s<7;s++)e=(e<<dA^(e>>Zde)*Xde)%Qde,e&Gde&&(i^=dA<<(dA<<BigInt(s))-dA);XX.push(i)}const JX=qX(XX,!0),Jde=JX[0],ehe=JX[1],Kz=(n,e,t)=>t>32?Pde(n,e,t):kde(n,e,t),Yz=(n,e,t)=>t>32?Dde(n,e,t):Ode(n,e,t);function the(n,e=24){const t=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)t[o]=n[o]^n[o+10]^n[o+20]^n[o+30]^n[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=t[c],d=t[c+1],f=Kz(u,d,1)^t[a],m=Yz(u,d,1)^t[a+1];for(let w=0;w<50;w+=10)n[o+w]^=f,n[o+w+1]^=m}let i=n[2],s=n[3];for(let o=0;o<24;o++){const a=QX[o],c=Kz(i,s,a),u=Yz(i,s,a),d=ZX[o];i=n[d],s=n[d+1],n[d]=c,n[d+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=n[o+a];for(let a=0;a<10;a++)n[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}n[0]^=Jde[r],n[1]^=ehe[r]}h0(t)}class XL extends ZL{constructor(e,t,r,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=s,ax(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Fde(this.state)}clone(){return this._cloneInto()}keccak(){Vz(this.state32),the(this.state32,this.rounds),Vz(this.state32),this.posOut=0,this.pos=0}update(e){cx(this),e=R8(e),nu(e);const{blockLen:t,state:r}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(t-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:i}=this;e[r]^=t,(t&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){cx(this,!1),nu(e),this.finish();const t=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(t.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ax(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(YX(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,h0(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new XL(t,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const nhe=(n,e,t)=>QL(()=>new XL(e,n,t)),PD=nhe(1,136,256/8);let rhe=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const Ky=(n,e,t)=>JSON.stringify(n,(r,i)=>typeof i=="bigint"?i.toString():i,t);function ihe(n,e){let t=n.toString();const r=t.startsWith("-");r&&(t=t.slice(1)),t=t.padStart(e,"0");let[i,s]=[t.slice(0,t.length-e),t.slice(t.length-e)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${i||"0"}${s?`.${s}`:""}`}const JL=n=>n;class uS extends Vf{constructor({body:e,cause:t,details:r,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${JL(o)}`,e&&`Request body: ${Ky(e)}
50`].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=e,this.headers=i,this.status=s,this.url=o}}class eJ extends Vf{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${JL(r)}`,`Request body: ${Ky(e)}`],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=t.code,this.data=t.data}}class Gz extends Vf{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${JL(t)}`,`Request body: ${Ky(e)}`],name:"TimeoutError"})}}const she=-1;class yl extends Vf{constructor(e,{code:t,docsPath:r,metaMessages:i,name:s,shortMessage:o}){super(o,{cause:e,docsPath:r,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof eJ?e.code:t??she}}class cu extends yl{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class ZS extends yl{constructor(e){super(e,{code:ZS.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(ZS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class QS extends yl{constructor(e){super(e,{code:QS.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(QS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class XS extends yl{constructor(e,{method:t}={}){super(e,{code:XS.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(XS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class JS extends yl{constructor(e){super(e,{code:JS.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` 51`)})}}Object.defineProperty(JS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class lx extends yl{constructor(e){super(e,{code:lx.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(lx,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class e_ extends yl{constructor(e){super(e,{code:e_.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` 52`)})}}Object.defineProperty(e_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class t_ extends yl{constructor(e){super(e,{code:t_.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(t_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class n_ extends yl{constructor(e){super(e,{code:n_.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(n_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class ux extends yl{constructor(e){super(e,{code:ux.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(ux,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Sy extends yl{constructor(e,{method:t}={}){super(e,{code:Sy.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(Sy,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class dx extends yl{constructor(e){super(e,{code:dx.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(dx,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class r_ extends yl{constructor(e){super(e,{code:r_.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(r_,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Yy extends cu{constructor(e){super(e,{code:Yy.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Yy,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class i_ extends cu{constructor(e){super(e,{code:i_.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(i_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class s_ extends cu{constructor(e,{method:t}={}){super(e,{code:s_.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(s_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class o_ extends cu{constructor(e){super(e,{code:o_.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(o_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class a_ extends cu{constructor(e){super(e,{code:a_.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(a_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class c_ extends cu{constructor(e){super(e,{code:c_.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(c_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class l_ extends cu{constructor(e){super(e,{code:l_.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(l_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class u_ extends cu{constructor(e){super(e,{code:u_.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(u_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class d_ extends cu{constructor(e){super(e,{code:d_.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(d_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class h_ extends cu{constructor(e){super(e,{code:h_.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(h_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class f_ extends cu{constructor(e){super(e,{code:f_.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(f_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class p_ extends cu{constructor(e){super(e,{code:p_.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(p_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
52);class g_ extends cu{constructor(e){super(e,{code:g_.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(g_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class ohe extends yl{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const ahe="modulepreload",che=function(n){return"/"+n},Zz={},It=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){let o=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=o(t.map(u=>{if(u=che(u),u in Zz)return;Zz[u]=!0;const d=u.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":ahe,d||(m.as="script"),m.crossOrigin="",m.href=u,c&&m.setAttribute("nonce",c),document.head.appendChild(m),d)return new Promise((w,y)=>{m.addEventListener("load",w),m.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};class e$ extends Vf{constructor({cause:e,message:t}={}){var i;const r=(i=t==null?void 0:t.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(e$,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(e$,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});function lhe(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(t>>i&s),a=Number(t&s),c=r?4:0,u=r?0:4;n.setUint32(e+c,o,r),n.setUint32(e+u,a,r)}function uhe(n,e,t){return n&e^~n&t}function dhe(n,e,t){return n&e^n&t^e&t}
vendor: 4,153 bytes, line 52
52class tJ extends ZL{constructor(e,t,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=vk(this.buffer)}update(e){cx(this),e=R8(e),nu(e);const{view:t,buffer:r,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=vk(e);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){cx(this),YX(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;t[o++]=128,h0(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let f=o;f<i;f++)t[f]=0;lhe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=vk(e),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++)a.setUint32(4*f,d[f],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=s,e.length=i,e.pos=a,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const Am=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ka=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),hhe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Sm=new Uint32Array(64);class fhe extends tJ{constructor(e=32){super(64,e,8,!1),this.A=Am[0]|0,this.B=Am[1]|0,this.C=Am[2]|0,this.D=Am[3]|0,this.E=Am[4]|0,this.F=Am[5]|0,this.G=Am[6]|0,this.H=Am[7]|0}get(){const{A:e,B:t,C:r,D:i,E:s,F:o,G:a,H:c}=this;return[e,t,r,i,s,o,a,c]}set(e,t,r,i,s,o,a,c){this.A=e|0,this.B=t|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let f=0;f<16;f++,t+=4)Sm[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){const m=Sm[f-15],w=Sm[f-2],y=Qh(m,7)^Qh(m,18)^m>>>3,b=Qh(w,17)^Qh(w,19)^w>>>10;Sm[f]=b+Sm[f-7]+y+Sm[f-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const m=Qh(a,6)^Qh(a,11)^Qh(a,25),w=d+m+uhe(a,c,u)+hhe[f]+Sm[f]|0,b=(Qh(r,2)^Qh(r,13)^Qh(r,22))+dhe(r,i,s)|0;d=u,u=c,c=a,a=o+w|0,o=s,s=i,i=r,r=w+b|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,i,s,o,a,c,u,d)}roundClean(){h0(Sm)}destroy(){this.set(0,0,0,0,0,0,0,0),h0(this.buffer)}}const nJ=qX(["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","0x27b70a854
526d22ffc","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(n=>BigInt(n))),phe=nJ[0],ghe=nJ[1],_m=new Uint32Array(80),Cm=new Uint32Array(80);class mhe extends tJ{constructor(e=64){super(128,e,16,!1),this.Ah=ka[0]|0,this.Al=ka[1]|0,this.Bh=ka[2]|0,this.Bl=ka[3]|0,this.Ch=ka[4]|0,this.Cl=ka[5]|0,this.Dh=ka[6]|0,this.Dl=ka[7]|0,this.Eh=ka[8]|0,this.El=ka[9]|0,this.Fh=ka[10]|0,this.Fl=ka[11]|0,this.Gh=ka[12]|0,this.Gl=ka[13]|0,this.Hh=ka[14]|0,this.Hl=ka[15]|0}get(){const{Ah:e,Al:t,Bh:r,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:d,Fh:f,Fl:m,Gh:w,Gl:y,Hh:b,Hl:E}=this;return[e,t,r,i,s,o,a,c,u,d,f,m,w,y,b,E]}set(e,t,r,i,s,o,a,c,u,d,f,m,w,y,b,E){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=m|0,this.Gh=w|0,this.Gl=y|0,this.Hh=b|0,this.Hl=E|0}process(e,t){for(let I=0;I<16;I++,t+=4)_m[I]=e.getUint32(t),Cm[I]=e.getUint32(t+=4);for(let I=16;I<80;I++){const H=_m[I-15]|0,L=Cm[I-15]|0,U=zv(H,L,1)^zv(H,L,8)^Wz(H,L,7),K=Fv(H,L,1)^Fv(H,L,8)^Hz(H,L,7),Y=_m[I-2]|0,k=Cm[I-2]|0,j=zv(Y,k,19)^GT(Y,k,61)^Wz(Y,k,6),V=Fv(Y,k,19)^ZT(Y,k,61)^Hz(Y,k,6),W=$de(K,V,Cm[I-7],Cm[I-16]),$=Ude(W,U,j,_m[I-7],_m[I-16]);_m[I]=$|0,Cm[I]=W|0}let{Ah:r,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:u,Dl:d,Eh:f,El:m,Fh:w,Fl:y,Gh:b,Gl:E,Hh:T,Hl:N}=this;for(let I=0;I<80;I++){const H=zv(f,m,14)^zv(f,m,18)^GT(f,m,41),L=Fv(f,m,14)^Fv(f,m,18)^ZT(f,m,41),U=f&w^~f&b,K=m&y^~m&E,Y=jde(N,L,K,ghe[I],Cm[I]),k=zde(Y,T,H,U,phe[I],_m[I]),j=Y|0,V=zv(r,i,28)^GT(r,i,34)^GT(r,i,39),W=Fv(r,i,28)^ZT(r,i,34)^ZT(r,i,39),$=r&s^r&a^s&a,A=i&o^i&c^o&c;T=b|0,N=E|0,b=w|0,E=y|0,w=f|0,y=m|0,{h:f,l:m}=Np(u|0,d|0,k|0,j|0),u=a|0,d=c|0,a=s|0,c=o|0,s=r|0,o=i|0;const _=Bde(j,W,A);r=Lde(_,k,V,$),i=_|0}({h:r,l:i}=Np(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:o}=Np(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=Np(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l:d}=Np(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:m}=Np(this.Eh|0,this.El|0,f|0,m|0),{h:w,l:y}=Np(this.Fh|0,this.Fl|0,w|0,y|0),{h:b,l:E}=Np(this.Gh|0,this.Gl|0,b|0,E|0),{h:T,l:N}=Np(this.Hh|0,this.Hl|0,T|0,N|0),this.set(r,i,s,o,a,c,u,d,f,m,w,y,b,E,T,N)}roundClean(){h0(_m,Cm)}destroy(){h0(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const t$=QL(()=>new fhe),rJ=QL(()=>new mhe),U6=t$;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const n$=BigInt(0),DD=BigInt(1);function o1(n,e=""){if(typeof n!="boolean"){const t=e&&`"${e}"`;throw new Error(t+"expected boolean, got type="+typeof n)}return n}function Hd(n,e,t=""){const r=z1(n),i=n==null?void 0:n.length,s=e!==void 0;if(!r||s&&i!==e){const o=t&&`"${t}" `,a=s?` of length ${e}`:"",c=r?`length=${i}`:`type=${typeof n}`;throw new Error(o+"expected Uint8Array"+a+", got "+c)}return n}function QT(n){const e=n.toString(16);return e.length&1?"0"+e:e}function iJ(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?n$:BigInt("0x"+n)}function M8(n){return iJ(Jl(n))}function m_(n){return nu(n),iJ(Jl(Uint8Array.from(n).reverse()))}function r$(n,e){return s1(n.toString(16).padStart(e*2,"0"))}function sJ(n,e){return r$(n,e).reverse()}function Ms(n,e,t){let r;if(typeof e=="string")try{r=s1(e)}catch(s){throw new Error(n+" must be hex string or Uint8Array, cause: "+s)}else if(z1(e))r=Uint8Array.from(e);else throw new Error(n+" must be hex string or Uint8Array");const i=r.length;if(typeof t=="number"&&i!==t)throw new Error(n+" of length "+t+" expected, got "+i);return r}function Qz(n){return Uint8Array.from(n)}const xk=n=>typeof n=="bigint"&&n$<=n;function whe(n,e,t){return xk(n)&&xk(e)&&xk(t)&&e<=n&&n<t}function BD(n,e,t,r){if(!whe(e,t,r))throw new Error("expected valid "+n+": "+t+" <= n < "+r+", got "+e)}function oJ(n){let e;for(e=0;
52n>n$;n>>=DD,e+=1);return e}const kC=n=>(DD<<BigInt(n))-DD;function yhe(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");const r=w=>new Uint8Array(w),i=w=>Uint8Array.of(w);let s=r(n),o=r(n),a=0;const c=()=>{s.fill(1),o.fill(0),a=0},u=(...w)=>t(o,s,...w),d=(w=r(0))=>{o=u(i(0),w),s=u(),w.length!==0&&(o=u(i(1),w),s=u())},f=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const y=[];for(;w<e;){s=u();const b=s.slice();y.push(b),w+=s.length}return vo(...y)};return(w,y)=>{c(),d(w);let b;for(;!(b=y(f()));)d();return c(),b}}function OC(n,e,t={}){if(!n||typeof n!="object")throw new Error("expected valid options object");function r(i,s,o){const a=n[i];if(o&&a===void 0)return;const c=typeof a;if(c!==s||a===null)throw new Error(`param "${i}" is invalid: expected ${s}, got ${c}`)}Object.entries(e).forEach(([i,s])=>r(i,s,!1)),Object.entries(t).forEach(([i,s])=>r(i,s,!0))}function j6(n){const e=new WeakMap;return(t,...r)=>{const i=e.get(t);if(i!==void 0)return i;const s=n(t,...r);return e.set(t,s),s}}function bhe(){let n=()=>{},e=()=>{};return{promise:new Promise((r,i)=>{n=r,e=i}),resolve:n,reject:e}}const Ek=new Map;function vhe({fn:n,id:e,shouldSplitBatch:t,wait:r=0,sort:i}){const s=async()=>{const d=c();o();const f=d.map(({args:m})=>m);f.length!==0&&n(f).then(m=>{i&&Array.isArray(m)&&m.sort(i);for(let w=0;w<d.length;w++){const{resolve:y}=d[w];y==null||y([m[w],m])}}).catch(m=>{for(let w=0;w<d.length;w++){const{reject:y}=d[w];y==null||y(m)}})},o=()=>Ek.delete(e),a=()=>c().map(({args:d})=>d),c=()=>Ek.get(e)||[],u=d=>Ek.set(e,[...c(),d]);return{flush:o,async schedule(d){const{promise:f,resolve:m,reject:w}=bhe();return(t==null?void 0:t([...a(),d]))&&s(),c().length>0?(u({args:d,resolve:m,reject:w}),f):(u({args:d,resolve:m,reject:w}),setTimeout(s,r),f)}}}async function aJ(n){return new Promise(e=>setTimeout(e,n))}function xhe(n,{delay:e=100,retryCount:t=2,shouldRetry:r=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:u})=>{const d=typeof e=="function"?e({count:a,error:u}):e;d&&await aJ(d),o({count:a+1})};try{const u=await n();i(u)}catch(u){if(a<t&&await r({count:a,error:u}))return c({error:u});s(u)}};o()})}const LD=256;let XT=LD,JT;function Ehe(n=11){if(!JT||XT+n>LD*2){JT="",XT=0;for(let e=0;e<LD;e++)JT+=(256+Math.random()*256|0).toString(16).substring(1)}return JT.substring(XT,XT+++n)}const eI=new rhe(8192);function Ahe(n,{enabled:e=!0,id:t}){if(!e||!t)return n();if(eI.get(t))return eI.get(t);const r=n().finally(()=>eI.delete(t));return eI.set(t,r),r}function She(n,e={}){return async(t,r={})=>{var f;const{dedupe:i=!1,methods:s,retryDelay:o=150,retryCount:a=3,uid:c}={...e,...r},{method:u}=t;if((f=s==null?void 0:s.exclude)!=null&&f.includes(u))throw new Sy(new Error("method not supported"),{method:u});if(s!=null&&s.include&&!s.include.includes(u))throw new Sy(new Error("method not supported"),{method:u});const d=i?VX(`${c}.${Ky(t)}`):void 0;return Ahe(()=>xhe(async()=>{try{return await n(t)}catch(m){const w=m;switch(w.code){case ZS.code:throw new ZS(w);case QS.code:throw new QS(w);case XS.code:throw new XS(w,{method:t.method});case JS.code:throw new JS(w);case lx.code:throw new lx(w);case e_.code:throw new e_(w);case t_.code:throw new t_(w);case n_.code:throw new n_(w);case ux.code:throw new ux(w);case Sy.code:throw new Sy(w,{method:t.method});case dx.code:throw new dx(w);case r_.code:throw new r_(w);case Yy.code:throw new Yy(w);case i_.code:throw new i_(w);case s_.code:throw new s_(w);case o_.code:throw new o_(w);case a_.code:throw new a_(w);case c_.code:throw new c_(w);case l_.code:throw new l_(w);case u_.code:throw new u_(w);case d_.code:throw new d_(w);case h_.code:throw new h_(w);case f_.code:throw new f_(w);case p_.code:throw new p_(w);case g_.code:throw new g_(w);case 5e3:throw new Yy(w);default:throw m instanceof Vf?m:new ohe(w)}}},{delay:({count:m,error:w})=>{var y;if(w&&w instanceof uS){const b=(y=w==null?void 0:w.headers)==null?void 0:y.get("Retry-After");if(b!=null&&b.match(/\d/))return Number.parseInt(b)*1e3}return~~(1<<m)*o},retryCount:a,shouldRetry:({error:m})=>_he(m)}),{enabled:i,id:d})}}function _he(n){return"code"in n&&typeof n.code=="number"?n.code===-1||n.c
52ode===dx.code||n.code===lx.code:n instanceof uS&&n.status?n.status===403||n.status===408||n.status===413||n.status===429||n.status===500||n.status===502||n.status===503||n.status===504:!0}function cJ({key:n,methods:e,name:t,request:r,retryCount:i=3,retryDelay:s=150,timeout:o,type:a},c){const u=Ehe();return{config:{key:n,methods:e,name:t,request:r,retryCount:i,retryDelay:s,timeout:o,type:a},request:She(r,{methods:e,retryCount:i,retryDelay:s,uid:u}),value:c}}function Xz(n,e={}){const{key:t="fallback",name:r="Fallback",rank:i=!1,shouldThrow:s=Che,retryCount:o,retryDelay:a}=e;return({chain:c,pollingInterval:u=4e3,timeout:d,...f})=>{let m=n,w=()=>{};const y=cJ({key:t,name:r,async request({method:b,params:E}){let T;const N=async(I=0)=>{const H=m[I]({...f,chain:c,retryCount:0,timeout:d});try{const L=await H.request({method:b,params:E});return w({method:b,params:E,response:L,transport:H,status:"success"}),L}catch(L){if(w({error:L,method:b,params:E,transport:H,status:"error"}),s(L)||I===m.length-1||(T??(T=m.slice(I+1).some(U=>{const{include:K,exclude:Y}=U({chain:c}).config.methods||{};return K?K.includes(b):Y?!Y.includes(b):!0})),!T))throw L;return N(I+1)}};return N()},retryCount:o,retryDelay:a,type:"fallback"},{onResponse:b=>w=b,transports:m.map(b=>b({chain:c,retryCount:0}))});if(i){const b=typeof i=="object"?i:{};The({chain:c,interval:b.interval??u,onTransports:E=>m=E,ping:b.ping,sampleCount:b.sampleCount,timeout:b.timeout,transports:m,weights:b.weights})}return y}}function Che(n){return!!("code"in n&&typeof n.code=="number"&&(n.code===ux.code||n.code===Yy.code||e$.nodeMessage.test(n.message)||n.code===5e3))}function The({chain:n,interval:e=4e3,onTransports:t,ping:r,sampleCount:i=10,timeout:s=1e3,transports:o,weights:a={}}){const{stability:c=.7,latency:u=.3}=a,d=[],f=async()=>{const m=await Promise.all(o.map(async b=>{const E=b({chain:n,retryCount:0,timeout:s}),T=Date.now();let N,I;try{await(r?r({transport:E}):E.request({method:"net_listening"})),I=1}catch{I=0}finally{N=Date.now()}return{latency:N-T,success:I}}));d.push(m),d.length>i&&d.shift();const w=Math.max(...d.map(b=>Math.max(...b.map(({latency:E})=>E)))),y=o.map((b,E)=>{const T=d.map(U=>U[E].latency),I=1-T.reduce((U,K)=>U+K,0)/T.length/w,H=d.map(U=>U[E].success),L=H.reduce((U,K)=>U+K,0)/H.length;return L===0?[0,E]:[u*I+c*L,E]}).sort((b,E)=>E[0]-b[0]);t(y.map(([,b])=>o[b])),await aJ(e),f()};f()}class Ihe extends Vf{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 Nhe(n,{errorInstance:e=new Error("timed out"),timeout:t,signal:r}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;t>0&&(o=setTimeout(()=>{r&&a.abort()},t)),i(await n({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function Rhe(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Jz=Rhe();function Mhe(n,e={}){return{async request(t){var f;const{body:r,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:o=e.timeout??1e4}=t,a={...e.fetchOptions??{},...t.fetchOptions??{}},{headers:c,method:u,signal:d}=a;try{const m=await Nhe(async({signal:y})=>{const b={...a,body:Array.isArray(r)?Ky(r.map(I=>({jsonrpc:"2.0",id:I.id??Jz.take(),...I}))):Ky({jsonrpc:"2.0",id:r.id??Jz.take(),...r}),headers:{"Content-Type":"application/json",...c},method:u||"POST",signal:d||(o>0?y:null)},E=new Request(n,b),T=await(i==null?void 0:i(E,b))??{...b,url:n};return await fetch(T.url??n,T)},{errorInstance:new Gz({body:r,url:n}),timeout:o,signal:!0});s&&await s(m);let w;if((f=m.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))w=await m.json();else{w=await m.text();try{w=JSON.parse(w||"{}")}catch(y){if(m.ok)throw y;w={error:w}}}if(!m.ok)throw new uS({body:r,details:Ky(w.error)||m.statusText,headers:m.headers,status:m.status,url:n});return w}catch(m){throw m instanceof uS||m instanceof Gz?m:new uS({body:r,cause:m,url:n})}}}}function tI(n,e={}){const{batch:t,fetchOptions:r,key:i="http",methods:s,name:o="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:c,retryDelay:u,raw:d}=e;return({chain:f,retryCount:m,timeout:w})=>{const{batchSize:y=1e3,wait:b=0}=typeof t=="object"?t:{},E=e.retryCount??m,T=w??e.timeout??1e4,N=n||(f==null?void 0:f.rpcUrls.default.http[0]);if(!N)throw new Ihe;const I=Mhe(N,{fetchOptions:r,onRequest:a,onResponse:c,timeout:T});return cJ({key:i,methods:s,name:o,async request({method:H,params:L}){const U={method:H,params:L},{schedule:K}=vhe({id:N,wait:b,shouldSplitBatch(V){return V.length>y},fn:V=>I.request({body:V}),sort:(V,W)=>V.id-W.id}),Y=async V=>t?K(V):[await I.request({body:V})],[{error:k,result:j}]=await Y(U);if(d)return{error:k,result:j};if(k)throw new eJ({body:U,error:k,url:N});return j},retryCount:E,retryDelay:u,timeout:T,type:"http"},{fetchOptions:r,url:N}
52)}}class lJ extends ZL{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,KX(e);const r=R8(t);if(this.iHash=e.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 i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),h0(s)}update(e){return cx(this),this.iHash.update(e),this}digestInto(e){cx(this),nu(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const i$=(n,e,t)=>new lJ(n,e).update(t).digest();i$.create=(n,e)=>new lJ(n,e);const Ak={createBalance(n,e){const t={name:n.metadata.name||"",symbol:n.metadata.symbol||"",decimals:n.metadata.decimals||0,value:n.metadata.value||0,price:n.metadata.price||0,iconUrl:n.metadata.iconUrl||""};return{name:t.name,symbol:t.symbol,chainId:e,address:n.address==="native"?void 0:this.convertAddressToCAIP10Address(n.address,e),value:t.value,price:t.price,quantity:{decimals:t.decimals.toString(),numeric:this.convertHexToBalance({hex:n.balance,decimals:t.decimals})},iconUrl:t.iconUrl}},convertHexToBalance({hex:n,decimals:e}){return ihe(BigInt(n),e)},convertAddressToCAIP10Address(n,e){return`${e}:${n}`},createCAIP2ChainId(n,e){return`${e}:${parseInt(n,16)}`},getChainIdHexFromCAIP2ChainId(n){const e=n.split(":");if(e.length<2||!e[1])return"0x0";const t=e[1],r=parseInt(t,10);return isNaN(r)?"0x0":`0x${r.toString(16)}`},isWalletGetAssetsResponse(n){return typeof n!="object"||n===null?!1:Object.values(n).every(e=>Array.isArray(e)&&e.every(t=>this.isValidAsset(t)))},isValidAsset(n){return typeof n=="object"&&n!==null&&typeof n.address=="string"&&typeof n.balance=="string"&&(n.type==="ERC20"||n.type==="NATIVE")&&typeof n.metadata=="object"&&n.metadata!==null&&typeof n.metadata.name=="string"&&typeof n.metadata.symbol=="string"&&typeof n.metadata.decimals=="number"&&typeof n.metadata.price=="number"&&typeof n.metadata.iconUrl=="string"}},s$={async getMyTokensWithBalance(n){const e=_t.state.address,t=ue.state.activeCaipNetwork,r=Ge.getConnectorId("eip155")===Be.CONNECTOR_ID.AUTH;if(!e||!t)return[];const i=`${t.caipNetworkId}:${e}`,s=wt.getBalanceCacheForCaipAddress(i);if(s)return s.balances;if(t.chainNamespace===Be.CHAIN.EVM&&r){const a=await this.getEIP155Balances(e,t);if(a)return this.filterLowQualityTokens(a)}const o=await Vn.getBalance(e,t.caipNetworkId,n);return this.filterLowQualityTokens(o.balances)},async getEIP155Balances(n,e){var t,r;try{const i=Ak.getChainIdHexFromCAIP2ChainId(e.caipNetworkId),s=await nt.getCapabilities(n);if(!((r=(t=s==null?void 0:s[i])==null?void 0:t.assetDiscovery)!=null&&r.supported))return null;const o=await nt.walletGetAssets({account:n,chainFilter:[i]});if(!Ak.isWalletGetAssetsResponse(o))return null;const c=(o[i]||[]).map(u=>Ak.createBalance(u,e.caipNetworkId));return wt.updateBalanceCache({caipAddress:`${e.caipNetworkId}:${n}`,balance:{balances:c},timestamp:Date.now()}),c}catch{return null}},filterLowQualityTokens(n){return n.filter(e=>e.quantity.decimals!=="0")}},Xh=Mi({currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map}),khe={state:Xh,replaceState(n){n&&Object.assign(Xh,d0(n))},subscribe(n){return ue.subscribeChainProp("accountState",e=>{if(e)return n(e)})},subscribeKey(n,e,t){let r;return ue.subscribeChainProp("accountState",i=>{if(i){const s=i[n];r!==s&&(r=s,e(s))}},t)},setStatus(n,e){ue.setAccountProp("status",n,e)},getCaipAddress(n){var e,t;if(n)return(t=(e=ue.state.chains.get(n))==null?void 0:e.accountState)==null?void 0:t.caipAddress},setCaipAddress(n,e){const t=n?tt.getPlainAddress(n):void 0;
52e===ue.state.activeChain&&(ue.state.activeCaipAddress=n),ue.setAccountProp("caipAddress",n,e),ue.setAccountProp("address",t,e)},setBalance(n,e,t){ue.setAccountProp("balance",n,t),ue.setAccountProp("balanceSymbol",e,t)},setProfileName(n,e){ue.setAccountProp("profileName",n,e)},setProfileImage(n,e){ue.setAccountProp("profileImage",n,e)},setUser(n,e){ue.setAccountProp("user",n,e)},setAddressExplorerUrl(n,e){ue.setAccountProp("addressExplorerUrl",n,e)},setSmartAccountDeployed(n,e){ue.setAccountProp("smartAccountDeployed",n,e)},setCurrentTab(n){ue.setAccountProp("currentTab",n,ue.state.activeChain)},setTokenBalance(n,e){n&&ue.setAccountProp("tokenBalance",n,e)},setShouldUpdateToAddress(n,e){ue.setAccountProp("shouldUpdateToAddress",n,e)},addAddressLabel(n,e,t){var i,s;if(!t)return;const r=((s=(i=ue.state.chains.get(t))==null?void 0:i.accountState)==null?void 0:s.addressLabels)||new Map;r.set(n,e),ue.setAccountProp("addressLabels",r,t)},removeAddressLabel(n,e){var r,i;if(!e)return;const t=((i=(r=ue.state.chains.get(e))==null?void 0:r.accountState)==null?void 0:i.addressLabels)||new Map;t.delete(n),ue.setAccountProp("addressLabels",t,e)},setConnectedWalletInfo(n,e){ue.setAccountProp("connectedWalletInfo",n,e,!1)},setPreferredAccountType(n,e){ue.setAccountProp("preferredAccountType",n,e)},setSocialProvider(n,e){n&&ue.setAccountProp("socialProvider",n,e)},setSocialWindow(n,e){ue.setAccountProp("socialWindow",n?d0(n):void 0,e)},setFarcasterUrl(n,e){ue.setAccountProp("farcasterUrl",n,e)},async fetchTokenBalance(n){var s,o;Xh.balanceLoading=!0;const e=(s=ue.state.activeCaipNetwork)==null?void 0:s.caipNetworkId,t=(o=ue.state.activeCaipNetwork)==null?void 0:o.chainNamespace,r=ue.state.activeCaipAddress,i=r?tt.getPlainAddress(r):void 0;if(Xh.lastRetry&&!tt.isAllowedRetry(Xh.lastRetry,30*sr.ONE_SEC_MS))return Xh.balanceLoading=!1,[];try{if(i&&e&&t){const a=await s$.getMyTokensWithBalance();return _t.setTokenBalance(a,t),Xh.lastRetry=void 0,Xh.balanceLoading=!1,a}}catch(a){Xh.lastRetry=Date.now(),n==null||n(a),Ir.showError("Token Balance Unavailable")}finally{Xh.balanceLoading=!1}return[]},resetAccount(n){ue.resetAccount(n)}},_t=wl(khe),uJ={onSwitchNetwork({network:n,ignoreSwitchConfirmation:e=!1}){const t=ue.state.activeCaipNetwork,r=it.state.data;if(n.id===(t==null?void 0:t.id))return;const s=_t.getCaipAddress(ue.state.activeChain),o=n.chainNamespace!==ue.state.activeChain,a=_t.getCaipAddress(n.chainNamespace),u=Ge.getConnectorId(ue.state.activeChain)===Be.CONNECTOR_ID.AUTH,d=Be.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(f=>f===n.chainNamespace);e||u&&d?it.push("SwitchNetwork",{...r,network:n}):s&&o&&!a?it.push("SwitchActiveChain",{switchToChain:n.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:n}):it.push("SwitchNetwork",{...r,network:n})}},Yc=Mi({loading:!1,loadingNamespaceMap:new Map,open:!1,shake:!1,namespace:void 0}),Ohe={state:Yc,subscribe(n){return Qs(Yc,()=>n(Yc))},subscribeKey(n,e){return Eo(Yc,n,e)},async open(n){var s,o;const e=n==null?void 0:n.namespace,t=ue.state.activeChain,r=e&&e!==t,i=(s=ue.getAccountData(n==null?void 0:n.namespace))==null?void 0:s.caipAddress;if(nt.state.wcBasic?Ft.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1}):await Ft.prefetch(),Ge.setFilterByNamespace(n==null?void 0:n.namespace),Yn.setLoading(!0,e),e&&r){const a=((o=ue.getNetworkData(e))==null?void 0:o.caipNetwork)||ue.getRequestedCaipNetworks(e)[0];a&&uJ.onSwitchNetwork({network:a,ignoreSwitchConfirmation:!0})}
52else{const a=ue.state.noAdapters;Ue.state.manualWCControl||a&&!i?tt.isMobile()?it.reset("AllWallets"):it.reset("ConnectingWalletConnectBasic"):n!=null&&n.view?it.reset(n.view,n.data):i?it.reset("Account"):it.reset("Connect")}Yc.open=!0,Wd.set({open:!0}),xn.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!i}})},close(){const n=Ue.state.enableEmbedded,e=!!ue.state.activeCaipAddress;Yc.open&&xn.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:e}}),Yc.open=!1,it.reset("Connect"),Yn.clearLoading(),n?e?it.replace("Account"):it.push("Connect"):Wd.set({open:!1}),nt.resetUri()},setLoading(n,e){e&&Yc.loadingNamespaceMap.set(e,n),Yc.loading=n,Wd.set({loading:n})},clearLoading(){Yc.loadingNamespaceMap.clear(),Yc.loading=!1,Wd.set({loading:!1})},shake(){Yc.shake||(Yc.shake=!0,setTimeout(()=>{Yc.shake=!1},500))}},Yn=wl(Ohe),dS={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},$D={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},Phe={providers:BX,selectedProvider:null,error:null,purchaseCurrency:dS,paymentCurrency:$D,purchaseCurrencies:[dS],paymentCurrencies:[],quotesLoading:!1},Qr=Mi(Phe),Dhe={state:Qr,subscribe(n){return Qs(Qr,()=>n(Qr))},subscribeKey(n,e){return Eo(Qr,n,e)},setSelectedProvider(n){var e,t;if(n&&n.name==="meld"){const r=ue.state.activeChain,i=r===Be.CHAIN.SOLANA?"SOL":"USDC",s=r?((t=(e=ue.state.chains.get(r))==null?void 0:e.accountState)==null?void 0:t.address)??"":"",o=new URL(n.url);o.searchParams.append("publicKey",Hue),o.searchParams.append("destinationCurrencyCode",i),o.searchParams.append("walletAddress",s),o.searchParams.append("externalCustomerId",Ue.state.projectId),Qr.selectedProvider={...n,url:o.toString()}}else Qr.selectedProvider=n},setOnrampProviders(n){if(Array.isArray(n)&&n.every(e=>typeof e=="string")){const e=n,t=BX.filter(r=>e.includes(r.name));Qr.providers=t}else Qr.providers=[]},setPurchaseCurrency(n){Qr.purchaseCurrency=n},setPaymentCurrency(n){Qr.paymentCurrency=n},setPurchaseAmount(n){UD.state.purchaseAmount=n},setPaymentAmount(n){UD.state.paymentAmount=n},async getAvailableCurrencies(){const n=await Vn.getOnrampOptions();Qr.purchaseCurrencies=n.purchaseCurrencies,Qr.paymentCurrencies=n.paymentCurrencies,Qr.paymentCurrency=n.paymentCurrencies[0]||$D,Qr.purchaseCurrency=n.purchaseCurrencies[0]||dS,await Ft.fetchCurrencyImages(n.paymentCurrencies.map(e=>e.id)),await Ft.fetchTokenImages(n.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){var n,e;Qr.quotesLoading=!0;try{const t=await Vn.getOnrampQuote({purchaseCurrency:Qr.purchaseCurrency,paymentCurrency:Qr.paymentCurrency,amount:((n=Qr.paymentAmount)==null?void 0:n.toString())||"0",network:(e=Qr.purchaseCurrency)==null?void 0:e.symbol});return Qr.quotesLoading=!1,Qr.purchaseAmount=Number(t==null?void 0:t.purchaseAmount.amount),t}catch(t){return Qr.error=t.message,Qr.quotesLoading=!1,null}finally{Qr.quotesLoading=!1}},resetState(){Qr.selectedProvider=null,Qr.error=null,Qr.purchaseCurrency=dS,Qr.paymentCurrency=$D,Qr.purchaseCurrencies=[dS],Qr.paymentCurrencies=[],Qr.paymentAmount=void 0,Qr.purchaseAmount=void 0,Qr.quotesLoading=!1}},UD=wl(Dhe),Md=Mi({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),Bhe={state:Md,subscribe(n){return Qs(Md,()=>n(Md))},subscribeKey(n,e){return Eo(Md,n,e)},showTooltip({message:n,triggerRect:e,variant:t}){Md.open=!0,Md.message=n,Md.triggerRect=e,Md.variant=t},hide(){Md.open=!1,Md.message="",Md.triggerRect={width:0,height:0,top:0,left:0}}},Vl=wl(Bhe),eF=2147483648,Lhe={convertEVMChainIdToCoinType(n){if(n>=eF)throw new Error("Invalid chainId");return(eF|n)>>>0}},Su=Mi({suggestions:[],loading:!1}),$he={state:Su,subscribe(n){return Qs(Su,()=>n(Su))},subscribeKey(n,e){return Eo(Su,n,e)},async resolveName(n){var e,t;try{return await Vn.lookupEnsName(n)}catch(r){const i=r;throw new Error(((t=(e=i==null?void 0:i.reasons)==null?void 0:e[0])==null?void 0:t.description)||"Error resolving name")}},async isNameRegistered(n){try{return await Vn.lookupEnsName(n),!0}catch{return!1}},async getSuggestions(n){try{Su.loading=!0,Su.suggestions=[];const e=await Vn.getEnsNameSuggestions(n);return Su.suggestions=e.suggestions.map(t=>({...t,name:t.name}))||[],Su.suggestions}catch(e){const t=hS.parseEnsApiError(e,"Error fetching name suggestions");throw new Error(t)}finally{Su.loading=!1}},async getNamesForAddress(n){try{if(!ue.state.activeCaipNetwork)return[];
vendor: 7,165 bytes, line 52
52const t=wt.getEnsFromCacheForAddress(n);if(t)return t;const r=await Vn.reverseLookupEnsName({address:n});return wt.updateEnsCache({address:n,ens:r,timestamp:Date.now()}),r}catch(e){const t=hS.parseEnsApiError(e,"Error fetching names for address");throw new Error(t)}},async registerName(n){const e=ue.state.activeCaipNetwork,t=_t.state.address,r=Ge.getAuthConnector();if(!e)throw new Error("Network not found");if(!t||!r)throw new Error("Address or auth connector not found");Su.loading=!0;try{const i=JSON.stringify({name:n,attributes:{},timestamp:Math.floor(Date.now()/1e3)});it.pushTransactionStack({onCancel(){it.replace("RegisterAccountName")}});const s=await nt.signMessage(i);Su.loading=!1;const o=e.id;if(!o)throw new Error("Network not found");const a=Lhe.convertEVMChainIdToCoinType(Number(o));await Vn.registerEnsName({coinType:a,address:t,signature:s,message:i}),_t.setProfileName(n,e.chainNamespace),it.replace("RegisterAccountNameSuccess")}catch(i){const s=hS.parseEnsApiError(i,`Error registering name ${n}`);throw it.replace("RegisterAccountName"),new Error(s)}finally{Su.loading=!1}},validateName(n){return/^[a-zA-Z0-9-]{4,}$/u.test(n)},parseEnsApiError(n,e){var r,i;const t=n;return((i=(r=t==null?void 0:t.reasons)==null?void 0:r[0])==null?void 0:i.description)||e}},hS=wl($he),hA=Mi({isLegalCheckboxChecked:!1}),Gy={state:hA,subscribe(n){return Qs(hA,()=>n(hA))},subscribeKey(n,e){return Eo(hA,n,e)},setIsLegalCheckboxChecked(n){hA.isLegalCheckboxChecked=n}};var nI={exports:{}},tF;function Uhe(){if(tF)return nI.exports;tF=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(L,U,K){return Function.prototype.apply.call(L,U,K)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(L){return Object.getOwnPropertyNames(L).concat(Object.getOwnPropertySymbols(L))}:t=function(L){return Object.getOwnPropertyNames(L)};function r(H){console&&console.warn&&console.warn(H)}var i=Number.isNaN||function(L){return L!==L};function s(){s.init.call(this)}nI.exports=s,nI.exports.once=T,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(H){if(typeof H!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof H)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(H){if(typeof H!="number"||H<0||i(H))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+H+".");o=H}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(L){if(typeof L!="number"||L<0||i(L))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+L+".");return this._maxListeners=L,this};function c(H){return H._maxListeners===void 0?s.defaultMaxListeners:H._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(L){for(var U=[],K=1;K<arguments.length;K++)U.push(arguments[K]);var Y=L==="error",k=this._events;if(k!==void 0)Y=Y&&k.error===void 0;else if(!Y)return!1;if(Y){var j;if(U.length>0&&(j=U[0]),j instanceof Error)throw j;var V=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw V.context=j,V}var W=k[L];if(W===void 0)return!1;if(typeof W=="function")e(W,this,U);else for(var $=W.length,A=y(W,$),K=0;K<$;++K)e(A[K],this,U);return!0};function u(H,L,U,K){var Y,k,j;if(a(U),k=H._events,k===void 0?(k=H._events=Object.create(null),H._eventsCount=0):(k.newListener!==void 0&&(H.emit("newListener",L,U.listener?U.listener:U),k=H._events),j=k[L]),j===void 0)j=k[L]=U,++H._eventsCount;else if(typeof j=="function"?j=k[L]=K?[U,j]:[j,U]:K?j.unshift(U):j.push(U),Y=c(H),Y>0&&j.length>Y&&!j.warned){j.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(L)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=H,V.type=L,V.count=j.length,r(V)}return H}s.prototype.addListener=function(L,U){return u(this,L,U,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(L,U){return u(this,L,U,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(H,L,U){var K={fired:!1,wrapFn:void 0,target:H,type:L,listener:U},Y=d.bind(K);return Y.listener=U,K.wrapFn=Y,Y}s.prototype.once=function(L,U){return a(U),this.on(L,f(this,L,U)),this},s.prototype.prependOnceListener=function(L,U){return a(U),this.prependListener(L,f(this,L,U)),this},s.prototype.removeListener=function(L,U){var K,Y,k,j,V;if(a(U),Y=this._events,Y===void 0)return this;if(K=Y[L],K===void 0)return this;if(K===U||K.listener===U)--this._eventsCount===0?this._events=Object.create(null):(delete Y[L],Y.removeListener&&this.emit("removeListener",L,K.listener||U));else if(typeof K!="function"){for(k=-1,j=K.length-1;j>=0;j--)if(K[j]===U||K[j].listener===U){V=K[j].listener,k=j;break}if(k<0)return this;k===0?K.shift():b(K,k),K.length===1&&(Y[L]=K[0]),Y.removeListener!==void 0&&this.emit("removeListener",L,V||U)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(L){var U,K,Y;if(K=this._events,K===void 0)return this;if(K.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):K[L]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete K[L]),this;if(arguments.length===0){var k=Object.keys(K),j;for(Y=0;Y<k.length;++Y)j=k[Y],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(U=K[L],typeof U=="function")this.removeListener(L,U);else if(U!==void 0)for(Y=U.length-1;Y>=0;Y--)this.removeListener(L,U[Y]);return this};function m(H,L,U){var K=H._events;if(K===void 0)return[];var Y=K[L];return Y===void 0?[]:typeof Y=="function"?U?[Y.listener||Y]:[Y]:U?E(Y):y(Y,Y.length)}s.prototype.listeners=function(L){return m(this,L,!0)},s.prototype.rawListeners=function(L){return m(this,L,!1)},s.listenerCount=function(H,L){return typeof H.listenerCount=="function"?H.listenerCount(L):w.call(H,L)},s.prototype.listenerCount=w;function w(H){var L=this._events;if(L!==void 0){var U=L[H];if(typeof U=="function")return 1;if(U!==void 0)return U.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function y(H,L){for(var U=new Array(L),K=0;K<L;++K)U[K]=H[K];return U}function b(H,L){for(;L+1<H.length;L++)H[L]=H[L+1];H.pop()}function E(H){for(var L=new Array(H.length),U=0;U<L.length;++U)L[U]=H[U].listener||H[U];return L}function T(H,L){return new Promise(function(U,K){function Y(j){H.removeListener(L,k),K(j)}function k(){typeof H.removeListener=="function"&&H.removeListener("error",Y),U([].slice.call(arguments))}
vendor: 1,317 bytes, lines 52-65
52I(H,L,k,{once:!0}),L!=="error"&&N(H,Y,{once:!0})})}function N(H,L,U){typeof H.on=="function"&&I(H,"error",L,U)}function I(H,L,U,K){if(typeof H.on=="function")K.once?H.once(L,U):H.on(L,U);else if(typeof H.addEventListener=="function")H.addEventListener(L,function Y(k){K.once&&H.removeEventListener(L,Y),U(k)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof H)}return nI.exports}var Qu=Uhe();const o$=xo(Qu);var Sk={};/*! ***************************************************************************** 53Copyright (c) Microsoft Corporation. 54 55Permission to use, copy, modify, and/or distribute this software for any 56purpose with or without fee is hereby granted. 57 58THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 59REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 60AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 61INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 62LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 63OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 64PERFORMANCE OF THIS SOFTWARE. 65***************************************************************************** */var jD=function(n,e){return jD=Object.
vendor: 14,889 bytes, line 65
65setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},jD(n,e)};function jhe(n,e){jD(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var zD=function(){return zD=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},zD.apply(this,arguments)};function zhe(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function Fhe(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function Whe(n,e){return function(t,r){e(t,r,n)}}function Hhe(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function Vhe(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(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?s(d.value):i(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})}function qhe(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Khe(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function Yhe(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function FD(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function dJ(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function Ghe(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(dJ(arguments[e]));return n}function Zhe(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function w_(n){return this instanceof w_?(this.v=n,this):new w_(n)}function Qhe(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(m){r[m]&&(i[m]=function(w){return new Promise(function(y,b){s.push([m,w,y,b])>1||a(m,w)})})}function a(m,w){try{c(r[m](w))}catch(y){f(s[0][3],y)}}function c(m){m.value instanceof w_?Promise.resolve(m.value.v).then(u,d):f(s[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function f(m,w){m(w),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Xhe(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(o){return(t=!t)?{value:w_(n[i](o)),done:i==="return"}:s?s(o):o}:s}}function Jhe(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof FD=="function"?FD(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(a,c){o=n[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function efe(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function tfe(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}function nfe(n){return n&&n.__esModule?n:{default:n}}function rfe(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function ife(n,e,t){if(!e.has(n))throw new TypeError("attempted to set private field on non-instance");return e.set(n,t),t}const sfe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return zD},__asyncDelegator:Xhe,__asyncGenerator:Qhe,__asyncValues:Jhe,__await:w_,__awaiter:Vhe,__classPrivateFieldGet:rfe,__classPrivateFieldSet:ife,__createBinding:Khe,__decorate:Fhe,__exportStar:Yhe,__extends:jhe,__generator:qhe,__importDefault:nfe,__importStar:tfe,__makeTemplateObject:efe,__metadata:Hhe,__param:Whe,__read:dJ,__rest:zhe,__spread:Ghe,__spreadArrays:Zhe,__values:FD},Symbol.toStringTag,{value:"Module"})),k8=Vx(sfe);var _k={},fA={},nF;function ofe(){if(nF)return fA;nF=1,Object.defineProperty(fA,"__esModule",{value:!0}),fA.delay=void 0;function n(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return fA.delay=n,fA}var Jw={},Ck={},ey={},rF;function afe(){return rF||(rF=1,Object.defineProperty(ey,"__esModule",{value:!0}),ey.ONE_THOUSAND=ey.ONE_HUNDRED=void 0,ey.ONE_HUNDRED=100,ey.ONE_THOUSAND=1e3),ey}var Tk={},iF;function cfe(){return iF||(iF=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ONE_YEAR=n.FOUR_WEEKS=n.THREE_WEEKS=n.TWO_WEEKS=n.ONE_WEEK=n.THIRTY_DAYS=n.SEVEN_DAYS=n.FIVE_DAYS=n.THREE_DAYS=n.ONE_DAY=n.TWENTY_FOUR_HOURS=n.TWELVE_HOURS=n.SIX_HOURS=n.THREE_HOURS=n.ONE_HOUR=n.SIXTY_MINUTES=n.THIRTY_MINUTES=n.TEN_MINUTES=n.FIVE_MINUTES=n.ONE_MINUTE=n.SIXTY_SECONDS=n.THIRTY_SECONDS=n.TEN_SECONDS=n.FIVE_SECONDS=n.ONE_SECOND=void 0,n.ONE_SECOND=1,n.FIVE_SECONDS=5,n.TEN_SECONDS=10,n.THIRTY_SECONDS=30,n.SIXTY_SECONDS=60,n.ONE_MINUTE=n.SIXTY_SECONDS,n.FIVE_MINUTES=n.ONE_MINUTE*5,n.TEN_MINUTES=n.ONE_MINUTE*10,n.THIRTY_MINUTES=n.ONE_MINUTE*30,n.SIXTY_MINUTES=n.ONE_MINUTE*60,n.ONE_HOUR=n.SIXTY_MINUTES,n.THREE_HOURS=n.ONE_HOUR*3,n.SIX_HOURS=n.ONE_HOUR*6,n.TWELVE_HOURS=n.ONE_HOUR*12,n.TWENTY_FOUR_HOURS=n.ONE_HOUR*24,n.ONE_DAY=n.TWENTY_FOUR_HOURS,n.THREE_DAYS=n.ONE_DAY*3,n.FIVE_DAYS=n.ONE_DAY*5,n.SEVEN_DAYS=n.ONE_DAY*7,n.THIRTY_DAYS=n.ONE_DAY*30,n.ONE_WEEK=n.SEVEN_DAYS,n.TWO_WEEKS=n.ONE_WEEK*2,n.THREE_WEEKS=n.ONE_WEEK*3,n.FOUR_WEEKS=n.ONE_WEEK*4,n.ONE_YEAR=n.ONE_DAY*365}(Tk)),Tk}var sF;function hJ(){return sF||(sF=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});const e=k8;e.__exportStar(afe(),n),e.__exportStar(cfe(),n)}(Ck)),Ck}var oF;function lfe(){if(oF)return Jw;oF=1,Object.defineProperty(Jw,"__esModule",{value:!0}),Jw.fromMiliseconds=Jw.toMiliseconds=void 0;const n=hJ();function e(r){return r*n.ONE_THOUSAND}Jw.toMiliseconds=e;function t(r){return Math.floor(r/n.ONE_THOUSAND)}return Jw.fromMiliseconds=t,Jw}var aF;function ufe(){return aF||(aF=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});const e=k8;e.__exportStar(ofe(),n),e.__exportStar(lfe(),n)}(_k)),_k}var Hv={},cF;function dfe(){if(cF)return Hv;cF=1,Object.defineProperty(Hv,"__esModule",{value:!0}),Hv.Watch=void 0;class n{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const r=this.get(t);if(typeof r.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const i=Date.now()-r.started;this.timestamps.set(t,{started:r.started,elapsed:i})}get(t){const r=this.timestamps.get(t);if(typeof r>"u")throw new Error(`No timestamp found for label: ${t}`);return r}elapsed(t){const r=this.get(t);return r.elapsed||Date.now()-r.started}}return Hv.Watch=n,Hv.default=n,Hv}var Ik={},pA={},lF;function hfe(){if(lF)return pA;lF=1,Object.defineProperty(pA,"__esModule",{value:!0}),pA.IWatch=void 0;class n{}return pA.IWatch=n,pA}var uF;function ffe(){return uF||(uF=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),k8.__exportStar(hfe(),n)}(Ik)),Ik}var dF;function pfe(){return dF||(dF=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});const e=k8;e.__exportStar(ufe(),n),e.__exportStar(dfe(),n),e.__exportStar(ffe(),n),e.__exportStar(hJ(),n)}(Sk)),Sk}var Ht=pfe();class F1{}let gfe=class extends F1{constructor(e){super()}};const hF=Ht.FIVE_SECONDS,W1={pulse:"heartbeat_pulse"};let mfe=class fJ extends gfe{constructor(e){super(e),this.events=new Qu.EventEmitter,this.interval=hF,this.interval=(e==null?void 0:e.interval)||hF}static async init(e){const t=new fJ(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),Ht.toMiliseconds(this.interval))}pulse(){this.events.emit(W1.pulse)}};const wfe=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,yfe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,bfe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function vfe(n,e){if(n==="__proto__"||n==="constructor"&&e&&typeof e=="object"&&"prototype"in e){xfe(n);return}return e}function xfe(n){console.warn(`[destr] Dropping "${n}" key to prevent prototype pollution.`)}function rI(n,e={}){if(typeof n!="string")return n;if(n[0]==='"'&&n[n.length-1]==='"'&&n.indexOf("\\")===-1)return n.slice(1,-1);const t=n.trim();if(t.length<=9)switch(t.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!bfe.test(n)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return n}try{if(wfe.test(n)||yfe.test(n)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(n,vfe)}return JSON.parse(n)}catch(r){if(e.strict)throw r;return n}}function Efe(n){return!n||typeof n.then!="function"?Promise.resolve(n):n}function Ro(n,...e){try{return Efe(n(...e))}catch(t){return Promise.reject(t)}}function Afe(n){const e=typeof n;return n===null||e!=="object"&&e!=="function"}function Sfe(n){const e=Object.getPrototypeOf(n);return!e||e.isPrototypeOf(Object)}function l6(n){if(Afe(n))return String(n);if(Sfe(n)||Array.isArray(n))return JSON.stringify(n);if(typeof n.toJSON=="function")return l6(n.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const WD="base64:";function _fe(n){return typeof n=="string"?n:WD+Ife(n)}function Cfe(n){return typeof n!="string"||!n.startsWith(WD)?n:Tfe(n.slice(WD.length))}function Tfe(n){return globalThis.Buffer?pn.from(n,"base64"):Uint8Array.from(globalThis.atob(n),e=>e.codePointAt(0))}function Ife(n){return globalThis.Buffer?pn.from(n).toString("base64"):globalThis.btoa(String.fromCodePoint(...n))}function el(n){var e;return n&&((e=n.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function Nfe(...n){return el(n.join(":"))}function iI(n){return n=el(n),n?n+":":""}function Rfe(n,e){if(e===void 0)return!0;let t=0,r=n.indexOf(":");for(;r>-1;)t++,r=n.indexOf(":",r+1);return t<=e}function Mfe(n,e){return e?n.startsWith(e)&&n[n.length-1]!=="$":n[n.length-1]!=="$"}const kfe="memory",Ofe=()=>{const n=new Map;return{name:kfe,getInstance:()=>n,hasItem(e){return n.has(e)},getItem(e){return n.get(e)??null},getItemRaw(e){return n.get(e)??null},setItem(e,t){n.set(e,t)},setItemRaw(e,t){n.set(e,t)},removeItem(e){n.delete(e)},getKeys(){return[...n.keys()]},clear(){n.clear()},dispose(){n.clear()}}};function Pfe(n={}){const e={mounts:{"":n.driver||Ofe()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=u=>{for(const d of e.mountpoints)if(u.startsWith(d))return{base:d,relativeKey:u.slice(d.length),driver:e.mounts[d]};return{base:"",relativeKey:u,driver:e.mounts[""]}},r=(u,d)=>e.mountpoints.filter(f=>f.startsWith(u)||d&&u.startsWith(f)).map(f=>({relativeBase:u.length>f.length?u.slice(f.length):void 0,mountpoint:f,driver:e.mounts[f]})),i=(u,d)=>{if(e.watching){d=el(d);for(const f of e.watchListeners)f(u,d)}},s=async()=>{if(!e.watching){e.watching=!0;for(const u in e.mounts)e.unwatch[u]=await fF(e.mounts[u],i,u)}},o=async()=>{if(e.watching){for(const u in e.unwatch)await e.unwatch[u]();e.unwatch={},e.watching=!1}},a=(u,d,f)=>{const m=new Map,w=y=>{let b=m.get(y.base);return b||(b={driver:y.driver,base:y.base,items:[]},m.set(y.base,b)),b};for(const y of u){const b=typeof y=="string",E=el(b?y:y.key),T=b?void 0:y.value,N=b||!y.options?d:{...d,...y.options},I=t(E);w(I).items.push({key:E,value:T,relativeKey:I.relativeKey,options:N})}return Promise.all([...m.values()].map(y=>f(y))).then(y=>y.flat())},c={hasItem(u,d={}){u=el(u);const{relativeKey:f,driver:m}=t(u);return Ro(m.hasItem,f,d)},getItem(u,d={}){u=el(u);const{relativeKey:f,driver:m}=t(u);return Ro(m.getItem,f,d).then(w=>rI(w))},getItems(u,d={}){return a(u,d,f=>f.driver.getItems?Ro(f.driver.getItems,f.items.map(m=>({key:m.relativeKey,options:m.options})),d).then(m=>m.map(w=>({key:Nfe(f.base,w.key),value:rI(w.value)}))):Promise.all(f.items.map(m=>Ro(f.driver.getItem,m.relativeKey,m.options).then(w=>({key:m.key,value:rI(w)})))))},getItemRaw(u,d={}){u=el(u);const{relativeKey:f,driver:m}=t(u);return m.getItemRaw?Ro(m.getItemRaw,f,d):Ro(m.getItem,f,d).then(w=>Cfe(w))},async setItem(u,d,f={}){if(d===void 0)return c.removeItem(u);u=el(u);const{relativeKey:m,driver:w}=t(u);
vendor: 10,941 bytes, line 65
65w.setItem&&(await Ro(w.setItem,m,l6(d),f),w.watch||i("update",u))},async setItems(u,d){await a(u,d,async f=>{if(f.driver.setItems)return Ro(f.driver.setItems,f.items.map(m=>({key:m.relativeKey,value:l6(m.value),options:m.options})),d);f.driver.setItem&&await Promise.all(f.items.map(m=>Ro(f.driver.setItem,m.relativeKey,l6(m.value),m.options)))})},async setItemRaw(u,d,f={}){if(d===void 0)return c.removeItem(u,f);u=el(u);const{relativeKey:m,driver:w}=t(u);if(w.setItemRaw)await Ro(w.setItemRaw,m,d,f);else if(w.setItem)await Ro(w.setItem,m,_fe(d),f);else return;w.watch||i("update",u)},async removeItem(u,d={}){typeof d=="boolean"&&(d={removeMeta:d}),u=el(u);const{relativeKey:f,driver:m}=t(u);m.removeItem&&(await Ro(m.removeItem,f,d),(d.removeMeta||d.removeMata)&&await Ro(m.removeItem,f+"$",d),m.watch||i("remove",u))},async getMeta(u,d={}){typeof d=="boolean"&&(d={nativeOnly:d}),u=el(u);const{relativeKey:f,driver:m}=t(u),w=Object.create(null);if(m.getMeta&&Object.assign(w,await Ro(m.getMeta,f,d)),!d.nativeOnly){const y=await Ro(m.getItem,f+"$",d).then(b=>rI(b));y&&typeof y=="object"&&(typeof y.atime=="string"&&(y.atime=new Date(y.atime)),typeof y.mtime=="string"&&(y.mtime=new Date(y.mtime)),Object.assign(w,y))}return w},setMeta(u,d,f={}){return this.setItem(u+"$",d,f)},removeMeta(u,d={}){return this.removeItem(u+"$",d)},async getKeys(u,d={}){var E;u=iI(u);const f=r(u,!0);let m=[];const w=[];let y=!0;for(const T of f){(E=T.driver.flags)!=null&&E.maxDepth||(y=!1);const N=await Ro(T.driver.getKeys,T.relativeBase,d);for(const I of N){const H=T.mountpoint+el(I);m.some(L=>H.startsWith(L))||w.push(H)}m=[T.mountpoint,...m.filter(I=>!I.startsWith(T.mountpoint))]}const b=d.maxDepth!==void 0&&!y;return w.filter(T=>(!b||Rfe(T,d.maxDepth))&&Mfe(T,u))},async clear(u,d={}){u=iI(u),await Promise.all(r(u,!1).map(async f=>{if(f.driver.clear)return Ro(f.driver.clear,f.relativeBase,d);if(f.driver.removeItem){const m=await f.driver.getKeys(f.relativeBase||"",d);return Promise.all(m.map(w=>f.driver.removeItem(w,d)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(u=>pF(u)))},async watch(u){return await s(),e.watchListeners.push(u),async()=>{e.watchListeners=e.watchListeners.filter(d=>d!==u),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(u,d){if(u=iI(u),u&&e.mounts[u])throw new Error(`already mounted at ${u}`);return u&&(e.mountpoints.push(u),e.mountpoints.sort((f,m)=>m.length-f.length)),e.mounts[u]=d,e.watching&&Promise.resolve(fF(d,i,u)).then(f=>{e.unwatch[u]=f}).catch(console.error),c},async unmount(u,d=!0){var f,m;u=iI(u),!(!u||!e.mounts[u])&&(e.watching&&u in e.unwatch&&((m=(f=e.unwatch)[u])==null||m.call(f),delete e.unwatch[u]),d&&await pF(e.mounts[u]),e.mountpoints=e.mountpoints.filter(w=>w!==u),delete e.mounts[u])},getMount(u=""){u=el(u)+":";const d=t(u);return{driver:d.driver,base:d.base}},getMounts(u="",d={}){return u=el(u),r(u,d.parents).map(m=>({driver:m.driver,base:m.mountpoint}))},keys:(u,d={})=>c.getKeys(u,d),get:(u,d={})=>c.getItem(u,d),set:(u,d,f={})=>c.setItem(u,d,f),has:(u,d={})=>c.hasItem(u,d),del:(u,d={})=>c.removeItem(u,d),remove:(u,d={})=>c.removeItem(u,d)};return c}function fF(n,e,t){return n.watch?n.watch((r,i)=>e(r,t+i)):()=>{}}async function pF(n){typeof n.dispose=="function"&&await Ro(n.dispose)}function H1(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}function pJ(n,e){let t;const r=()=>{if(t)return t;const i=indexedDB.open(n);return i.onupgradeneeded=()=>i.result.createObjectStore(e),t=H1(i),t.then(s=>{s.onclose=()=>t=void 0},()=>{}),t};return(i,s)=>r().then(o=>s(o.transaction(e,i).objectStore(e)))}let Nk;function PC(){return Nk||(Nk=pJ("keyval-store","keyval")),Nk}function gF(n,e=PC()){return e("readonly",t=>H1(t.get(n)))}function Dfe(n,e,t=PC()){return t("readwrite",r=>(r.put(e,n),H1(r.transaction)))}function Bfe(n,e=PC()){return e("readwrite",t=>(t.delete(n),H1(t.transaction)))}function Lfe(n=PC()){return n("readwrite",e=>(e.clear(),H1(e.transaction)))}function $fe(n,e){return n.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},H1(n.transaction)}function Ufe(n=PC()){return n("readonly",e=>{if(e.getAllKeys)return H1(e.getAllKeys());const t=[];return $fe(e,r=>t.push(r.key)).then(()=>t)})}const jfe=n=>JSON.stringify(n,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),zfe=n=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=n.replace(e,'$1"$2n"$3');return JSON.parse(t,(r,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function a1(n){if(typeof n!="string")throw new Error(`Cannot safe json parse value of type ${typeof n}`);try{return zfe(n)}catch{return n}}function ag(n){return typeof n=="string"?n:jfe(n)||""}const Ffe="idb-keyval";var Wfe=(n={})=>{const e=n.base&&n.base.length>0?`${n.base}:`:"",t=i=>e+i;let r;return n.dbName&&n.storeName&&(r=pJ(n.dbName,n.storeName)),{name:Ffe,options:n,async hasItem(i){return!(typeof await gF(t(i),r)>"u")},async getItem(i){return await gF(t(i),r)??null},setItem(i,s){return Dfe(t(i),s,r)},removeItem(i){return Bfe(t(i),r)},getKeys(){return Ufe(r)},clear(){return Lfe(r)}}};const Hfe="WALLET_CONNECT_V2_INDEXED_DB",Vfe="keyvaluestorage";let qfe=class{constructor(){this.indexedDb=Pfe({driver:Wfe({dbName:Hfe,storeName:Vfe})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,ag(t))}async removeItem(e){await this.indexedDb.removeItem(e)}};var Rk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u6={exports:{}};(function(){let n;function e(){}n=e,n.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},n.prototype.setItem=function(t,r){this[t]=String(r)},n.prototype.removeItem=function(t){delete this[t]},n.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(r){t[r]=void 0,delete t[r]})},n.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},n.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Rk<"u"&&Rk.localStorage?u6.exports=Rk.localStorage:typeof window<"u"&&window.localStorage?u6.exports=window.localStorage:u6.exports=new e})();function Kfe(n){var e;return[n[0],a1((e=n[1])!=null?e:"")]}let Yfe=class{constructor(){this.localStorage=u6.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Kfe)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return a1(t)}async setItem(e,t){this.localStorage.setItem(e,ag(t))}async removeItem(e){this.localStorage.removeItem(e)}};const Gfe="wc_storage_version",mF=1,Zfe=async(n,e,t)=>{const r=Gfe,i=await e.getItem(r);if(i&&i>=mF){t(e);return}const s=await n.getKeys();if(!s.length){t(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const u=await n.getItem(a);await e.setItem(a,u),o.push(a)}}await e.setItem(r,mF),t(e),Qfe(n,o)},Qfe=async(n,e)=>{e.length&&e.forEach(async t=>{await n.removeItem(t)})};let Xfe=class{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new Yfe;this.storage=e;try{const t=new qfe;Zfe(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};var Mk,wF;function Jfe(){if(wF)return Mk;wF=1;function n(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}Mk=e;function e(t,r,i){var s=i&&i.stringify||n,o=1;if(typeof t=="object"&&t!==null){var a=r.length+o;if(a===1)return t;var c=new Array(a);c[0]=s(t);for(var u=1;u<a;u++)c[u]=s(r[u]);return c.join(" ")}if(typeof t!="string")return t;var d=r.length;if(d===0)return t;for(var f="",m=1-o,w=-1,y=t&&t.length||0,b=0;b<y;){if(t.charCodeAt(b)===37&&b+1<y){switch(w=w>-1?w:0,t.charCodeAt(b+1)){case 100:case 102:if(m>=d||r[m]==null)break;w<b&&(f+=t.slice(w,b)),f+=Number(r[m]),w=b+2,b++;break;case 105:if(m>=d||r[m]==null)break;w<b&&(f+=t.slice(w,b)),f+=Math.floor(Number(r[m])),w=b+2,b++;break;case 79:case 111:case 106:if(m>=d||r[m]===void 0)break;w<b&&(f+=t.slice(w,b));var E=typeof r[m];if(E==="string"){f+="'"+r[m]+"'",w=b+2,b++;break}if(E==="function"){f+=r[m].name||"<anonymous>",w=b+2,b++;break}f+=s(r[m]),w=b+2,b++;break;case 115:if(m>=d)break;w<b&&(f+=t.slice(w,b)),f+=String(r[m]),w=b+2,b++;break;case 37:w<b&&(f+=t.slice(w,b)),f+="%",w=b+2,b++,m--;break}++m}++b}return w===-1?t:(w<y&&(f+=t.slice(w)),f)}return Mk}var kk,yF;function epe(){if(yF)return kk;yF=1;const n=Jfe();kk=i;const e=L().console||{},t={mapHttpRequest:y,mapHttpResponse:y,wrapRequestSerializer:b,wrapResponseSerializer:b,wrapErrorSerializer:b,req:y,res:y,err:m};function r(U,K){return Array.isArray(U)?U.filter(function(k){return k!=="!stdSerializers.err"}):U===!0?Object.keys(K):!1}function i(U){U=U||{},U.browser=U.browser||{};const K=U.browser.transmit;if(K&&typeof K.send!="function")throw Error("pino: transmit option must have a send function");const Y=U.browser.write||e;U.browser.write&&(U.browser.asObject=!0);const k=U.serializers||{},j=r(U.browser.serialize,k);let V=U.browser.serialize;Array.isArray(U.browser.serialize)&&U.browser.serialize.indexOf("!stdSerializers.err")>-1&&(V=!1);const W=["error","fatal","warn","info","debug","trace"];typeof Y=="function"&&(Y.error=Y.fatal=Y.warn=Y.info=Y.debug=Y.trace=Y),U.enabled===!1&&(U.level="silent");const $=U.level||"info",A=Object.create(Y);A.log||(A.log=E),Object.defineProperty(A,"levelVal",{get:R}),Object.defineProperty(A,"level",{get:P,set:q});const _={transmit:K,serialize:j,asObject:U.browser.asObject,levels:W,timestamp:w(U)};A.levels=i.levels,A.level=$,A.setMaxListeners=A.getMaxListeners=A.emit=A.addListener=A.on=A.prependListener=A.once=A.prependOnceListener=A.removeListener=A.removeAllListeners=A.listeners=A.listenerCount=A.eventNames=A.write=A.flush=E,A.serializers=k,A._serialize=j,A._stdErrSerialize=V,A.child=F,K&&(A._logEvent=f());
65function R(){return this.level==="silent"?1/0:this.levels.values[this.level]}function P(){return this._level}function q(z){if(z!=="silent"&&!this.levels.values[z])throw Error("unknown level "+z);this._level=z,s(_,A,"error","log"),s(_,A,"fatal","error"),s(_,A,"warn","error"),s(_,A,"info","log"),s(_,A,"debug","log"),s(_,A,"trace","log")}function F(z,B){if(!z)throw new Error("missing bindings for child Pino");B=B||{},j&&z.serializers&&(B.serializers=z.serializers);const C=B.serializers;if(j&&C){var M=Object.assign({},k,C),Z=U.browser.serialize===!0?Object.keys(M):j;delete z.serializers,c([z],Z,M,this._stdErrSerialize)}function J(ae){this._childLevel=(ae._childLevel|0)+1,this.error=u(ae,z,"error"),this.fatal=u(ae,z,"fatal"),this.warn=u(ae,z,"warn"),this.info=u(ae,z,"info"),this.debug=u(ae,z,"debug"),this.trace=u(ae,z,"trace"),M&&(this.serializers=M,this._serialize=Z),K&&(this._logEvent=f([].concat(ae._logEvent.bindings,z)))}return J.prototype=this,new J(this)}return A}i.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},i.stdSerializers=t,i.stdTimeFunctions=Object.assign({},{nullTime:T,epochTime:N,unixTime:I,isoTime:H});function s(U,K,Y,k){const j=Object.getPrototypeOf(K);K[Y]=K.levelVal>K.levels.values[Y]?E:j[Y]?j[Y]:e[Y]||e[k]||E,o(U,K,Y)}function o(U,K,Y){!U.transmit&&K[Y]===E||(K[Y]=function(k){return function(){const V=U.timestamp(),W=new Array(arguments.length),$=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var A=0;A<W.length;A++)W[A]=arguments[A];if(U.serialize&&!U.asObject&&c(W,this._serialize,this.serializers,this._stdErrSerialize),U.asObject?k.call($,a(this,Y,W,V)):k.apply($,W),U.transmit){const _=U.transmit.level||K.level,R=i.levels.values[_],P=i.levels.values[Y];if(P<R)return;d(this,{ts:V,methodLevel:Y,methodValue:P,transmitValue:i.levels.values[U.transmit.level||K.level],send:U.transmit.send,val:K.levelVal},W)}}}(K[Y]))}function a(U,K,Y,k){U._serialize&&c(Y,U._serialize,U.serializers,U._stdErrSerialize);const j=Y.slice();let V=j[0];const W={};k&&(W.time=k),W.level=i.levels.values[K];let $=(U._childLevel|0)+1;if($<1&&($=1),V!==null&&typeof V=="object"){for(;$--&&typeof j[0]=="object";)Object.assign(W,j.shift());V=j.length?n(j.shift(),j):void 0}else typeof V=="string"&&(V=n(j.shift(),j));return V!==void 0&&(W.msg=V),W}function c(U,K,Y,k){for(const j in U)if(k&&U[j]instanceof Error)U[j]=i.stdSerializers.err(U[j]);else if(typeof U[j]=="object"&&!Array.isArray(U[j]))for(const V in U[j])K&&K.indexOf(V)>-1&&V in Y&&(U[j][V]=Y[V](U[j][V]))}function u(U,K,Y){return function(){const k=new Array(1+arguments.length);k[0]=K;for(var j=1;j<k.length;j++)k[j]=arguments[j-1];return U[Y].apply(this,k)}}function d(U,K,Y){const k=K.send,j=K.ts,V=K.methodLevel,W=K.methodValue,$=K.val,A=U._logEvent.bindings;c(Y,U._serialize||Object.keys(U.serializers),U.serializers,U._stdErrSerialize===void 0?!0:U._stdErrSerialize),U._logEvent.ts=j,U._logEvent.messages=Y.filter(function(_){return A.indexOf(_)===-1}),U._logEvent.level.label=V,U._logEvent.level.value=W,k(V,U._logEvent,$),U._logEvent=f(A)}function f(U){return{ts:0,messages:[],bindings:U||[],level:{label:"",value:0}}}function m(U){const K={type:U.constructor.name,msg:U.message,stack:U.stack};for(const Y in U)K[Y]===void 0&&(K[Y]=U[Y]);return K}function w(U){return typeof U.timestamp=="function"?U.timestamp:U.timestamp===!1?T:N}function y(){return{}}function b(U){return U}function E(){}function T(){return!1}function N(){return Date.now()}function I(){return Math.round(Date.now()/1e3)}function H(){return new Date(Date.now()).toISOString()}function L(){function U(K){return typeof K<"u"&&K}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return U(self)||U(window)||U(this)||{}}}return kk}var w2=epe();const DC=xo(w2),tpe={level:"info"},BC="custom_context",a$=1e3*1024;let npe=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},bF=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const t=new npe(e);if(t.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;t!==null;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}},gJ=class{constructor(e,t=a$){this.level=e??"error",this.levelValue=w2.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new bF(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===w2.levels.values.error?console.error(e):t===w2.levels.values.warn?console.warn(e):t===w2.levels.values.debug?console.debug(e):t===w2.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(ag({timestamp:new Date().toISOString(),log:e}));const t=typeof e=="string"?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new bF(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(ag({extraMetadata:e})),new Blob(t,{type:"application/json"})}},rpe=class{constructor(e,t=a$){this.baseChunkLogger=new gJ(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}},ipe=class{constructor(e,t=a$){this.baseChunkLogger=new gJ(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var spe=Object.defineProperty,ope=Object.defineProperties,ape=Object.getOwnPropertyDescriptors,vF=Object.getOwnPropertySymbols,cpe=Object.prototype.hasOwnProperty,lpe=Object.prototype.propertyIsEnumerable,xF=(n,e,t)=>e in n?spe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,z6=(n,e)=>{for(var t in e||(e={}))cpe.call(e,t)&&xF(n,t,e[t]);if(vF)for(var t of vF(e))lpe.call(e,t)&&xF(n,t,e[t]);return n},F6=(n,e)=>ope(n,ape(e));function qx(n){return F6(z6({},n),{level:(n==null?void 0:n.level)||tpe.level})}function upe(n,e=BC){return n[e]||""}function dpe(n,e,t=BC){return n[t]=e,n}function bl(n,e=BC){let t="";return typeof n.bindings>"u"?t=upe(n,e):t=n.bindings().context||"",t}function hpe(n,e,t=BC){const r=bl(n,t);return r.trim()?`${r}/${e}`:e}function Qa(n,e,t=BC){const r=hpe(n,e,t),i=n.child({context:r});return dpe(i,r,t)}function fpe(n){var e,t;const r=new rpe((e=n.opts)==null?void 0:e.level,n.maxSizeInBytes);return{logger:DC(F6(z6({},n.opts),{level:"trace",browser:F6(z6({},(t=n.opts)==null?void 0:t.browser),{write:i=>r.write(i)})})),chunkLoggerController:r}}function ppe(n){var e;const t=new ipe((e=n.opts)==null?void 0:e.level,n.maxSizeInBytes);return{logger:DC(F6(z6({},n.opts),{level:"trace"}),t),chunkLoggerController:t}}function c$(n){return typeof n.loggerOverride<"u"&&typeof n.loggerOverride!="string"?{logger:n.loggerOverride,chunkLoggerController:null}:typeof window<"u"?fpe(n):ppe(n)}var gpe=Object.defineProperty,mpe=(n,e,t)=>e in n?gpe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,EF=(n,e,t)=>mpe(n,typeof e!="symbol"?e+"":e,t);let wpe=class extends F1{constructor(e){super(),this.opts=e,EF(this,"protocol","wc"),EF(this,"version",2)}};var ype=Object.defineProperty,bpe=(n,e,t)=>e in n?ype(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,vpe=(n,e,t)=>bpe(n,e+"",t);let xpe=class extends F1{constructor(e,t){super(),this.core=e,this.logger=t,vpe(this,"records",new Map)}},Epe=class{constructor(e,t){this.logger=e,this.core=t}},Ape=class extends F1{constructor(e,t){super(),this.relayer=e,this.logger=t}},Spe=class extends F1{constructor(e){super()}}
vendor: 6,025 bytes, line 65
65,_pe=class{constructor(e,t,r,i){this.core=e,this.logger=t,this.name=r}},Cpe=class extends F1{constructor(e,t){super(),this.relayer=e,this.logger=t}},Tpe=class extends F1{constructor(e,t){super(),this.core=e,this.logger=t}},Ipe=class{constructor(e,t,r){this.core=e,this.logger=t,this.store=r}},Npe=class{constructor(e,t){this.projectId=e,this.logger=t}},Rpe=class{constructor(e,t,r){this.core=e,this.logger=t,this.telemetryEnabled=r}};var Mpe=Object.defineProperty,kpe=(n,e,t)=>e in n?Mpe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,AF=(n,e,t)=>kpe(n,typeof e!="symbol"?e+"":e,t);let Ope=class{constructor(e){this.opts=e,AF(this,"protocol","wc"),AF(this,"version",2)}},Ppe=class{constructor(e){this.client=e}};function Dpe(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function mJ(n,...e){if(!Dpe(n))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(n.length))throw new Error("Uint8Array expected of length "+e+", got length="+n.length)}function SF(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function Bpe(n,e){mJ(n);const t=e.outputLen;if(n.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}const Vv=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ok=n=>new DataView(n.buffer,n.byteOffset,n.byteLength);function Lpe(n){if(typeof n!="string")throw new Error("utf8ToBytes expected string, got "+typeof n);return new Uint8Array(new TextEncoder().encode(n))}function wJ(n){return typeof n=="string"&&(n=Lpe(n)),mJ(n),n}let $pe=class{clone(){return this._cloneInto()}};function Upe(n){const e=r=>n().update(wJ(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function yJ(n=32){if(Vv&&typeof Vv.getRandomValues=="function")return Vv.getRandomValues(new Uint8Array(n));if(Vv&&typeof Vv.randomBytes=="function")return Vv.randomBytes(n);throw new Error("crypto.getRandomValues must be defined")}function jpe(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(t>>i&s),a=Number(t&s),c=r?4:0,u=r?0:4;n.setUint32(e+c,o,r),n.setUint32(e+u,a,r)}let zpe=class extends $pe{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ok(this.buffer)}update(e){SF(this);const{view:t,buffer:r,blockLen:i}=this;e=wJ(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=Ok(e);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){SF(this),Bpe(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let f=o;f<i;f++)t[f]=0;jpe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=Ok(e),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++)a.setUint32(4*f,d[f],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%t&&e.buffer.set(r),e}};const sI=BigInt(2**32-1),HD=BigInt(32);function bJ(n,e=!1){return e?{h:Number(n&sI),l:Number(n>>HD&sI)}:{h:Number(n>>HD&sI)|0,l:Number(n&sI)|0}}function Fpe(n,e=!1){let t=new Uint32Array(n.length),r=new Uint32Array(n.length);for(let i=0;i<n.length;i++){const{h:s,l:o}=bJ(n[i],e);[t[i],r[i]]=[s,o]}return[t,r]}const Wpe=(n,e)=>BigInt(n>>>0)<<HD|BigInt(e>>>0),Hpe=(n,e,t)=>n>>>t,Vpe=(n,e,t)=>n<<32-t|e>>>t,qpe=(n,e,t)=>n>>>t|e<<32-t,Kpe=(n,e,t)=>n<<32-t|e>>>t,Ype=(n,e,t)=>n<<64-t|e>>>t-32,Gpe=(n,e,t)=>n>>>t-32|e<<64-t,Zpe=(n,e)=>e,Qpe=(n,e)=>n,Xpe=(n,e,t)=>n<<t|e>>>32-t,Jpe=(n,e,t)=>e<<t|n>>>32-t,ege=(n,e,t)=>e<<t-32|n>>>64-t,tge=(n,e,t)=>n<<t-32|e>>>64-t;function nge(n,e,t,r){const i=(e>>>0)+(r>>>0);return{h:n+t+(i/2**32|0)|0,l:i|0}}const rge=(n,e,t)=>(n>>>0)+(e>>>0)+(t>>>0),ige=(n,e,t,r)=>e+t+r+(n/2**32|0)|0,sge=(n,e,t,r)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0),oge=(n,e,t,r,i)=>e+t+r+i+(n/2**32|0)|0,age=(n,e,t,r,i)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),cge=(n,e,t,r,i,s)=>e+t+r+i+s+(n/2**32|0)|0,yr={fromBig:bJ,split:Fpe,toBig:Wpe,shrSH:Hpe,shrSL:Vpe,rotrSH:qpe,rotrSL:Kpe,rotrBH:Ype,rotrBL:Gpe,rotr32H:Zpe,rotr32L:Qpe,rotlSH:Xpe,rotlSL:Jpe,rotlBH:ege,rotlBL:tge,add:nge,add3L:rge,add3H:ige,add4L:sge,add4H:oge,add5H:cge,add5L:age},[lge,uge]=yr.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","0xf40e3585
655771202a","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(n=>BigInt(n))),Tm=new Uint32Array(80),Im=new Uint32Array(80);let dge=class extends zpe{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:e,Al:t,Bh:r,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:d,Fh:f,Fl:m,Gh:w,Gl:y,Hh:b,Hl:E}=this;return[e,t,r,i,s,o,a,c,u,d,f,m,w,y,b,E]}set(e,t,r,i,s,o,a,c,u,d,f,m,w,y,b,E){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=m|0,this.Gh=w|0,this.Gl=y|0,this.Hh=b|0,this.Hl=E|0}process(e,t){for(let I=0;I<16;I++,t+=4)Tm[I]=e.getUint32(t),Im[I]=e.getUint32(t+=4);for(let I=16;I<80;I++){const H=Tm[I-15]|0,L=Im[I-15]|0,U=yr.rotrSH(H,L,1)^yr.rotrSH(H,L,8)^yr.shrSH(H,L,7),K=yr.rotrSL(H,L,1)^yr.rotrSL(H,L,8)^yr.shrSL(H,L,7),Y=Tm[I-2]|0,k=Im[I-2]|0,j=yr.rotrSH(Y,k,19)^yr.rotrBH(Y,k,61)^yr.shrSH(Y,k,6),V=yr.rotrSL(Y,k,19)^yr.rotrBL(Y,k,61)^yr.shrSL(Y,k,6),W=yr.add4L(K,V,Im[I-7],Im[I-16]),$=yr.add4H(W,U,j,Tm[I-7],Tm[I-16]);Tm[I]=$|0,Im[I]=W|0}let{Ah:r,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:u,Dl:d,Eh:f,El:m,Fh:w,Fl:y,Gh:b,Gl:E,Hh:T,Hl:N}=this;for(let I=0;I<80;I++){const H=yr.rotrSH(f,m,14)^yr.rotrSH(f,m,18)^yr.rotrBH(f,m,41),L=yr.rotrSL(f,m,14)^yr.rotrSL(f,m,18)^yr.rotrBL(f,m,41),U=f&w^~f&b,K=m&y^~m&E,Y=yr.add5L(N,L,K,uge[I],Im[I]),k=yr.add5H(Y,T,H,U,lge[I],Tm[I]),j=Y|0,V=yr.rotrSH(r,i,28)^yr.rotrBH(r,i,34)^yr.rotrBH(r,i,39),W=yr.rotrSL(r,i,28)^yr.rotrBL(r,i,34)^yr.rotrBL(r,i,39),$=r&s^r&a^s&a,A=i&o^i&c^o&c;T=b|0,N=E|0,b=w|0,E=y|0,w=f|0,y=m|0,{h:f,l:m}=yr.add(u|0,d|0,k|0,j|0),u=a|0,d=c|0,a=s|0,c=o|0,s=r|0,o=i|0;const _=yr.add3L(j,W,A);r=yr.add3H(_,k,V,$),i=_|0}({h:r,l:i}=yr.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:o}=yr.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=yr.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l:d}=yr.add(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:m}=yr.add(this.Eh|0,this.El|0,f|0,m|0),{h:w,l:y}=yr.add(this.Fh|0,this.Fl|0,w|0,y|0),{h:b,l:E}=yr.add(this.Gh|0,this.Gl|0,b|0,E|0),{h:T,l:N}=yr.add(this.Hh|0,this.Hl|0,T|0,N|0),this.set(r,i,s,o,a,c,u,d,f,m,w,y,b,E,T,N)}roundClean(){Tm.fill(0),Im.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 hge=Upe(()=>new dge);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const l$=BigInt(0),vJ=BigInt(1),fge=BigInt(2);function u$(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function d$(n){if(!u$(n))throw new Error("Uint8Array expected")}function Pk(n,e){if(typeof e!="boolean")throw new Error(n+" boolean expected, got "+e)}const pge=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function h$(n){d$(n);let e="";for(let t=0;t<n.length;t++)e+=pge[n[t]];return e}function xJ(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?l$:BigInt("0x"+n)}const Mp={_0:48,_9:57,A:65,F:70,a:97,f:102};function _F(n){if(n>=Mp._0&&n<=Mp._9)return n-Mp._0;if(n>=Mp.A&&n<=Mp.F)return n-(Mp.A-10);if(n>=Mp.a&&n<=Mp.f)return n-(Mp.a-10)}function EJ(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);
vendor: 23,240 bytes, line 65
65const r=new Uint8Array(t);for(let i=0,s=0;i<t;i++,s+=2){const o=_F(n.charCodeAt(s)),a=_F(n.charCodeAt(s+1));if(o===void 0||a===void 0){const c=n[s]+n[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[i]=o*16+a}return r}function gge(n){return xJ(h$(n))}function d6(n){return d$(n),xJ(h$(Uint8Array.from(n).reverse()))}function AJ(n,e){return EJ(n.toString(16).padStart(e*2,"0"))}function VD(n,e){return AJ(n,e).reverse()}function kp(n,e,t){let r;if(typeof e=="string")try{r=EJ(e)}catch(s){throw new Error(n+" must be hex string or Uint8Array, cause: "+s)}else if(u$(e))r=Uint8Array.from(e);else throw new Error(n+" must be hex string or Uint8Array");const i=r.length;if(typeof t=="number"&&i!==t)throw new Error(n+" of length "+t+" expected, got "+i);return r}function CF(...n){let e=0;for(let r=0;r<n.length;r++){const i=n[r];d$(i),e+=i.length}const t=new Uint8Array(e);for(let r=0,i=0;r<n.length;r++){const s=n[r];t.set(s,i),i+=s.length}return t}const Dk=n=>typeof n=="bigint"&&l$<=n;function mge(n,e,t){return Dk(n)&&Dk(e)&&Dk(t)&&e<=n&&n<t}function gA(n,e,t,r){if(!mge(e,t,r))throw new Error("expected valid "+n+": "+t+" <= n < "+r+", got "+e)}function wge(n){let e;for(e=0;n>l$;n>>=vJ,e+=1);return e}const yge=n=>(fge<<BigInt(n-1))-vJ,bge={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||u$(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function f$(n,e,t={}){const r=(i,s,o)=>{const a=bge[s];if(typeof a!="function")throw new Error("invalid validator function");const c=n[i];if(!(o&&c===void 0)&&!a(c,n))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))r(i,s,!1);for(const[i,s]of Object.entries(t))r(i,s,!0);return n}function TF(n){const e=new WeakMap;return(t,...r)=>{const i=e.get(t);if(i!==void 0)return i;const s=n(t,...r);return e.set(t,s),s}}const Do=BigInt(0),Ys=BigInt(1),wy=BigInt(2),vge=BigInt(3),qD=BigInt(4),IF=BigInt(5),NF=BigInt(8);function yo(n,e){const t=n%e;return t>=Do?t:e+t}function xge(n,e,t){if(e<Do)throw new Error("invalid exponent, negatives unsupported");if(t<=Do)throw new Error("invalid modulus");if(t===Ys)return Do;let r=Ys;for(;e>Do;)e&Ys&&(r=r*n%t),n=n*n%t,e>>=Ys;return r}function Jh(n,e,t){let r=n;for(;e-- >Do;)r*=r,r%=t;return r}function RF(n,e){if(n===Do)throw new Error("invert: expected non-zero number");if(e<=Do)throw new Error("invert: expected positive modulus, got "+e);let t=yo(n,e),r=e,i=Do,s=Ys;for(;t!==Do;){const o=r/t,a=r%t,c=i-s*o;r=t,t=a,i=s,s=c}if(r!==Ys)throw new Error("invert: does not exist");return yo(i,e)}function Ege(n){const e=(n-Ys)/wy;let t,r,i;for(t=n-Ys,r=0;t%wy===Do;t/=wy,r++);for(i=wy;i<n&&xge(i,e,n)!==n-Ys;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(n+Ys)/qD;return function(a,c){const u=a.pow(c,o);if(!a.eql(a.sqr(u),c))throw new Error("Cannot find square root");return u}}const s=(t+Ys)/wy;return function(o,a){if(o.pow(a,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=r,u=o.pow(o.mul(o.ONE,i),t),d=o.pow(a,s),f=o.pow(a,t);for(;!o.eql(f,o.ONE);){if(o.eql(f,o.ZERO))return o.ZERO;let m=1;for(let y=o.sqr(f);m<c&&!o.eql(y,o.ONE);m++)y=o.sqr(y);const w=o.pow(u,Ys<<BigInt(c-m-1));u=o.sqr(w),d=o.mul(d,w),f=o.mul(f,u),c=m}return d}}function Age(n){if(n%qD===vge){const e=(n+Ys)/qD;return function(t,r){const i=t.pow(r,e);if(!t.eql(t.sqr(i),r))throw new Error("Cannot find square root");return i}}if(n%NF===IF){const e=(n-IF)/NF;return function(t,r){const i=t.mul(r,wy),s=t.pow(i,e),o=t.mul(r,s),a=t.mul(t.mul(o,wy),s),c=t.mul(o,t.sub(a,t.ONE));if(!t.eql(t.sqr(c),r))throw new Error("Cannot find square root");return c}}return Ege(n)}const Sge=(n,e)=>(yo(n,e)&Ys)===Ys,_ge=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Cge(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=_ge.reduce((r,i)=>(r[i]="function",r),e);return f$(n,t)}function Tge(n,e,t){if(t<Do)throw new Error("invalid exponent, negatives unsupported");if(t===Do)return n.ONE;if(t===Ys)return e;let r=n.ONE,i=e;for(;t>Do;)t&Ys&&(r=n.mul(r,i)),i=n.sqr(i),t>>=Ys;return r}function Ige(n,e){const t=new Array(e.length),r=e.reduce((s,o,a)=>n.is0(o)?s:(t[a]=s,n.mul(s,o)),n.ONE),i=n.inv(r);return e.reduceRight((s,o,a)=>n.is0(o)?s:(t[a]=n.mul(s,t[a]),n.mul(s,o)),i),t}function SJ(n,e){const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function _J(n,e,t=!1,r={}){if(n<=Do)throw new Error("invalid field: expected ORDER > 0, got "+n);const{nBitLength:i,nByteLength:s}=SJ(n,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:n,isLE:t,BITS:i,BYTES:s,MASK:yge(i),ZERO:Do,ONE:Ys,create:c=>yo(c,n),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Do<=c&&c<n},is0:c=>c===Do,isOdd:c=>(c&Ys)===Ys,neg:c=>yo(-c,n),eql:(c,u)=>c===u,sqr:c=>yo(c*c,n),add:(c,u)=>yo(c+u,n),sub:(c,u)=>yo(c-u,n),mul:(c,u)=>yo(c*u,n),pow:(c,u)=>Tge(a,c,u),div:(c,u)=>yo(c*RF(u,n),n),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>RF(c,n),sqrt:r.sqrt||(c=>(o||(o=Age(n)),o(a,c))),invertBatch:c=>Ige(a,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>t?VD(c,s):AJ(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return t?d6(c):gge(c)}});return Object.freeze(a)}const MF=BigInt(0),oI=BigInt(1);function Bk(n,e){const t=e.negate();return n?t:e}function CJ(n,e){if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+n)}function Lk(n,e){CJ(n,e);const t=Math.ceil(e/n)+1,r=2**(n-1);return{windows:t,windowSize:r}}function Nge(n,e){if(!Array.isArray(n))throw new Error("array expected");n.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function Rge(n,e){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const $k=new WeakMap,TJ=new WeakMap;function Uk(n){return TJ.get(n)||1}function Mge(n,e){return{constTimeNegate:Bk,hasPrecomputes(t){return Uk(t)!==1},unsafeLadder(t,r,i=n.ZERO){let s=t;for(;r>MF;)r&oI&&(i=i.add(s)),s=s.double(),r>>=oI;return i},precomputeWindow(t,r){const{windows:i,windowSize:s}=Lk(r,e),o=[];let a=t,c=a;for(let u=0;u<i;u++){c=a,o.push(c);for(let d=1;d<s;d++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(t,r,i){const{windows:s,windowSize:o}=Lk(t,e);let a=n.ZERO,c=n.BASE;const u=BigInt(2**t-1),d=2**t,f=BigInt(t);for(let m=0;m<s;m++){const w=m*o;let y=Number(i&u);i>>=f,y>o&&(y-=d,i+=oI);const b=w,E=w+Math.abs(y)-1,T=m%2!==0,N=y<0;y===0?c=c.add(Bk(T,r[b])):a=a.add(Bk(N,r[E]))}return{p:a,f:c}},wNAFUnsafe(t,r,i,s=n.ZERO){const{windows:o,windowSize:a}=Lk(t,e),c=BigInt(2**t-1),u=2**t,d=BigInt(t);for(let f=0;f<o;f++){const m=f*a;if(i===MF)break;let w=Number(i&c);if(i>>=d,w>a&&(w-=u,i+=oI),w===0)continue;let y=r[m+Math.abs(w)-1];w<0&&(y=y.negate()),s=s.add(y)}return s},getPrecomputes(t,r,i){let s=$k.get(r);return s||(s=this.precomputeWindow(r,t),t!==1&&$k.set(r,i(s))),s},wNAFCached(t,r,i){const s=Uk(t);return this.wNAF(s,this.getPrecomputes(s,t,i),r)},wNAFCachedUnsafe(t,r,i,s){const o=Uk(t);return o===1?this.unsafeLadder(t,r,s):this.wNAFUnsafe(o,this.getPrecomputes(o,t,i),r,s)},setWindowSize(t,r){CJ(r,e),TJ.set(t,r),$k.delete(t)}}}function kge(n,e,t,r){if(Nge(t,n),Rge(r,e),t.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const i=n.ZERO,s=wge(BigInt(t.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<<o)-1,c=new Array(a+1).fill(i),u=Math.floor((e.BITS-1)/o)*o;let d=i;for(let f=u;f>=0;f-=o){c.fill(i);for(let w=0;w<r.length;w++){const y=r[w],b=Number(y>>BigInt(f)&BigInt(a));c[b]=c[b].add(t[w])}let m=i;for(let w=c.length-1,y=i;w>0;w--)y=y.add(c[w]),m=m.add(y);if(d=d.add(m),f!==0)for(let w=0;w<o;w++)d=d.double()}return d}function Oge(n){return Cge(n.Fp),f$(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...SJ(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}const kd=BigInt(0),Gc=BigInt(1),aI=BigInt(2),Pge=BigInt(8),Dge={zip215:!0};function Bge(n){const e=Oge(n);return f$(n,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Lge(n){const e=Bge(n),{Fp:t,n:r,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,u=aI<<BigInt(a*8)-Gc,d=t.create,f=_J(e.n,e.nBitLength),m=e.uvRatio||((_,R)=>{try{return{isValid:!0,value:t.sqrt(_*t.inv(R))}}catch{return{isValid:!1,value:kd}}}),w=e.adjustScalarBytes||(_=>_),y=e.domain||((_,R,P)=>{if(Pk("phflag",P),R.length||P)throw new Error("Contexts/pre-hash are not supported");return _});function b(_,R){gA("coordinate "+_,R,kd,u)}function E(_){if(!(_ instanceof I))throw new Error("ExtendedPoint expected")}const T=TF((_,R)=>{const{ex:P,ey:q,ez:F}=_,z=_.is0();R==null&&(R=z?Pge:t.inv(F));const B=d(P*R),C=d(q*R),M=d(F*R);if(z)return{x:kd,y:Gc};if(M!==Gc)throw new Error("invZ was invalid");return{x:B,y:C}}),N=TF(_=>{const{a:R,d:P}=e;if(_.is0())throw new Error("bad point: ZERO");const{ex:q,ey:F,ez:z,et:B}=_,C=d(q*q),M=d(F*F),Z=d(z*z),J=d(Z*Z),ae=d(C*R),we=d(Z*d(ae+M)),he=d(J+d(P*d(C*M)));if(we!==he)throw new Error("bad point: equation left != right (1)");const xe=d(q*F),Se=d(z*B);if(xe!==Se)throw new Error("bad point: equation left != right (2)");return!0});class I{constructor(R,P,q,F){this.ex=R,this.ey=P,this.ez=q,this.et=F,b("x",R),b("y",P),b("z",q),b("t",F),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(R){if(R instanceof I)throw new Error("extended point not allowed");const{x:P,y:q}=R||{};return b("x",P),b("y",q),new I(P,q,Gc,d(P*q))}static normalizeZ(R){const P=t.invertBatch(R.map(q=>q.ez));return R.map((q,F)=>q.toAffine(P[F])).map(I.fromAffine)}static msm(R,P){return kge(I,f,R,P)}_setWindowSize(R){U.setWindowSize(this,R)}assertValidity(){N(this)}equals(R){E(R);const{ex:P,ey:q,ez:F}=this,{ex:z,ey:B,ez:C}=R,M=d(P*C),Z=d(z*F),J=d(q*C),ae=d(B*F);return M===Z&&J===ae}is0(){return this.equals(I.ZERO)}negate(){return new I(d(-this.ex),this.ey,this.ez,d(-this.et))}double(){const{a:R}=e,{ex:P,ey:q,ez:F}=this,z=d(P*P),B=d(q*q),C=d(aI*d(F*F)),M=d(R*z),Z=P+q,J=d(d(Z*Z)-z-B),ae=M+B,we=ae-C,he=M-B,xe=d(J*we),Se=d(ae*he),Re=d(J*he),et=d(we*ae);return new I(xe,Se,et,Re)}add(R){E(R);const{a:P,d:q}=e,{ex:F,ey:z,ez:B,et:C}=this,{ex:M,ey:Z,ez:J,et:ae}=R;if(P===BigInt(-1)){const yn=d((z-F)*(Z+M)),Yt=d((z+F)*(Z-M)),Jt=d(Yt-yn);if(Jt===kd)return this.double();const bn=d(B*aI*ae),Kt=d(C*aI*J),En=Kt+bn,Xe=Yt+yn,at=Kt-bn,rt=d(En*Jt),lt=d(Xe*at),yt=d(En*at),oe=d(Jt*Xe);return new I(rt,lt,oe,yt)}const we=d(F*M),he=d(z*Z),xe=d(C*q*ae),Se=d(B*J),Re=d((F+z)*(M+Z)-we-he),et=Se-xe,Me=Se+xe,Fe=d(he-P*we),ht=d(Re*et),Dt=d(Me*Fe),At=d(Re*Fe),Wt=d(et*Me);return new I(ht,Dt,Wt,At)}subtract(R){return this.add(R.negate())}wNAF(R){return U.wNAFCached(this,R,I.normalizeZ)}multiply(R){const P=R;gA("scalar",P,Gc,r);const{p:q,f:F}=this.wNAF(P);return I.normalizeZ([q,F])[0]}multiplyUnsafe(R,P=I.ZERO){const q=R;return gA("scalar",q,kd,r),q===kd?L:this.is0()||q===Gc?this:U.wNAFCachedUnsafe(this,q,I.normalizeZ,P)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return U.unsafeLadder(this,r).is0()}toAffine(R){return T(this,R)}clearCofactor(){const{h:R}=e;return R===Gc?this:this.multiplyUnsafe(R)}static fromHex(R,P=!1){const{d:q,a:F}=e,z=t.BYTES;R=kp("pointHex",R,z),Pk("zip215",P);const B=R.slice(),C=R[z-1];B[z-1]=C&-129;const M=d6(B),Z=P?u:t.ORDER;gA("pointHex.y",M,kd,Z);const J=d(M*M),ae=d(J-Gc),we=d(q*J-F);let{isValid:he,value:xe}=m(ae,we);if(!he)throw new Error("Point.fromHex: invalid y coordinate");const Se=(xe&Gc)===Gc,Re=(C&128)!==0;if(!P&&xe===kd&&Re)throw new Error("Point.fromHex: x=0 and x_0=1");return Re!==Se&&(xe=d(-xe)),I.fromAffine({x:xe,y:M})}static fromPrivateKey(R){return k(R).point}toRawBytes(){const{x:R,y:P}=this.toAffine(),q=VD(P,t.BYTES);return q[q.length-1]|=R&Gc?128:0,q}toHex(){return h$(this.toRawBytes())}}I.BASE=new I(e.Gx,e.Gy,Gc,d(e.Gx*e.Gy)),I.ZERO=new I(kd,Gc,Gc,kd);const{BASE:H,ZERO:L}=I,U=Mge(I,a*8);function K(_){return yo(_,r)}function Y(_){return K(d6(_))}function k(_){const R=t.BYTES;_=kp("private key",_,R);const P=kp("hashed private key",s(_),2*R),q=w(P.slice(0,R)),F=P.slice(R,2*R),z=Y(q),B=H.multiply(z),C=B.toRawBytes();return{head:q,prefix:F,scalar:z,point:B,pointBytes:C}}function j(_){return k(_).pointBytes}function V(_=new Uint8Array,...R){const P=CF(...R);return Y(s(y(P,kp("context",_),!!i)))}function W(_,R,P={}){_=kp("message",_),i&&(_=i(_));const{prefix:q,scalar:F,pointBytes:z}=k(R),B=V(P.context,q,_),C=H.multiply(B).toRawBytes(),M=V(P.context,C,z,_),Z=K(B+M*F);gA("signature.s",Z,kd,r);const J=CF(C,VD(Z,t.BYTES));return kp("result",J,t.BYTES*2)}const $=Dge;function A(_,R,P,q=$){const{context:F,zip215:z}=q,B=t.BYTES;_=kp("signature",_,2*B),R=kp("message",R),P=kp("publicKey",P,B),z!==void 0&&Pk("zip215",z),i&&(R=i(R));const C=d6(_.slice(B,2*B));let M,Z,J;try{M=I.fromHex(P,z),Z=I.fromHex(_.slice(0,B),z),J=H.multiplyUnsafe(C)}catch{return!1}if(!z&&M.isSmallOrder())return!1;const ae=V(F,Z.toRawBytes(),M.toRawBytes(),R);return Z.add(M.multiplyUnsafe(ae)).subtract(J).clearCofactor().equals(I.ZERO)}return H._setWindowSize(8),{CURVE:e,getPublicKey:j,sign:W,verify:A,ExtendedPoint:I,utils:{getExtendedPublicKey:k,randomPrivateKey:()=>o(t.BYTES),precompute(_=8,R=I.BASE){return R._setWindowSize(_),R.multiply(BigInt(3)),R}}}}BigInt(0),BigInt(1);const p$=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),kF=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const $ge=BigInt(1),OF=BigInt(2);BigInt(3);const Uge=BigInt(5),jge=BigInt(8);function zge(n){const e=BigInt(10),t=BigInt(20),r=BigInt(40),i=BigInt(80),s=p$,o=n*n%s*n%s,a=Jh(o,OF,s)*o%s,c=Jh(a,$ge,s)*n%s,u=Jh(c,Uge,s)*c%s,d=Jh(u,e,s)*u%s,f=Jh(d,t,s)*d%s,m=Jh(f,r,s)*f%s,w=Jh(m,i,s)*m%s,y=Jh(w,i,s)*m%s,b=Jh(y,e,s)*u%s;return{pow_p_5_8:Jh(b,OF,s)*n%s,b2:o}}function Fge(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}function Wge(n,e){const t=p$,r=yo(e*e*e,t),i=yo(r*r*e,t),s=zge(n*i).pow_p_5_8;let o=yo(n*r*s,t);const a=yo(e*o*o,t),c=o,u=yo(o*kF,t),d=a===n,f=a===yo(-n,t),m=a===yo(-n*kF,t);return d&&(o=c),(f||m)&&(o=u),Sge(o,t)&&(o=yo(-o,t)),{isValid:d||f,value:o}}const Hge=_J(p$,void 0,!0),Vge={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Hge,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:jge,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:hge,randomBytes:yJ,adjustScalarBytes:Fge,uvRatio:Wge},IJ=Lge(Vge),qge="EdDSA",Kge="JWT",W6=".",O8="base64url",NJ="utf8",RJ="utf8",Yge=":",Gge="did",Zge="key",PF="base58btc",Qge="z",Xge="K36",Jge=32;function g$(n){return globalThis.Buffer!=null?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n}function MJ(n=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?g$(globalThis.Buffer.allocUnsafe(n)):new Uint8Array(n)}function kJ(n,e){e||(e=n.reduce((i,s)=>i+s.length,0));const t=MJ(e);let r=0;for(const i of n)t.set(i,r),r+=i.length;return g$(t)}function eme(n,e){if(n.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<n.length;i++){var s=n.charAt(i),o=s.charCodeAt(0);if(t[o]!==255)throw new TypeError(s+" is ambiguous");t[o]=i}var a=n.length,c=n.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function f(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var b=0,E=0,T=0,N=y.length;T!==N&&y[T]===0;)T++,b++;for(var I=(N-T)*d+1>>>0,H=new Uint8Array(I);T!==N;){for(var L=y[T],U=0,K=I-1;(L!==0||U<E)&&K!==-1;K--,U++)L+=256*H[K]>>>0,H[K]=L%a>>>0,L=L/a>>>0;if(L!==0)throw new Error("Non-zero carry");E=U,T++}for(var Y=I-E;Y!==I&&H[Y]===0;)Y++;for(var k=c.repeat(b);Y<I;++Y)k+=n.charAt(H[Y]);return k}function m(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;var b=0;if(y[b]!==" "){for(var E=0,T=0;y[b]===c;)E++,b++;for(var N=(y.length-b)*u+1>>>0,I=new Uint8Array(N);y[b];){var H=t[y.charCodeAt(b)];if(H===255)return;for(var L=0,U=N-1;(H!==0||L<T)&&U!==-1;U--,L++)H+=a*I[U]>>>0,I[U]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");T=L,b++}if(y[b]!==" "){for(var K=N-T;K!==N&&I[K]===0;)K++;for(var Y=new Uint8Array(E+(N-K)),k=E;K!==N;)Y[k++]=I[K++];return Y}}}function w(y){var b=m(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:m,decode:w}}var tme=eme,nme=tme;const OJ=n=>{if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")},rme=n=>new TextEncoder().encode(n),ime=n=>new TextDecoder().decode(n);let sme=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},ome=class{constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return PJ(this,e)}},ame=class{constructor(e){this.decoders=e}or(e){return PJ(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const PJ=(n,e)=>new ame({...n.decoders||{[n.prefix]:n},...e.decoders||{[e.prefix]:e}});let cme=class{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new sme(e,t,r),this.decoder=new ome(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const P8=({name:n,prefix:e,encode:t,decode:r})=>new cme(n,e,t,r),LC=({prefix:n,name:e,alphabet:t})=>{const{encode:r,decode:i}=nme(t,e);return P8({prefix:n,name:e,encode:r,decode:s=>OJ(i(s))})},lme=(n,e,t,r)=>{const i={};for(let d=0;d<e.length;++d)i[e[d]]=d;let s=n.length;for(;n[s-1]==="=";)--s;const o=new Uint8Array(s*t/8|0);let a=0,c=0,u=0;for(let d=0;d<s;++d){const f=i[n[d]];if(f===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<t|f,a+=t,a>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},ume=(n,e,t)=>{const r=e[e.length-1]==="=",i=(1<<t)-1;let s="",o=0,a=0;for(let c=0;c<n.length;++c)for(a=a<<8|n[c],o+=8;o>t;)o-=t,s+=e[i&a>>o];if(o&&(s+=e[i&a<<t-o]),r)for(;s.length*t&7;)s+="=";return s},ha=({name:n,prefix:e,bitsPerChar:t,alphabet:r})=>P8({prefix:e,name:n,encode(i){return ume(i,r,t)},decode(i){return lme(i,r,t,n)}}),dme=P8({prefix:"\0",name:"identity",encode:n=>ime(n),decode:n=>rme(n)});var hme=Object.freeze({__proto__:null,identity:dme});const fme=ha({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var pme=Object.freeze({__proto__:null,base2:fme});const gme=ha({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var mme=Object.freeze({__proto__:null,base8:gme});const wme=LC({prefix:"9",name:"base10",alphabet:"0123456789"});var yme=Object.freeze({__proto__:null,base10:wme});const bme=ha({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),vme=ha({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var xme=Object.freeze({__proto__:null,base16:bme,base16upper:vme});const Eme=ha({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ame=ha({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Sme=ha({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),_me=ha({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Cme=ha({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Tme=ha({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ime=ha({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Nme=ha({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Rme=ha({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Mme=Object.freeze({__proto__:null,base32:Eme,base32upper:Ame,base32pad:Sme,base32padupper:_me,base32hex:Cme,base32hexupper:Tme,base32hexpad:Ime,base32hexpadupper:Nme,base32z:Rme});const kme=LC({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ome=LC({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Pme=Object.freeze({__proto__:null,base36:kme,base36upper:Ome});const Dme=LC({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Bme=LC({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Lme=Object.freeze({__proto__:null,base58btc:Dme,base58flickr:Bme});const $me=ha({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ume=ha({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),jme=ha({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),zme=ha({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Fme=Object.freeze({__proto__:null,base64:$me,base64pad:Ume,base64url:jme,base64urlpad:zme});const DJ=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ðð
65ð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),Wme=DJ.reduce((n,e,t)=>(n[t]=e,n),[]),Hme=DJ.reduce((n,e,t)=>(n[e.codePointAt(0)]=t,n),[]);function Vme(n){return n.reduce((e,t)=>(e+=Wme[t],e),"")}function qme(n){const e=[];for(const t of n){const r=Hme[t.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(r)}return new Uint8Array(e)}const Kme=P8({prefix:"ð",name:"base256emoji",encode:Vme,decode:qme});var Yme=Object.freeze({__proto__:null,base256emoji:Kme}),Gme=BJ,DF=128,Zme=-128,Qme=Math.pow(2,31);function BJ(n,e,t){e=e||[],t=t||0;for(var r=t;n>=Qme;)e[t++]=n&255|DF,n/=128;for(;n&Zme;)e[t++]=n&255|DF,n>>>=7;return e[t]=n|0,BJ.bytes=t-r+1,e}var Xme=KD,Jme=128,BF=127;function KD(n,r){var t=0,r=r||0,i=0,s=r,o,a=n.length;do{if(s>=a)throw KD.bytes=0,new RangeError("Could not decode varint");o=n[s++],t+=i<28?(o&BF)<<i:(o&BF)*Math.pow(2,i),i+=7}while(o>=Jme);return KD.bytes=s-r,t}var e0e=Math.pow(2,7),t0e=Math.pow(2,14),n0e=Math.pow(2,21),r0e=Math.pow(2,28),i0e=Math.pow(2,35),s0e=Math.pow(2,42),o0e=Math.pow(2,49),a0e=Math.pow(2,56),c0e=Math.pow(2,63),l0e=function(n){return n<e0e?1:n<t0e?2:n<n0e?3:n<r0e?4:n<i0e?5:n<s0e?6:n<o0e?7:n<a0e?8:n<c0e?9:10},u0e={encode:Gme,decode:Xme,encodingLength:l0e},LJ=u0e;const LF=(n,e,t=0)=>(LJ.encode(n,e,t),e),$F=n=>LJ.encodingLength(n),YD=(n,e)=>{const t=e.byteLength,r=$F(n),i=r+$F(t),s=new Uint8Array(i+t);return LF(n,s,0),LF(t,s,r),s.set(e,i),new d0e(n,t,e,s)};
vendor: 4,941 bytes, line 65
65let d0e=class{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}};const $J=({name:n,code:e,encode:t})=>new h0e(n,e,t);let h0e=class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?YD(this.code,t):t.then(r=>YD(this.code,r))}else throw Error("Unknown type, must be binary type")}};const UJ=n=>async e=>new Uint8Array(await crypto.subtle.digest(n,e)),f0e=$J({name:"sha2-256",code:18,encode:UJ("SHA-256")}),p0e=$J({name:"sha2-512",code:19,encode:UJ("SHA-512")});var g0e=Object.freeze({__proto__:null,sha256:f0e,sha512:p0e});const jJ=0,m0e="identity",zJ=OJ,w0e=n=>YD(jJ,zJ(n)),y0e={code:jJ,name:m0e,encode:zJ,digest:w0e};var b0e=Object.freeze({__proto__:null,identity:y0e});new TextEncoder,new TextDecoder;const UF={...hme,...pme,...mme,...yme,...xme,...Mme,...Pme,...Lme,...Fme,...Yme};({...g0e,...b0e});function FJ(n,e,t,r){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:r}}}const jF=FJ("utf8","u",n=>"u"+new TextDecoder("utf8").decode(n),n=>new TextEncoder().encode(n.substring(1))),jk=FJ("ascii","a",n=>{let e="a";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e},n=>{n=n.substring(1);const e=MJ(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}),WJ={utf8:jF,"utf-8":jF,hex:UF.base16,latin1:jk,ascii:jk,binary:jk,...UF};function D8(n,e="utf8"){const t=WJ[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString("utf8"):t.encoder.encode(n).substring(1)}function Kx(n,e="utf8"){const t=WJ[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?g$(globalThis.Buffer.from(n,"utf-8")):t.decoder.decode(`${t.prefix}${n}`)}function zF(n){return a1(D8(Kx(n,O8),NJ))}function H6(n){return D8(Kx(ag(n),NJ),O8)}function HJ(n){const e=Kx(Xge,PF),t=Qge+D8(kJ([e,n]),PF);return[Gge,Zge,t].join(Yge)}function v0e(n){return D8(n,O8)}function x0e(n){return Kx(n,O8)}function E0e(n){return Kx([H6(n.header),H6(n.payload)].join(W6),RJ)}function A0e(n){return[H6(n.header),H6(n.payload),v0e(n.signature)].join(W6)}function GD(n){const e=n.split(W6),t=zF(e[0]),r=zF(e[1]),i=x0e(e[2]),s=Kx(e.slice(0,2).join(W6),RJ);return{header:t,payload:r,signature:i,data:s}}function FF(n=yJ(Jge)){const e=IJ.getPublicKey(n);return{secretKey:kJ([n,e]),publicKey:e}}async function S0e(n,e,t,r,i=Ht.fromMiliseconds(Date.now())){const s={alg:qge,typ:Kge},o=HJ(r.publicKey),a=i+t,c={iss:o,sub:n,aud:e,iat:i,exp:a},u=E0e({header:s,payload:c}),d=IJ.sign(u,r.secretKey.slice(0,32));return A0e({header:s,payload:c,signature:d})}var WF=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))},_0e=function(){function n(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"}return n}(),C0e=function(){function n(e){this.version=e,this.type="node",this.name="node",this.os=Ji.platform}return n}(),T0e=function(){function n(e,t,r,i){this.name=e,this.version=t,this.os=r,this.bot=i,this.type="bot-device"}return n}(),I0e=function(){function n(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return n}(),N0e=function(){function n(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return n}(),R0e=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,M0e=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,HF=3,k0e=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;
vendor: 4,214 bytes, line 65
65\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",R0e]],VF=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function O0e(n){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new N0e:typeof navigator<"u"?D0e(navigator.userAgent):L0e()}function P0e(n){return n!==""&&k0e.reduce(function(e,t){var r=t[0],i=t[1];if(e)return e;var s=i.exec(n);return!!s&&[r,s]},!1)}function D0e(n){var e=P0e(n);if(!e)return null;var t=e[0],r=e[1];if(t==="searchbot")return new I0e;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length<HF&&(i=WF(WF([],i,!0),$0e(HF-i.length),!0)):i=[];var s=i.join("."),o=B0e(n),a=M0e.exec(n);return a&&a[1]?new T0e(t,s,o,a[1]):new _0e(t,s,o)}function B0e(n){for(var e=0,t=VF.length;e<t;e++){var r=VF[e],i=r[0],s=r[1],o=s.exec(n);if(o)return i}return null}function L0e(){var n=typeof Ji<"u"&&Ji.version;return n?new C0e(Ji.version.slice(1)):null}function $0e(n){for(var e=[],t=0;t<n;t++)e.push("0");return e}var Li={},qF;function VJ(){if(qF)return Li;qF=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.getLocalStorage=Li.getLocalStorageOrThrow=Li.getCrypto=Li.getCryptoOrThrow=Li.getLocation=Li.getLocationOrThrow=Li.getNavigator=Li.getNavigatorOrThrow=Li.getDocument=Li.getDocumentOrThrow=Li.getFromWindowOrThrow=Li.getFromWindow=void 0;function n(m){let w;return typeof window<"u"&&typeof window[m]<"u"&&(w=window[m]),w}Li.getFromWindow=n;function e(m){const w=n(m);if(!w)throw new Error(`${m} is not defined in Window`);return w}Li.getFromWindowOrThrow=e;function t(){return e("document")}Li.getDocumentOrThrow=t;function r(){return n("document")}Li.getDocument=r;function i(){return e("navigator")}Li.getNavigatorOrThrow=i;function s(){return n("navigator")}Li.getNavigator=s;function o(){return e("location")}Li.getLocationOrThrow=o;function a(){return n("location")}Li.getLocation=a;function c(){return e("crypto")}Li.getCryptoOrThrow=c;function u(){return n("crypto")}Li.getCrypto=u;function d(){return e("localStorage")}Li.getLocalStorageOrThrow=d;function f(){return n("localStorage")}return Li.getLocalStorage=f,Li}var cg=VJ(),mA={},KF;function U0e(){if(KF)return mA;KF=1,Object.defineProperty(mA,"__esModule",{value:!0}),mA.getWindowMetadata=void 0;const n=VJ();function e(){let t,r;try{t=n.getDocumentOrThrow(),r=n.getLocationOrThrow()}catch{return null}function i(){const w=t.getElementsByTagName("link"),y=[];for(let b=0;b<w.length;b++){const E=w[b],T=E.getAttribute("rel");if(T&&T.toLowerCase().indexOf("icon")>-1){const N=E.getAttribute("href");if(N)if(N.toLowerCase().indexOf("https:")===-1&&N.toLowerCase().indexOf("http:")===-1&&N.indexOf("//")!==0){let I=r.protocol+"//"+r.host;if(N.indexOf("/")===0)I+=N;else{const H=r.pathname.split("/");H.pop();const L=H.join("/");I+=L+"/"+N}y.push(I)}else if(N.indexOf("//")===0){const I=r.protocol+N;y.push(I)}else y.push(N)}}return y}function s(...w){const y=t.getElementsByTagName("meta");for(let b=0;b<y.length;b++){const E=y[b],T=["itemprop","property","name"].map(N=>E.getAttribute(N)).filter(N=>N?w.includes(N):!1);if(T.length&&T){const N=E.getAttribute("content");
65if(N)return N}}return""}function o(){let w=s("name","og:site_name","og:title","twitter:title");return w||(w=t.title),w}function a(){return s("description","og:description","twitter:description","keywords")}const c=o(),u=a(),d=r.origin,f=i();return{description:u,url:d,icons:f,name:c}}return mA.getWindowMetadata=e,mA}var j0e=U0e();function z0e(n){if(n.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let u=0;u<e.length;u++)e[u]=255;for(let u=0;u<n.length;u++){const d=n.charAt(u),f=d.charCodeAt(0);if(e[f]!==255)throw new TypeError(d+" is ambiguous");e[f]=u}const t=n.length,r=n.charAt(0),i=Math.log(t)/Math.log(256),s=Math.log(256)/Math.log(t);function o(u){if(u instanceof Uint8Array||(ArrayBuffer.isView(u)?u=new Uint8Array(u.buffer,u.byteOffset,u.byteLength):Array.isArray(u)&&(u=Uint8Array.from(u))),!(u instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(u.length===0)return"";let d=0,f=0,m=0;const w=u.length;for(;m!==w&&u[m]===0;)m++,d++;const y=(w-m)*s+1>>>0,b=new Uint8Array(y);for(;m!==w;){let N=u[m],I=0;for(let H=y-1;(N!==0||I<f)&&H!==-1;H--,I++)N+=256*b[H]>>>0,b[H]=N%t>>>0,N=N/t>>>0;if(N!==0)throw new Error("Non-zero carry");f=I,m++}let E=y-f;for(;E!==y&&b[E]===0;)E++;let T=r.repeat(d);for(;E<y;++E)T+=n.charAt(b[E]);return T}function a(u){if(typeof u!="string")throw new TypeError("Expected String");if(u.length===0)return new Uint8Array;let d=0,f=0,m=0;for(;u[d]===r;)f++,d++;const w=(u.length-d)*i+1>>>0,y=new Uint8Array(w);for(;d<u.length;){const N=u.charCodeAt(d);if(N>255)return;let I=e[N];if(I===255)return;let H=0;for(let L=w-1;(I!==0||H<m)&&L!==-1;L--,H++)I+=t*y[L]>>>0,y[L]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");m=H,d++}let b=w-m;for(;b!==w&&y[b]===0;)b++;const E=new Uint8Array(f+(w-b));let T=f;for(;b!==w;)E[T++]=y[b++];return E}function c(u){const d=a(u);if(d)return d;throw new Error("Non-base"+t+" character")}return{encode:o,decodeUnsafe:a,decode:c}}var F0e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const Os=z0e(F0e);function W0e(n){const e=n.length;let t=0,r=0;for(;r<e;){let i=n.charCodeAt(r++);if((i&4294967168)===0){t++;continue}else if((i&4294965248)===0)t+=2;else{if(i>=55296&&i<=56319&&r<e){const s=n.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}(i&4294901760)===0?t+=3:t+=4}}return t}function H0e(n,e,t){const r=n.length;let i=t,s=0;for(;s<r;){let o=n.charCodeAt(s++);if((o&4294967168)===0){e[i++]=o;continue}else if((o&4294965248)===0)e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<r){const a=n.charCodeAt(s);(a&64512)===56320&&(++s,o=((o&1023)<<10)+(a&1023)+65536)}(o&4294901760)===0?(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128):(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128)}e[i++]=o&63|128}}const V0e=new TextEncoder,q0e=50;function K0e(n,e,t){V0e.encodeInto(n,e.subarray(t))}function Y0e(n,e,t){n.length>q0e?K0e(n,e,t):H0e(n,e,t)}const G0e=4096;function qJ(n,e,t){let r=e;const i=r+t,s=[];let o="";for(;r<i;){const a=n[r++];if((a&128)===0)s.push(a);else if((a&224)===192){const c=n[r++]&63;s.push((a&31)<<6|c)}else if((a&240)===224){const c=n[r++]&63,u=n[r++]&63;s.push((a&31)<<12|c<<6|u)}else if((a&248)===240){const c=n[r++]&63,u=n[r++]&63,d=n[r++]&63;let f=(a&7)<<18|c<<12|u<<6|d;f>65535&&(f-=65536,s.push(f>>>10&1023|55296),f=56320|f&1023),s.push(f)}else s.push(a);s.length>=G0e&&(o+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o}const Z0e=new TextDecoder,Q0e=200;function X0e(n,e,t){const r=n.subarray(e,e+t);return Z0e.decode(r)}function J0e(n,e,t){return t>Q0e?X0e(n,e,t):qJ(n,e,t)}class cI{constructor(e,t){this.type=e,this.data=t}}class Wl extends Error{constructor(e){super(e);const t=Object.create(Wl.prototype);Object.setPrototypeOf(this,t),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Wl.name})}}const wA=4294967295;function ewe(n,e,t){const r=t/4294967296,i=t;n.setUint32(e,r),n.setUint32(e+4,i)}function KJ(n,e,t){const r=Math.floor(t/4294967296),i=t;n.setUint32(e,r),n.setUint32(e+4,i)}function YJ(n,e){const t=n.getInt32(e),r=n.getUint32(e+4);return t*4294967296+r}function twe(n,e){const t=n.getUint32(e),r=n.getUint32(e+4);return t*4294967296+r}const nwe=-1,rwe=4294967296-1,iwe=17179869184-1;function swe({sec:n,nsec:e}){if(n>=0&&e>=0&&n<=iwe)if(e===0&&n<=rwe){const t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,n),t}else{const t=n/4294967296,r=n&4294967295,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,e<<2|t&3),s.setUint32(4,r),i}else{const t=new Uint8Array(12),r=new DataView(t.buffer);return r.setUint32(0,e),KJ(r,4,n),t}}function owe(n){const e=n.getTime(),t=Math.floor(e/1e3),r=(e-t*1e3)*1e6,i=Math.floor(r/1e9);
vendor: 30,380 bytes, line 65
65return{sec:t+i,nsec:r-i*1e9}}function awe(n){if(n instanceof Date){const e=owe(n);return swe(e)}else return null}function cwe(n){const e=new DataView(n.buffer,n.byteOffset,n.byteLength);switch(n.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const t=e.getUint32(0),r=e.getUint32(4),i=(t&3)*4294967296+r,s=t>>>2;return{sec:i,nsec:s}}case 12:{const t=YJ(e,4),r=e.getUint32(0);return{sec:t,nsec:r}}default:throw new Wl(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${n.length}`)}}function lwe(n){const e=cwe(n);return new Date(e.sec*1e3+e.nsec/1e6)}const uwe={type:nwe,encode:awe,decode:lwe};class V6{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(uwe)}register({type:e,encode:t,decode:r}){if(e>=0)this.encoders[e]=t,this.decoders[e]=r;else{const i=-1-e;this.builtInEncoders[i]=t,this.builtInDecoders[i]=r}}tryToEncode(e,t){for(let r=0;r<this.builtInEncoders.length;r++){const i=this.builtInEncoders[r];if(i!=null){const s=i(e,t);if(s!=null){const o=-1-r;return new cI(o,s)}}}for(let r=0;r<this.encoders.length;r++){const i=this.encoders[r];if(i!=null){const s=i(e,t);if(s!=null){const o=r;return new cI(o,s)}}}return e instanceof cI?e:null}decode(e,t,r){const i=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return i?i(e,t,r):new cI(t,e)}}V6.defaultCodec=new V6;function dwe(n){return n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer}function ZD(n){return n instanceof Uint8Array?n:ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):dwe(n)?new Uint8Array(n):Uint8Array.from(n)}const hwe=100,fwe=2048;let pwe=class GJ{constructor(e){this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??V6.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.maxDepth=(e==null?void 0:e.maxDepth)??hwe,this.initialBufferSize=(e==null?void 0:e.initialBufferSize)??fwe,this.sortKeys=(e==null?void 0:e.sortKeys)??!1,this.forceFloat32=(e==null?void 0:e.forceFloat32)??!1,this.ignoreUndefined=(e==null?void 0:e.ignoreUndefined)??!1,this.forceIntegerToFloat=(e==null?void 0:e.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new GJ({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(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw new Error(`Too deep objects in depth ${t}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){const t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(t*2)}resizeBuffer(e){const t=new ArrayBuffer(e),r=new Uint8Array(t),i=new DataView(t);r.set(this.bytes),this.view=i,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const r=W0e(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),Y0e(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,t){const r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,t);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<4294967296)this.writeU8(198),this.writeU32(t);else throw new Error(`Too large binary: ${t}`);const r=ZD(e);this.writeU8a(r)}encodeArray(e,t){const r=e.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 i of e)this.doEncode(i,t+1)}countWithoutUndefined(e,t){let r=0;for(const i of t)e[i]!==void 0&&r++;return r}encodeMap(e,t){const r=Object.keys(e);this.sortKeys&&r.sort();const i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(const s of r){const o=e[s];this.ignoreUndefined&&o===void 0||(this.encodeString(s),this.doEncode(o,t+1))}}encodeExtension(e){if(typeof e.data=="function"){const r=e.data(this.pos+6),i=r.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(r);return}const t=e.data.length;if(t===1)this.writeU8(212);else if(t===2)this.writeU8(213);else if(t===4)this.writeU8(214);else if(t===8)this.writeU8(215);else if(t===16)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<4294967296)this.writeU8(201),this.writeU32(t);else throw new Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),ewe(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),KJ(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function gwe(n,e){return new pwe(e).encodeSharedRef(n)}function zk(n){return`${n<0?"-":""}0x${Math.abs(n).toString(16).padStart(2,"0")}`}const mwe=16,wwe=16;class ywe{constructor(e=mwe,t=wwe){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let r=0;r<this.maxKeyLength;r++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,r){const i=this.caches[r-1];e:for(const s of i){const o=s.bytes;for(let a=0;a<r;a++)if(o[a]!==e[t+a])continue e;return s.str}return null}store(e,t){const r=this.caches[e.length-1],i={bytes:e,str:t};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)}decode(e,t,r){const i=this.find(e,t,r);if(i!=null)return this.hit++,i;this.miss++;const s=qJ(e,t,r),o=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(o,s),s}}const QD="array",fS="map_key",ZJ="map_value",bwe=n=>{if(typeof n=="string"||typeof n=="number")return n;throw new Wl("The type of key must be string or number but "+typeof n)};class vwe{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=QD,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=fS,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===QD){const r=e;r.size=0,r.array=void 0,r.position=0,r.type=void 0}if(e.type===fS||e.type===ZJ){const r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const yA=-1,m$=new DataView(new ArrayBuffer(0)),xwe=new Uint8Array(m$.buffer);try{m$.getInt8(0)}catch(n){if(!(n instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const YF=new RangeError("Insufficient data"),Ewe=new ywe;let Awe=class QJ{constructor(e){this.totalPos=0,this.pos=0,this.view=m$,this.bytes=xwe,this.headByte=yA,this.stack=new vwe,this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??V6.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.rawStrings=(e==null?void 0:e.rawStrings)??!1,this.maxStrLength=(e==null?void 0:e.maxStrLength)??wA,this.maxBinLength=(e==null?void 0:e.maxBinLength)??wA,this.maxArrayLength=(e==null?void 0:e.maxArrayLength)??wA,this.maxMapLength=(e==null?void 0:e.maxMapLength)??wA,this.maxExtLength=(e==null?void 0:e.maxExtLength)??wA,this.keyDecoder=(e==null?void 0:e.keyDecoder)!==void 0?e.keyDecoder:Ewe,this.mapKeyConverter=(e==null?void 0:e.mapKeyConverter)??bwe}clone(){return new QJ({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=yA,this.stack.reset()}setBuffer(e){const t=ZD(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===yA&&!this.hasRemaining(1))this.setBuffer(e);else{const t=this.bytes.subarray(this.pos),r=ZD(e),i=new Uint8Array(t.length+r.length);i.set(t),i.set(r,t.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:r}=this;return new RangeError(`Extra ${t.byteLength-r} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t=!1,r;for await(const a of e){if(t)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{r=this.doDecodeSync(),t=!0}catch(c){if(!(c instanceof RangeError))throw c}this.totalPos+=this.pos}if(t){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return r}const{headByte:i,pos:s,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${zk(i)} at ${o} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered){yield*this.clone().decodeMultiAsync(e,t);return}try{this.entered=!0;let r=t,i=-1;for await(const s of e){if(t&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),r&&(i=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(o){if(!(o instanceof RangeError))throw o}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else{const i=e-160;t=this.decodeString(i,0)}else if(e===192)t=null;else if(e===194)t=!1;else if(e===195)t=!0;else if(e===202)t=this.readF32();else if(e===203)t=this.readF64();else if(e===204)t=this.readU8();else if(e===205)t=this.readU16();else if(e===206)t=this.readU32();else if(e===207)this.useBigInt64?t=this.readU64AsBigInt():t=this.readU64();else if(e===208)t=this.readI8();else if(e===209)t=this.readI16();else if(e===210)t=this.readI32();else if(e===211)this.useBigInt64?t=this.readI64AsBigInt():t=this.readI64();else if(e===217){const i=this.lookU8();t=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();t=this.decodeString(i,2)}else if(e===219){const i=this.lookU32();t=this.decodeString(i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e===196){const i=this.lookU8();t=this.decodeBinary(i,1)}else if(e===197){const i=this.lookU16();t=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();t=this.decodeBinary(i,4)}else if(e===212)t=this.decodeExtension(1,0);else if(e===213)t=this.decodeExtension(2,0);else if(e===214)t=this.decodeExtension(4,0);else if(e===215)t=this.decodeExtension(8,0);else if(e===216)t=this.decodeExtension(16,0);else if(e===199){const i=this.lookU8();t=this.decodeExtension(i,1)}else if(e===200){const i=this.lookU16();t=this.decodeExtension(i,2)}else if(e===201){const i=this.lookU32();t=this.decodeExtension(i,4)}else throw new Wl(`Unrecognized type byte: ${zk(e)}`);this.complete();const r=this.stack;for(;r.length>0;){const i=r.top();if(i.type===QD)if(i.array[i.position]=t,i.position++,i.position===i.size)t=i.array,r.release(i);else continue e;else if(i.type===fS){if(t==="__proto__")throw new Wl("The key __proto__ is not allowed");i.key=this.mapKeyConverter(t),i.type=ZJ;continue e}else if(i.map[i.key]=t,i.readCount++,i.readCount===i.size)t=i.map,r.release(i);else{i.key=null,i.type=fS;continue e}}return t}}readHeadByte(){return this.headByte===yA&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=yA}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new Wl(`Unrecognized array type byte: ${zk(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new Wl(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new Wl(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){var s;if(e>this.maxStrLength)throw new Wl(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw YF;const r=this.pos+t;let i;return this.stateIsMapKey()&&((s=this.keyDecoder)!=null&&s.canBeCached(e))?i=this.keyDecoder.decode(this.bytes,r,e):i=J0e(this.bytes,r,e),this.pos+=t+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===fS:!1}decodeBinary(e,t){if(e>this.maxBinLength)throw new Wl(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw YF;const r=this.pos+t,i=this.bytes.subarray(r,r+e);return this.pos+=t+e,i}decodeExtension(e,t){if(e>this.maxExtLength)throw new Wl(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const r=this.view.getInt8(this.pos+t),i=this.decodeBinary(e,t+1);return this.extensionCodec.decode(i,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=twe(this.view,this.pos);return this.pos+=8,e}readI64(){const e=YJ(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function Swe(n,e){return new Awe(e).decode(n)}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function _we(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function XJ(n,e){return Array.isArray(e)?e.length===0?!0:n?e.every(t=>typeof t=="string"):e.every(t=>Number.isSafeInteger(t)):!1}function q6(n,e){if(typeof e!="string")throw new Error(`${n}: string expected`);return!0}function w$(n){if(!Number.isSafeInteger(n))throw new Error(`invalid integer: ${n}`)}function XD(n){if(!Array.isArray(n))throw new Error("array expected")}function K6(n,e){if(!XJ(!0,e))throw new Error(`${n}: array of strings expected`)}function Cwe(n,e){if(!XJ(!1,e))throw new Error(`${n}: array of numbers expected`)}function Twe(...n){const e=s=>s,t=(s,o)=>a=>s(o(a)),r=n.map(s=>s.encode).reduceRight(t,e),i=n.map(s=>s.decode).reduce(t,e);return{encode:r,decode:i}}function Iwe(n){const e=typeof n=="string"?n.split(""):n,t=e.length;K6("alphabet",e);const r=new Map(e.map((i,s)=>[i,s]));return{encode:i=>(XD(i),i.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=t)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${n}`);return e[s]})),decode:i=>(XD(i),i.map(s=>{q6("alphabet.decode",s);const o=r.get(s);if(o===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${n}`);return o}))}}function Nwe(n=""){return q6("join",n),{encode:e=>(K6("join.decode",e),e.join(n)),decode:e=>(q6("join.decode",e),e.split(n))}}function Rwe(n,e="="){return w$(n),q6("padding",e),{encode(t){for(K6("padding.encode",t);t.length*n%8;)t.push(e);return t},decode(t){K6("padding.decode",t);let r=t.length;if(r*n%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&t[r-1]===e;r--)if((r-1)*n%8===0)throw new Error("padding: invalid, string has too much padding");return t.slice(0,r)}}}const JJ=(n,e)=>e===0?n:JJ(e,n%e),Y6=(n,e)=>n+(e-JJ(n,e)),Fk=(()=>{let n=[];for(let e=0;e<40;e++)n.push(2**e);return n})();function GF(n,e,t,r){if(XD(n),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(t<=0||t>32)throw new Error(`convertRadix2: wrong to=${t}`);if(Y6(e,t)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${t} carryBits=${Y6(e,t)}`);let i=0,s=0;const o=Fk[e],a=Fk[t]-1,c=[];for(const u of n){if(w$(u),u>=o)throw new Error(`convertRadix2: invalid data word=${u} from=${e}`);if(i=i<<e|u,s+e>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);for(s+=e;s>=t;s-=t)c.push((i>>s-t&a)>>>0);const d=Fk[s];if(d===void 0)throw new Error("invalid carry");i&=d-1}if(i=i<<t-s&a,!r&&s>=e)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&s>0&&c.push(i>>>0),c}function Mwe(n,e=!1){if(w$(n),n<=0||n>32)throw new Error("radix2: bits should be in (0..32]");if(Y6(8,n)>32||Y6(n,8)>32)throw new Error("radix2: carry overflow");return{encode:t=>{if(!_we(t))throw new Error("radix2.encode input should be Uint8Array");return GF(Array.from(t),8,n,!e)},decode:t=>(Cwe("radix2.decode",t),Uint8Array.from(GF(t,n,8,e)))}}const kwe=Twe(Mwe(5),Iwe("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Rwe(5),Nwe(""));function y$(n){return globalThis.Buffer!=null?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n}function eee(n=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?y$(globalThis.Buffer.allocUnsafe(n)):new Uint8Array(n)}function pS(n,e){e||(e=n.reduce((i,s)=>i+s.length,0));const t=eee(e);let r=0;for(const i of n)t.set(i,r),r+=i.length;return y$(t)}function Owe(n,e){if(n.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<n.length;i++){var s=n.charAt(i),o=s.charCodeAt(0);if(t[o]!==255)throw new TypeError(s+" is ambiguous");t[o]=i}var a=n.length,c=n.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function f(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var b=0,E=0,T=0,N=y.length;T!==N&&y[T]===0;)T++,b++;for(var I=(N-T)*d+1>>>0,H=new Uint8Array(I);T!==N;){for(var L=y[T],U=0,K=I-1;(L!==0||U<E)&&K!==-1;K--,U++)L+=256*H[K]>>>0,H[K]=L%a>>>0,L=L/a>>>0;if(L!==0)throw new Error("Non-zero carry");E=U,T++}for(var Y=I-E;Y!==I&&H[Y]===0;)Y++;for(var k=c.repeat(b);Y<I;++Y)k+=n.charAt(H[Y]);return k}function m(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;var b=0;if(y[b]!==" "){for(var E=0,T=0;y[b]===c;)E++,b++;for(var N=(y.length-b)*u+1>>>0,I=new Uint8Array(N);y[b];){var H=t[y.charCodeAt(b)];if(H===255)return;for(var L=0,U=N-1;(H!==0||L<T)&&U!==-1;U--,L++)H+=a*I[U]>>>0,I[U]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");T=L,b++}if(y[b]!==" "){for(var K=N-T;K!==N&&I[K]===0;)K++;for(var Y=new Uint8Array(E+(N-K)),k=E;K!==N;)Y[k++]=I[K++];return Y}}}function w(y){var b=m(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:m,decode:w}}var Pwe=Owe,Dwe=Pwe;const Bwe=n=>{if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")},Lwe=n=>new TextEncoder().encode(n),$we=n=>new TextDecoder().decode(n);class Uwe{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class jwe{constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return tee(this,e)}}class zwe{constructor(e){this.decoders=e}or(e){return tee(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const tee=(n,e)=>new zwe({...n.decoders||{[n.prefix]:n},...e.decoders||{[e.prefix]:e}});class Fwe{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new Uwe(e,t,r),this.decoder=new jwe(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const B8=({name:n,prefix:e,encode:t,decode:r})=>new Fwe(n,e,t,r),$C=({prefix:n,name:e,alphabet:t})=>{const{encode:r,decode:i}=Dwe(t,e);return B8({prefix:n,name:e,encode:r,decode:s=>Bwe(i(s))})},Wwe=(n,e,t,r)=>{const i={};for(let d=0;d<e.length;++d)i[e[d]]=d;let s=n.length;for(;n[s-1]==="=";)--s;const o=new Uint8Array(s*t/8|0);let a=0,c=0,u=0;for(let d=0;d<s;++d){const f=i[n[d]];if(f===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<t|f,a+=t,a>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Hwe=(n,e,t)=>{const r=e[e.length-1]==="=",i=(1<<t)-1;let s="",o=0,a=0;for(let c=0;c<n.length;++c)for(a=a<<8|n[c],o+=8;o>t;)o-=t,s+=e[i&a>>o];if(o&&(s+=e[i&a<<t-o]),r)for(;s.length*t&7;)s+="=";return s},fa=({name:n,prefix:e,bitsPerChar:t,alphabet:r})=>B8({prefix:e,name:n,encode(i){return Hwe(i,r,t)},decode(i){return Wwe(i,r,t,n)}}),Vwe=B8({prefix:"\0",name:"identity",encode:n=>$we(n),decode:n=>Lwe(n)}),qwe=Object.freeze(Object.defineProperty({__proto__:null,identity:Vwe},Symbol.toStringTag,{value:"Module"})),Kwe=fa({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Ywe=Object.freeze(Object.defineProperty({__proto__:null,base2:Kwe},Symbol.toStringTag,{value:"Module"})),Gwe=fa({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Zwe=Object.freeze(Object.defineProperty({__proto__:null,base8:Gwe},Symbol.toStringTag,{value:"Module"})),Qwe=$C({prefix:"9",name:"base10",alphabet:"0123456789"}),Xwe=Object.freeze(Object.defineProperty({__proto__:null,base10:Qwe},Symbol.toStringTag,{value:"Module"})),Jwe=fa({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),eye=fa({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),tye=Object.freeze(Object.defineProperty({__proto__:null,base16:Jwe,base16upper:eye},Symbol.toStringTag,{value:"Module"})),nye=fa({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),rye=fa({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),iye=fa({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),sye=fa({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),oye=fa({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),aye=fa({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),cye=fa({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),lye=fa({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),uye=fa({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),dye=Object.freeze(Object.defineProperty({__proto__:null,base32:nye,base32hex:oye,base32hexpad:cye,base32hexpadupper:lye,base32hexupper:aye,base32pad:iye,base32padupper:sye,base32upper:rye,base32z:uye},Symbol.toStringTag,{value:"Module"})),hye=$C({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),fye=$C({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),pye=Object.freeze(Object.defineProperty({__proto__:null,base36:hye,base36upper:fye},Symbol.toStringTag,{value:"Module"})),gye=$C({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),mye=$C({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),wye=Object.freeze(Object.defineProperty({__proto__:null,base58btc:gye,base58flickr:mye},Symbol.toStringTag,{value:"Module"})),yye=fa({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),bye=fa({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),vye=fa({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),xye=fa({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Eye=Object.freeze(Object.defineProperty({__proto__:null,base64:yye,base64pad:bye,base64url:vye,base64urlpad:xye},Symbol.toStringTag,{value:"Module"})),nee=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ðð
65ð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð ððµðð¤²ð¤ ð¤§ððµð ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),Aye=nee.reduce((n,e,t)=>(n[t]=e,n),[]),Sye=nee.reduce((n,e,t)=>(n[e.codePointAt(0)]=t,n),[]);function _ye(n){return n.reduce((e,t)=>(e+=Aye[t],e),"")}function Cye(n){const e=[];for(const t of n){const r=Sye[t.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(r)}return new Uint8Array(e)}const Tye=B8({prefix:"ð",name:"base256emoji",encode:_ye,decode:Cye}),Iye=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Tye},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const ZF={...qwe,...Ywe,...Zwe,...Xwe,...tye,...dye,...pye,...wye,...Eye,...Iye};function ree(n,e,t,r){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:r}}}const QF=ree("utf8","u",n=>"u"+new TextDecoder("utf8").decode(n),n=>new TextEncoder().encode(n.substring(1))),Wk=ree("ascii","a",n=>{let e="a";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e},n=>{n=n.substring(1);const e=eee(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}),iee={utf8:QF,"utf-8":QF,hex:ZF.base16,latin1:Wk,ascii:Wk,binary:Wk,...ZF};function zu(n,e="utf8"){const t=iee[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?y$(globalThis.Buffer.from(n,"utf-8")):t.decoder.decode(`${t.prefix}${n}`)}function fl(n,e="utf8"){const t=iee[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString("utf8"):t.encoder.encode(n).substring(1)}const Nye={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var Hk,XF;function see(){if(XF)return Hk;XF=1;const n="Input must be an string, Buffer or Uint8Array";function e(o){let a;if(o instanceof Uint8Array)a=o;else if(typeof o=="string")a=new TextEncoder().encode(o);else throw new Error(n);return a}function t(o){return Array.prototype.map.call(o,function(a){return(a<16?"0":"")+a.toString(16)}).join("")}function r(o){return(4294967296+o).toString(16).substring(1)}function i(o,a,c){let u=` 66`+o+" = ";for(let d=0;d<a.length;d+=2){if(c===32)u+=r(a[d]).toUpperCase(),u+=" ",u+=r(a[d+1]).toUpperCase();else if(c===64)u+=r(a[d+1]).toUpperCase(),u+=r(a[d]).toUpperCase();else throw new Error("Invalid size "+c);d%6===4?u+=` 67`+new Array(o.length+4).join(" "):d<a.length-2&&(u+=" ")}console.log(u)}function s(o,a,c){let u=new Date().getTime();const d=new Uint8Array(a);for(let m=0;m<a;m++)d[m]=m%256;const f=new Date().getTime();console.log("Generated random input in "+(f-u)+"ms"),u=f;for(let m=0;m<c;m++){const w=o(d),y=new Date().getTime(),b=y-u;u=y,console.log("Hashed in "+b+"ms: "+w.substring(0,20)+"..."),console.log(Math.round(a/(1<<20)/(b/1e3)*100)/100+" MB PER SECOND")}}return Hk={normalizeInput:e,toHex:t,debugPrint:i,testSpeed:s},Hk}var Vk,JF;function Rye(){if(JF)return Vk;JF=1;const n=see();function e(T,N,I){const H=T[N]+T[I];let L=T[N+1]+T[I+1];H>=4294967296&&L++,T[N]=H,T[N+1]=L}function t(T,N,I,H){let L=T[N]+I;I<0&&(L+=4294967296);let U=T[N+1]+H;L>=4294967296&&U++,T[N]=L,T[N+1]=U}function r(T,N){return T[N]^T[N+1]<<8^T[N+2]<<16^T[N+3]<<24}function i(T,N,I,H,L,U){const K=u[L],Y=u[L+1],k=u[U],j=u[U+1];e(c,T,N),t(c,T,K,Y);let V=c[H]^c[T],W=c[H+1]^c[T+1];c[H]=W,c[H+1]=V,e(c,I,H),V=c[N]^c[I],W=c[N+1]^c[I+1],c[N]=V>>>24^W<<8,c[N+1]=W>>>24^V<<8,e(c,T,N),t(c,T,k,j),V=c[H]^c[T],W=c[H+1]^c[T+1],c[H]=V>>>16^W<<16,c[H+1]=W>>>16^V<<16,e(c,I,H),V=c[N]^c[I],W=c[N+1]^c[I+1],c[N]=W>>>31^V<<1,c[N+1]=V>>>31^W<<1}const s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,
vendor: 6,284 bytes, lines 67-80
676,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],a=new Uint8Array(o.map(function(T){return T*2})),c=new Uint32Array(32),u=new Uint32Array(32);function d(T,N){let I=0;for(I=0;I<16;I++)c[I]=T.h[I],c[I+16]=s[I];for(c[24]=c[24]^T.t,c[25]=c[25]^T.t/4294967296,N&&(c[28]=~c[28],c[29]=~c[29]),I=0;I<32;I++)u[I]=r(T.b,4*I);for(I=0;I<12;I++)i(0,8,16,24,a[I*16+0],a[I*16+1]),i(2,10,18,26,a[I*16+2],a[I*16+3]),i(4,12,20,28,a[I*16+4],a[I*16+5]),i(6,14,22,30,a[I*16+6],a[I*16+7]),i(0,10,20,30,a[I*16+8],a[I*16+9]),i(2,12,22,24,a[I*16+10],a[I*16+11]),i(4,14,16,26,a[I*16+12],a[I*16+13]),i(6,8,18,28,a[I*16+14],a[I*16+15]);for(I=0;I<16;I++)T.h[I]=T.h[I]^c[I]^c[I+16]}const f=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function m(T,N,I,H){if(T===0||T>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(N&&N.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(I&&I.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(H&&H.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const L={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:T};f.fill(0),f[0]=T,N&&(f[1]=N.length),f[2]=1,f[3]=1,I&&f.set(I,32),H&&f.set(H,48);for(let U=0;U<16;U++)L.h[U]=s[U]^r(f,U*4);return N&&(w(L,N),L.c=128),L}function w(T,N){for(let I=0;I<N.length;I++)T.c===128&&(T.t+=T.c,d(T,!1),T.c=0),T.b[T.c++]=N[I]}function y(T){for(T.t+=T.c;T.c<128;)T.b[T.c++]=0;d(T,!0);const N=new Uint8Array(T.outlen);for(let I=0;I<T.outlen;I++)N[I]=T.h[I>>2]>>8*(I&3);return N}function b(T,N,I,H,L){I=I||64,T=n.normalizeInput(T),H&&(H=n.normalizeInput(H)),L&&(L=n.normalizeInput(L));const U=m(I,N,H,L);return w(U,T),y(U)}function E(T,N,I,H,L){const U=b(T,N,I,H,L);return n.toHex(U)}return Vk={blake2b:b,blake2bHex:E,blake2bInit:m,blake2bUpdate:w,blake2bFinal:y},Vk}var qk,eW;function Mye(){if(eW)return qk;eW=1;const n=see();function e(y,b){return y[b]^y[b+1]<<8^y[b+2]<<16^y[b+3]<<24}function t(y,b,E,T,N,I){o[y]=o[y]+o[b]+N,o[T]=r(o[T]^o[y],16),o[E]=o[E]+o[T],o[b]=r(o[b]^o[E],12),o[y]=o[y]+o[b]+I,o[T]=r(o[T]^o[y],8),o[E]=o[E]+o[T],o[b]=r(o[b]^o[E],7)}function r(y,b){return y>>>b^y<<32-b}const i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),o=new Uint32Array(16),a=new Uint32Array(16);function c(y,b){let E=0;for(E=0;E<8;E++)o[E]=y.h[E],o[E+8]=i[E];for(o[12]^=y.t,o[13]^=y.t/4294967296,b&&(o[14]=~o[14]),E=0;E<16;E++)a[E]=e(y.b,4*E);for(E=0;E<10;E++)t(0,4,8,12,a[s[E*16+0]],a[s[E*16+1]]),t(1,5,9,13,a[s[E*16+2]],a[s[E*16+3]]),t(2,6,10,14,a[s[E*16+4]],a[s[E*16+5]]),t(3,7,11,15,a[s[E*16+6]],a[s[E*16+7]]),t(0,5,10,15,a[s[E*16+8]],a[s[E*16+9]]),t(1,6,11,12,a[s[E*16+10]],a[s[E*16+11]]),t(2,7,8,13,a[s[E*16+12]],a[s[E*16+13]]),t(3,4,9,14,a[s[E*16+14]],a[s[E*16+15]]);for(E=0;E<8;E++)y.h[E]^=o[E]^o[E+8]}function u(y,b){if(!(y>0&&y<=32))throw new Error("Incorrect output length, should be in [1, 32]");const E=b?b.length:0;if(b&&!(E>0&&E<=32))throw new Error("Incorrect key length, should be in [1, 32]");const T={h:new Uint32Array(i),b:new Uint8Array(64),c:0,t:0,outlen:y};return T.h[0]^=16842752^E<<8^y,E>0&&(d(T,b),T.c=64),T}function d(y,b){for(let E=0;E<b.length;E++)y.c===64&&(y.t+=y.c,c(y,!1),y.c=0),y.b[y.c++]=b[E]}function f(y){for(y.t+=y.c;y.c<64;)y.b[y.c++]=0;c(y,!0);const b=new Uint8Array(y.outlen);for(let E=0;E<y.outlen;E++)b[E]=y.h[E>>2]>>8*(E&3)&255;return b}function m(y,b,E){E=E||32,y=n.normalizeInput(y);const T=u(E,b);return d(T,y),f(T)}function w(y,b,E){const T=m(y,b,E);return n.toHex(T)}return qk={blake2s:m,blake2sHex:w,blake2sInit:u,blake2sUpdate:d,blake2sFinal:f},qk}var Kk,tW;function kye(){if(tW)return Kk;tW=1;const n=Rye(),e=Mye();return Kk={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:e.blake2s,blake2sHex:e.blake2sHex,blake2sInit:e.blake2sInit,blake2sUpdate:e.blake2sUpdate,blake2sFinal:e.blake2sFinal},Kk}var Oye=kye();const Pye="PARSE_ERROR",Dye="INVALID_REQUEST",Bye="METHOD_NOT_FOUND",Lye="INVALID_PARAMS",oee="INTERNAL_ERROR",b$="SERVER_ERROR",$ye=[-32700,-32600,-32601,-32602,-32603],gS={[Pye]:{code:-32700,message:"Parse error"},[Dye]:{code:-32600,message:"Invalid Request"},[Bye]:{code:-32601,message:"Method not found"},[Lye]:{code:-32602,message:"Invalid params"},[oee]:{code:-32603,message:"Internal error"},[b$]:{code:-32e3,message:"Server error"}},aee=b$;function Uye(n){return $ye.includes(n)}function nW(n){return Object.keys(gS).includes(n)?gS[n]:gS[aee]}function jye(n){const e=Object.values(gS).find(t=>t.code===n);return e||gS[aee]}function cee(n,e,t){return n.message.includes("getaddrinfo ENOTFOUND")||n.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):n}var Yk={};/*! ***************************************************************************** 68Copyright (c) Microsoft Corporation. 69 70Permission to use, copy, modify, and/or distribute this software for any 71purpose with or without fee is hereby granted. 72 73THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 74REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 75AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 76INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 77LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 78OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 79PERFORMANCE OF THIS SOFTWARE. 80***************************************************************************** */var JD=function(n,e){return JD=Object.
vendor: 18,569 bytes, line 80
80setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},JD(n,e)};function zye(n,e){JD(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var e7=function(){return e7=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},e7.apply(this,arguments)};function Fye(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function Wye(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function Hye(n,e){return function(t,r){e(t,r,n)}}function Vye(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function qye(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(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?s(d.value):i(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})}function Kye(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Yye(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function Gye(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function t7(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function lee(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function Zye(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(lee(arguments[e]));return n}function Qye(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function y_(n){return this instanceof y_?(this.v=n,this):new y_(n)}function Xye(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(m){r[m]&&(i[m]=function(w){return new Promise(function(y,b){s.push([m,w,y,b])>1||a(m,w)})})}function a(m,w){try{c(r[m](w))}catch(y){f(s[0][3],y)}}function c(m){m.value instanceof y_?Promise.resolve(m.value.v).then(u,d):f(s[0][2],m)}function u(m){a("next",m)}function d(m){a("throw",m)}function f(m,w){m(w),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Jye(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(o){return(t=!t)?{value:y_(n[i](o)),done:i==="return"}:s?s(o):o}:s}}function e1e(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof t7=="function"?t7(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(a,c){o=n[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function t1e(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function n1e(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}function r1e(n){return n&&n.__esModule?n:{default:n}}function i1e(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function s1e(n,e,t){if(!e.has(n))throw new TypeError("attempted to set private field on non-instance");return e.set(n,t),t}const o1e=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return e7},__asyncDelegator:Jye,__asyncGenerator:Xye,__asyncValues:e1e,__await:y_,__awaiter:qye,__classPrivateFieldGet:i1e,__classPrivateFieldSet:s1e,__createBinding:Yye,__decorate:Wye,__exportStar:Gye,__extends:zye,__generator:Kye,__importDefault:r1e,__importStar:n1e,__makeTemplateObject:t1e,__metadata:Vye,__param:Hye,__read:lee,__rest:Fye,__spread:Zye,__spreadArrays:Qye,__values:t7},Symbol.toStringTag,{value:"Module"})),a1e=Vx(o1e);var Op={},rW;function c1e(){if(rW)return Op;rW=1,Object.defineProperty(Op,"__esModule",{value:!0}),Op.isBrowserCryptoAvailable=Op.getSubtleCrypto=Op.getBrowerCrypto=void 0;function n(){return(globalThis==null?void 0:globalThis.crypto)||(globalThis==null?void 0:globalThis.msCrypto)||{}}Op.getBrowerCrypto=n;function e(){const r=n();return r.subtle||r.webkitSubtle}Op.getSubtleCrypto=e;function t(){return!!n()&&!!e()}return Op.isBrowserCryptoAvailable=t,Op}var Pp={},iW;function l1e(){if(iW)return Pp;iW=1,Object.defineProperty(Pp,"__esModule",{value:!0}),Pp.isBrowser=Pp.isNode=Pp.isReactNative=void 0;function n(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Pp.isReactNative=n;function e(){return typeof Ji<"u"&&typeof Ji.versions<"u"&&typeof Ji.versions.node<"u"}Pp.isNode=e;function t(){return!n()&&!e()}return Pp.isBrowser=t,Pp}var sW;function u1e(){return sW||(sW=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});const e=a1e;e.__exportStar(c1e(),n),e.__exportStar(l1e(),n)}(Yk)),Yk}var d1e=u1e();function ff(n=3){const e=Date.now()*Math.pow(10,n),t=Math.floor(Math.random()*Math.pow(10,n));return e+t}function _y(n=6){return BigInt(ff(n))}function Jm(n,e,t){return{id:t||ff(),jsonrpc:"2.0",method:n,params:e}}function L8(n,e){return{id:n,jsonrpc:"2.0",result:e}}function $8(n,e,t){return{id:n,jsonrpc:"2.0",error:h1e(e)}}function h1e(n,e){return typeof n>"u"?nW(oee):(typeof n=="string"&&(n=Object.assign(Object.assign({},nW(b$)),{message:n})),Uye(n.code)&&(n=jye(n.code)),n)}let f1e=class{},p1e=class extends f1e{constructor(){super()}},g1e=class extends p1e{constructor(e){super()}};const m1e="^https?:",w1e="^wss?:";function y1e(n){const e=n.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function uee(n,e){const t=y1e(n);return typeof t>"u"?!1:new RegExp(e).test(t)}function oW(n){return uee(n,m1e)}function aW(n){return uee(n,w1e)}function b1e(n){return new RegExp("wss?://localhost(:d{2,5})?").test(n)}function dee(n){return typeof n=="object"&&"id"in n&&"jsonrpc"in n&&n.jsonrpc==="2.0"}function v$(n){return dee(n)&&"method"in n}function U8(n){return dee(n)&&(pf(n)||$u(n))}function pf(n){return"result"in n}function $u(n){return"error"in n}let Xu=class extends g1e{constructor(e){super(e),this.events=new Qu.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Jm(e.method,e.params||[],e.id||_y().toString()),t)}async requestStrict(e,t){return new Promise(async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{$u(s)?i(s.error):r(s.result)});try{await this.connection.send(e,t)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),U8(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const v1e=()=>typeof WebSocket<"u"?WebSocket:typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"?globalThis.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),x1e=()=>typeof WebSocket<"u"||typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",cW=n=>n.split("?")[0],lW=10,E1e=v1e();let A1e=class{constructor(e){if(this.url=e,this.events=new Qu.EventEmitter,this.registering=!1,!aW(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=r=>{this.onClose(r),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ag(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!aW(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((r,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));r(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{const i=d1e.isReactNative()?void 0:{rejectUnauthorized:!b1e(e)},s=new E1e(e,[],i);x1e()?s.onerror=o=>{const a=o;r(this.emitError(a.error))}:s.on("error",o=>{r(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),t(s)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?a1(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),i=r.message||r.toString(),s=$8(e,i);this.events.emit("payload",s)}parseError(e,t=this.url){return cee(e,cW(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>lW&&this.events.setMaxListeners(lW)}emitError(e){const t=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${cW(this.url)}`));return this.events.emit("register_error",t),t}};var lI={exports:{}},uW;function S1e(){return uW||(uW=1,function(n,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis,r=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof s<"u"&&s||{},c={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(_){return _&&DataView.prototype.isPrototypeOf(_)}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(_){return _&&d.indexOf(Object.prototype.toString.call(_))>-1};function m(_){if(typeof _!="string"&&(_=String(_)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(_)||_==="")throw new TypeError('Invalid character in header field name: "'+_+'"');return _.toLowerCase()}function w(_){return typeof _!="string"&&(_=String(_)),_}function y(_){var R={next:function(){var P=_.shift();return{done:P===void 0,value:P}}};return c.iterable&&(R[Symbol.iterator]=function(){return R}),R}function b(_){this.map={},_ instanceof b?_.forEach(function(R,P){this.append(P,R)},this):Array.isArray(_)?_.forEach(function(R){if(R.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+R.length);this.append(R[0],R[1])},this):_&&Object.getOwnPropertyNames(_).forEach(function(R){this.append(R,_[R])},this)}b.prototype.append=function(_,R){_=m(_),R=w(R);var P=this.map[_];this.map[_]=P?P+", "+R:R},b.prototype.delete=function(_){delete this.map[m(_)]},b.prototype.get=function(_){return _=m(_),this.has(_)?this.map[_]:null},b.prototype.has=function(_){return this.map.hasOwnProperty(m(_))},b.prototype.set=function(_,R){this.map[m(_)]=w(R)},b.prototype.forEach=function(_,R){for(var P in this.map)this.map.hasOwnProperty(P)&&_.call(R,this.map[P],P,this)},b.prototype.keys=function(){var _=[];return this.forEach(function(R,P){_.push(P)}),y(_)},b.prototype.values=function(){var _=[];return this.forEach(function(R){_.push(R)}),y(_)},b.prototype.entries=function(){var _=[];return this.forEach(function(R,P){_.push([P,R])}),y(_)},c.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function E(_){if(!_._noBody){if(_.bodyUsed)return Promise.reject(new TypeError("Already read"));_.bodyUsed=!0}}function T(_){return new Promise(function(R,P){_.onload=function(){R(_.result)},_.onerror=function(){P(_.error)}})}function N(_){var R=new FileReader,P=T(R);return R.readAsArrayBuffer(_),P}function I(_){var R=new FileReader,P=T(R),q=/charset=([A-Za-z0-9_-]+)/.exec(_.type),F=q?q[1]:"utf-8";return R.readAsText(_,F),P}function H(_){for(var R=new Uint8Array(_),P=new Array(R.length),q=0;q<R.length;q++)P[q]=String.fromCharCode(R[q]);return P.join("")}function L(_){if(_.slice)return _.slice(0);var R=new Uint8Array(_.byteLength);return R.set(new Uint8Array(_)),R.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(_){this.bodyUsed=this.bodyUsed,this._bodyInit=_,_?typeof _=="string"?this._bodyText=_:c.blob&&Blob.prototype.isPrototypeOf(_)?this._bodyBlob=_:c.formData&&FormData.prototype.isPrototypeOf(_)?this._bodyFormData=_:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(_)?this._bodyText=_.toString():c.arrayBuffer&&c.blob&&u(_)?(this._bodyArrayBuffer=L(_.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(_)||f(_))?this._bodyArrayBuffer=L(_):this._bodyText=_=Object.prototype.toString.call(_):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof _=="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(_)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var _=E(this);if(_)return _;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 _=E(this);return _||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(N);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var _=E(this);if(_)return _;if(this._bodyBlob)return I(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(H(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(j)}),this.json=function(){return this.text().then(JSON.parse)},this}var K=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Y(_){var R=_.toUpperCase();return K.indexOf(R)>-1?R:_}function k(_,R){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object c
80onstructor cannot be called as a function.');R=R||{};var P=R.body;if(_ instanceof k){if(_.bodyUsed)throw new TypeError("Already read");this.url=_.url,this.credentials=_.credentials,R.headers||(this.headers=new b(_.headers)),this.method=_.method,this.mode=_.mode,this.signal=_.signal,!P&&_._bodyInit!=null&&(P=_._bodyInit,_.bodyUsed=!0)}else this.url=String(_);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new b(R.headers)),this.method=Y(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal||function(){if("AbortController"in a){var z=new AbortController;return z.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&P)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(P),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var q=/([?&])_=[^&]*/;if(q.test(this.url))this.url=this.url.replace(q,"$1_="+new Date().getTime());else{var F=/\?/;this.url+=(F.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function j(_){var R=new FormData;return _.trim().split("&").forEach(function(P){if(P){var q=P.split("="),F=q.shift().replace(/\+/g," "),z=q.join("=").replace(/\+/g," ");R.append(decodeURIComponent(F),decodeURIComponent(z))}}),R}function V(_){var R=new b,P=_.replace(/\r?\n[\t ]+/g," ");return P.split("\r").map(function(q){return q.indexOf(` 81`)===0?q.substr(1,q.length):q}).forEach(function(q){var F=q.split(":"),z=F.shift().trim();if(z){var B=F.join(":").trim();try{R.append(z,B)}catch(C){console.warn("Response "+C.message)}}}),R}U.call(k.prototype);function W(_,R){if(!(this instanceof W))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=R.statusText===void 0?"":""+R.statusText,this.headers=new b(R.headers),this.url=R.url||"",this._initBody(_)}U.call(W.prototype),W.prototype.clone=function(){return new W(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},W.error=function(){var _=new W(null,{status:200,statusText:""});return _.ok=!1,_.status=0,_.type="error",_};var $=[301,302,303,307,308];W.redirect=function(_,R){if($.indexOf(R)===-1)throw new RangeError("Invalid status code");return new W(null,{status:R,headers:{location:_}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(R,P){this.message=R,this.name=P;var q=Error(R);this.stack=q.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function A(_,R){return new Promise(function(P,q){var F=new k(_,R);if(F.signal&&F.signal.aborted)return q(new o.DOMException("Aborted","AbortError"));var z=new XMLHttpRequest;function B(){z.abort()}z.onload=function(){var Z={statusText:z.statusText,headers:V(z.getAllResponseHeaders()||"")};F.url.indexOf("file://")===0&&(z.status<200||z.status>599)?Z.status=200:Z.status=z.status,Z.url="responseURL"in z?z.responseURL:Z.headers.get("X-Request-URL");var J="response"in z?z.response:z.responseText;setTimeout(function(){P(new W(J,Z))},0)},z.onerror=function(){setTimeout(function(){q(new TypeError("Network request failed"))},0)},z.ontimeout=function(){setTimeout(function(){q(new TypeError("Network request timed out"))},0)},z.onabort=function(){setTimeout(function(){q(new o.DOMException("Aborted","AbortError"))},0)};function C(Z){try{return Z===""&&a.location.href?a.location.href:Z}catch{return Z}}if(z.open(F.method,C(F.url),!0),F.credentials==="include"?z.withCredentials=!0:F.credentials==="omit"&&(z.withCredentials=!1),"responseType"in z&&(c.blob?z.responseType="blob":c.arrayBuffer&&(z.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof b||a.Headers&&R.headers instanceof a.Headers)){var M=[];
81Object.getOwnPropertyNames(R.headers).forEach(function(Z){M.push(m(Z)),z.setRequestHeader(Z,w(R.headers[Z]))}),F.headers.forEach(function(Z,J){M.indexOf(J)===-1&&z.setRequestHeader(J,Z)})}else F.headers.forEach(function(Z,J){z.setRequestHeader(J,Z)});F.signal&&(F.signal.addEventListener("abort",B),z.onreadystatechange=function(){z.readyState===4&&F.signal.removeEventListener("abort",B)}),z.send(typeof F._bodyInit>"u"?null:F._bodyInit)})}return A.polyfill=!0,a.fetch||(a.fetch=A,a.Headers=b,a.Request=k,a.Response=W),o.Headers=b,o.Request=k,o.Response=W,o.fetch=A,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=t.fetch?t:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,n.exports=e}(lI,lI.exports)),lI.exports}var _1e=S1e();const dW=xo(_1e);var C1e=Object.defineProperty,T1e=Object.defineProperties,I1e=Object.getOwnPropertyDescriptors,hW=Object.getOwnPropertySymbols,N1e=Object.prototype.hasOwnProperty,R1e=Object.prototype.propertyIsEnumerable,fW=(n,e,t)=>e in n?C1e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,pW=(n,e)=>{for(var t in e||(e={}))N1e.call(e,t)&&fW(n,t,e[t]);if(hW)for(var t of hW(e))R1e.call(e,t)&&fW(n,t,e[t]);return n},gW=(n,e)=>T1e(n,I1e(e));const M1e={Accept:"application/json","Content-Type":"application/json"},k1e="POST",mW={headers:M1e,method:k1e},wW=10;let dh=class{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new Qu.EventEmitter,this.isAvailable=!1,this.registering=!1,!oW(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=ag(e),r=await(await dW(this.url,gW(pW({},mW),{body:t}))).json();this.onPayload({data:r})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!oW(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((r,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));r()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=ag({id:1,jsonrpc:"2.0",method:"test",params:[]});await dW(e,gW(pW({},mW),{body:t}))}this.onOpen()}catch(t){const r=this.parseError(t);throw this.events.emit("register_error",r),this.onClose(),r}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?a1(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const r=this.parseError(t),i=r.message||r.toString(),s=$8(e,i);this.events.emit("payload",s)}parseError(e,t=this.url){return cee(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>wW&&this.events.setMaxListeners(wW)}},ty=null;const al={getSIWX(){return Ue.state.siwx},async initializeIfEnabled(n=ue.getActiveCaipAddress()){var s,o,a;const e=Ue.state.siwx;if(!(e&&n))return;const[t,r,i]=n.split(":");if(ue.checkIfSupportedNetwork(t,`${t}:${r}`))try{if((s=Ue.state.remoteFeatures)!=null&&s.emailCapture){const u=(o=ue.getAccountData(t))==null?void 0:o.user;await Yn.open({view:"DataCapture",data:{email:(u==null?void 0:u.email)??void 0}});return}if(ty&&await ty,(await e.getSessions(`${t}:${r}`,i)).length)return;await Yn.open({view:"SIWXSignMessage"})}catch(c){console.error("SIWXUtil:initializeIfEnabled",c),xn.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties()}),await((a=nt._getClient())==null?void 0:a.disconnect().catch(console.error)),it.reset("Connect"),Ir.showError("A problem occurred while trying initialize authentication")}},async requestSignMessage(){const n=Ue.state.siwx,e=tt.getPlainAddress(ue.getActiveCaipAddress()),t=kD(),r=nt._getClient();if(!n)throw new Error("SIWX is not enabled");if(!e)throw new Error("No ActiveCaipAddress found");if(!t)throw new Error("No ActiveCaipNetwork or client found");if(!r)throw new Error("No ConnectionController client found");try{const i=await n.createMessage({chainId:t.caipNetworkId,accountAddress:e}),s=i.toString();Ge.getConnectorId(t.chainNamespace)===Be.CONNECTOR_ID.AUTH&&it.pushTransactionStack({});const a=await r.signMessage(s);await n.addSession({data:i,message:s,signature:a}),ue.setLastConnectedSIWECaipNetwork(t),Yn.close(),xn.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:this.getSIWXEventProperties()})}catch(i){const s=this.getSIWXEventProperties();(!Yn.state.open||it.state.view==="ApproveTransaction")&&await Yn.open({view:"SIWXSignMessage"}),Ir.showError("Error signing message"),xn.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:s}),console.error("SWIXUtil:requestSignMessage",i)}},async cancelSignMessage(){var n;try{const e=this.getSIWX();
81if((n=e==null?void 0:e.getRequired)==null?void 0:n.call(e)){const r=ue.getLastConnectedSIWECaipNetwork();if(r){const i=await(e==null?void 0:e.getSessions(r==null?void 0:r.caipNetworkId,tt.getPlainAddress(ue.getActiveCaipAddress())||""));i&&i.length>0?await ue.switchActiveNetwork(r):await nt.disconnect()}else await nt.disconnect()}else Yn.close();Yn.close(),xn.sendEvent({event:"CLICK_CANCEL_SIWX",type:"track",properties:this.getSIWXEventProperties()})}catch(e){console.error("SIWXUtil:cancelSignMessage",e)}},async getAllSessions(){const n=this.getSIWX(),e=ue.getAllRequestedCaipNetworks(),t=[];return await Promise.all(e.map(async r=>{const i=await(n==null?void 0:n.getSessions(r.caipNetworkId,tt.getPlainAddress(ue.getActiveCaipAddress())||""));i&&t.push(...i)})),t},async getSessions(n){const e=Ue.state.siwx;let t=n==null?void 0:n.address;if(!t){const i=ue.getActiveCaipAddress();t=tt.getPlainAddress(i)}let r=n==null?void 0:n.caipNetworkId;if(!r){const i=ue.getActiveCaipNetwork();r=i==null?void 0:i.caipNetworkId}return e&&t&&r?e.getSessions(r,t):[]},async isSIWXCloseDisabled(){var e;const n=this.getSIWX();if(n){const t=it.state.view==="ApproveTransaction",r=it.state.view==="SIWXSignMessage";if(t||r)return((e=n.getRequired)==null?void 0:e.call(n))&&(await this.get
81Sessions()).length===0}return!1},async authConnectorAuthenticate({authConnector:n,chainId:e,socialUri:t,preferredAccountType:r,chainNamespace:i}){var d;const s=al.getSIWX();if(!s||!i.includes(Be.CHAIN.EVM)||(d=Ue.state.remoteFeatures)!=null&&d.emailCapture){const f=await n.connect({chainId:e,socialUri:t,preferredAccountType:r});return{address:f.address,chainId:f.chainId,accounts:f.accounts}}const o=`${i}:${e}`,a=await s.createMessage({chainId:o,accountAddress:"<<AccountAddress>>"}),c={accountAddress:a.accountAddress,chainId:a.chainId,domain:a.domain,uri:a.uri,version:a.version,nonce:a.nonce,notBefore:a.notBefore,statement:a.statement,resources:a.resources,requestId:a.requestId,issuedAt:a.issuedAt,expirationTime:a.expirationTime,serializedMessage:a.toString()},u=await n.connect({chainId:e,socialUri:t,siwxMessage:c,preferredAccountType:r});return c.accountAddress=u.address,c.serializedMessage=u.message||"",u.signature&&u.message&&await al.addEmbeddedWalletSession(c,u.message,u.signature),{address:u.address,chainId:u.chainId,accounts:u.accounts}},async addEmbeddedWalletSession(n,e,t){if(ty)return ty;const r=al.getSIWX();return r?(ty=r.addSession({data:n,message:e,signature:t}).finally(()=>{ty=null}),ty):Promise.resolve()},async universalProviderAuthenticate({universalProvider:n,chains:e,methods:t}){var a,c,u;const r=al.getSIWX(),i=new Set(e.map(d=>d.split(":")[0]));if(!r||i.size!==1||!i.has("eip155"))return!1;const s=await r.createMessage({chainId:((a=kD())==null?void 0:a.caipNetworkId)||"",accountAddress:""}),o=await n.authenticate({nonce:s.nonce,domain:s.domain,uri:s.uri,exp:s.expirationTime,iat:s.issuedAt,nbf:s.notBefore,requestId:s.requestId,version:s.version,resources:s.resources,statement:s.statement,chainId:s.chainId,methods:t,chains:[s.chainId,...e.filter(d=>d!==s.chainId)]});if(Ir.showLoading("Authenticating...",{autoClose:!1}),_t.setConnectedWalletInfo({...o.session.peer.metadata,name:o.session.peer.metadata.name,icon:(c=o.session.peer.metadata.icons)==null?void 0:c[0],type:"WALLET_CONNECT"},Array.from(i)[0]),(u=o==null?void 0:o.auths)!=null&&u.length){const d=o.auths.map(f=>{const m=n.client.formatAuthMessage({request:f.p,iss:f.p.iss});return{data:{...f.p,accountAddress:f.p.iss.split(":").slice(-1).join(""),chainId:f.p.iss.split(":").slice(2,4).join(":"),uri:f.p.aud,version:f.p.version||s.version,expirationTime:f.p.exp,issuedAt:f.p.iat,notBefore:f.p.nbf},message:m,signature:f.s.s,cacao:f}});try{await r.setSessions(d),xn.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:al.getSIWXEventProperties()})}catch(f){throw console.error("SIWX:universalProviderAuth - failed to set sessions",f),xn.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:al.getSIWXEventProperties()}),await n.disconnect().catch(console.error),f}finally{Ir.hide()}}return!0},getSIWXEventProperties(){var e;const n=ue.state.activeChain;if(!n)throw new Error("SIWXUtil:getSIWXEventProperties - namespace is required");return{network:((e=ue.state.activeCaipNetwork)==null?void 0:e.caipNetworkId)||"",isSmartAccount:Xs(n)===fi.ACCOUNT_TYPES.SMART_ACCOUNT}},async clearSessions(){const n=this.getSIWX();n&&await n.setSessions([])}},ss={METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",EIP155:Be.CHAIN.EVM,ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"ID_AUTH"},Tf={ConnectorExplorerIds:{[Be.CONNECTOR_ID.COINBASE]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[Be.CONNECTOR_ID.COINBASE_SDK]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[Be.CONNECTOR_ID.SAFE]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[Be.CONNECTOR_ID.LEDGER]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927",[Be.CONNECTOR_ID.OKX]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496
81a09c0faed0709",[ss.METMASK_CONNECTOR_NAME]:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",[ss.TRUST_CONNECTOR_NAME]:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",[ss.SOLFLARE_CONNECTOR_NAME]:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",[ss.PHANTOM_CONNECTOR_NAME]:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",[ss.COIN98_CONNECTOR_NAME]:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",[ss.MAGIC_EDEN_CONNECTOR_NAME]:"8b830a2b724a9c3fbab63af6f55ed29c9dfa8a55e732dc88c80a196a2ba136c6",[ss.BACKPACK_CONNECTOR_NAME]:"2bd8c14e035c2d48f184aaa168559e86b0e3433228d3c4075900a221785019b0",[ss.BITGET_CONNECTOR_NAME]:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",[ss.FRONTIER_CONNECTOR_NAME]:"85db431492aa2e8672e93f4ea7acf10c88b97b867b0d373107af63dc4880f041",[ss.XVERSE_CONNECTOR_NAME]:"2a87d74ae02e10bdd1f51f7ce6c4e1cc53cd5f2c0b6b5ad0d7b3007d2b13de7b",[ss.LEATHER_CONNECTOR_NAME]:"483afe1df1df63daf313109971ff3ef8356ddf1cc4e45877d205eee0b7893a13"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",11155111:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200"},ConnectorImageIds:{[Be.CONNECTOR_ID.COINBASE]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[Be.CONNECTOR_ID.COINBASE_SDK]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[Be.CONNECTOR_ID.SAFE]:"461db637-8616-43ce-035a-d89b8a1d5800",[Be.CONNECTOR_ID.LEDGER]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[Be.CONNECTOR_ID.WALLET_CONNECT]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[Be.CONNECTOR_ID.INJECTED]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[Be.CONNECTOR_ID.INJECTED]:"Browser Wallet",[Be.CONNECTOR_ID.WALLET_CONNECT]:"WalletConnect",[Be.CONNECTOR_ID.COINBASE]:"Coinbase",[Be.CONNECTOR_ID.COINBASE_SDK]:"Coinbase",[Be.CONNECTOR_ID.LEDGER]:"Ledger",[Be.CONNECTOR_ID.SAFE]:"Safe"}},xi={getCaipTokens(n){if(!n)return;const e={};return Object.entries(n).forEach(([t,r])=>{e[`${ss.EIP155}:${t}`]=r}),e},isLowerCaseMatch(n,e){return(n==null?void 0:n.toLowerCase())===(e==null?void 0:e.toLowerCase())},getActiveNamespaceConnectedToAuth(){const n=ue.state.activeChain;return Be.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>Ge.getConnectorId(e)===Be.CONNECTOR_ID.AUTH&&e===n)},withRetry({conditionFn:n,intervalMs:e,maxRetries:t}){let r=0;return new Promise(i=>{async function s(){return r+=1,await n()?i(!0):r>=t?i(!1):(setTimeout(s,e),null)}s()})}},O1e=new AbortController,Qo={EmbeddedWalletAbortController:O1e,UniversalProviderErrors:{UNAUTHORIZED_DOMAIN_NOT_ALLOWED:{message:"Unauthorized: origin not allowed",alertErrorKey:"ORIGIN_NOT_ALLOWED"},JWT_VALIDATION_ERROR:{message:"JWT validation error: JWT Token is not yet valid",alertErrorKey:"JWT_TOKEN_NOT_VALID"}
81,INVALID_KEY:{message:"Unauthorized: invalid key",alertErrorKey:"INVALID_PROJECT_ID"}},ALERT_ERRORS:{SWITCH_NETWORK_NOT_FOUND:{code:"APKT001",displayMessage:"Network Not Found",debugMessage:"The specified network is not recognized. Please ensure it is included in the `networks` array of your `createAppKit` configuration."},ORIGIN_NOT_ALLOWED:{code:"APKT002",displayMessage:"Invalid App Configuration",debugMessage:()=>`The origin ${A2()?window.origin:"unknown"} is not in your allow list. Please update your allowed domains at https://dashboard.reown.com.`},IFRAME_LOAD_FAILED:{code:"APKT003",displayMessage:"Network Error: Wallet Load Failed",debugMessage:()=>"Failed to load the embedded wallet. This may be due to network issues or server downtime. Please check your network connection and try again shortly. Contact support if the issue persists."},IFRAME_REQUEST_TIMEOUT:{code:"APKT004",displayMessage:"Wallet Request Timeout",debugMessage:()=>"The request to the embedded wallet timed out. Please check your network connection and try again shortly. Contact support if the issue persists."},UNVERIFIED_DOMAIN:{code:"APKT005",displayMessage:"Unverified Domain",debugMessage:()=>"Embedded wallet load failed. Ensure your domain is verified in https://dashboard.reown.com."},JWT_TOKEN_NOT_VALID:{code:"APKT006",displayMessage:"Session Expired",debugMessage:"Your session is invalid or expired. Please check your systemâs date and time settings, then reconnect."},INVALID_PROJECT_ID:{code:"APKT007",displayMessage:"Invalid Project ID",debugMessage:"The specified project ID is invali
81d. Please visit https://dashboard.reown.com to obtain a valid project ID."},PROJECT_ID_NOT_CONFIGURED:{code:"APKT008",displayMessage:"Project ID Missing",debugMessage:"No project ID is configured. You can create and configure a project ID at https://dashboard.reown.com."},SERVER_ERROR_APP_CONFIGURATION:{code:"APKT009",displayMessage:"Server Error",debugMessage:n=>`Unable to fetch App Configuration. ${n}. Please check your network connection and try again shortly. Contact support if the issue persists.`},RATE_LIMITED_APP_CONFIGURATION:{code:"APKT010",displayMessage:"Rate Limited",debugMessage:"You have been rate limited while retrieving App Configuration. Please wait a few minutes and try again. Contact support if the issue persists."}},ALERT_WARNINGS:{LOCAL_CONFIGURATION_IGNORED:{debugMessage:n=>`[Reown Config Notice] ${n}`}}},P1e={createLogger(n,e="error"){const t=qx({level:e}),{logger:r}=c$({opts:t});return r.error=(...i)=>{for(const s of i)if(s instanceof Error){n(s,...i);return}n(void 0,...i)},r}},D1e="rpc.walletconnect.org";function yW(n,e){const t=new URL("https://rpc.walletconnect.org/v1/");return t.searchParams.set("chainId",n),t.searchParams.set("projectId",e),t.toString()}const Gk=["near:mainnet","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","eip155:1101","eip155:56","eip155:42161","eip155:7777777","eip155:59144","eip155:324","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","eip155:5000","solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz","eip155:80084","eip155:5003","eip155:100","eip155:8453","eip155:42220","eip155:1313161555","eip155:17000","eip155:1","eip155:300","eip155:1313161554","eip155:1329","eip155:84532","eip155:421614","eip155:11155111","eip155:8217","eip155:43114","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","eip155:999999999","eip155:11155420","eip155:80002","eip155:97","eip155:43113","eip155:137","eip155:10","eip155:1301","bip122:000000000019d6689c085ae165831e93","bip122:000000000933ea01ad0ee984209779ba"],yy={extendRpcUrlWithProjectId(n,e){let t=!1;try{t=new URL(n).host===D1e}catch{t=!1}if(t){const r=new URL(n);return r.searchParams.has("projectId")||r.searchParams.set("projectId",e),r.toString()}return n},isCaipNetwork(n){return"chainNamespace"in n&&"caipNetworkId"in n},getChainNamespace(n){return this.isCaipNetwork(n)?n.chainNamespace:Be.CHAIN.EVM},getCaipNetworkId(n){return this.isCaipNetwork(n)?n.caipNetworkId:`${Be.CHAIN.EVM}:${n.id}`},getDefaultRpcUrl(n,e,t){var i,s,o;const r=(o=(s=(i=n.rpcUrls)==null?void 0:i.default)==null?void 0:s.http)==null?void 0:o[0];return Gk.includes(e)?yW(e,t):r||""},extendCaipNetwork(n,{customNetworkImageUrls:e,projectId:t,customRpcUrls:r}){var m,w,y,b,E,T,N;const i=this.getChainNamespace(n),s=this.getCaipNetworkId(n),o=(y=(w=(m=n.rpcUrls)==null?void 0:m.default)==null?void 0:w.http)==null?void 0:y[0],a=this.getDefaultRpcUrl(n,s,t),c=((T=(E=(b=n==null?void 0:n.rpcUrls)==null?void 0:b.chainDefault)==null?void 0:E.http)==null?void 0:T[0])||o,u=((N=r==null?void 0:r[s])==null?void 0:N.map(I=>I.url))||[],d=[...u,...a?[a]:[]],f=[...u];return c&&!f.includes(c)&&f.push(c),{...n,chainNamespace:i,caipNetworkId:s,assets:{imageId:Tf.NetworkImageIds[n.id],imageUrl:e==null?void 0:e[n.id]},rpcUrls:{...n.rpcUrls,default:{http:d},chainDefault:{http:f}}}},extendCaipNetworks(n,{customNetworkImageUrls:e,projectId:t,customRpcUrls:r}){return n.map(i=>yy.extendCaipNetwork(i,{customNetworkImageUrls:e,customRpcUrls:r,projectId:t}))},getViemTransport(n,e,t){var i,s,o;const r=[];return t==null||t.forEach(a=>{r.push(tI(a.url,a.config))}),Gk.includes(n.caipNetworkId)&&r.push(tI(yW(n.caipNetworkId,e),{fetchOptions:{headers:{"Content-Type":"text/plain"}}})),(o=(s=(i=n==null?void 0:n.rpcUrls)==null?void 0:i.default)==null?void 0:s.http)==null||o.forEach(a=>{r.push(tI(a))}),Xz(r)},extendWagmiTransports(n,e,t){if(Gk.includes(n.caipNetworkId)){const r=this.getDefaultRpcUrl(n,n.caipNetworkId,e);return Xz([t,tI(r)])}return t},getUnsupportedNetwork(n){return{id:n.split(":")[1],caipNetworkId:n,name:Be.UNSUPPORTED_NETWORK_NAME,chainNamespace:n.split(":")[0],nativeCurrency:{name:"",decimals:0,symbol:""},rpcUrls:{default:{http:[]}}}},getCaipNetworkFromStorage(n){var c;const e=wt.getActiveCaipNetworkId(),t=ue.getAllRequestedCaipNetworks(),r=Array.from(((c=ue.state.chains)==null?void 0:c.keys())||[]),i=e==null?void 0:e.split(":")[0],s=i?r.includes(i):!1,o=t==null?void 0:t.find(u=>u.caipNetworkId===e);return s&&!o&&e?this.getUnsupportedNetwork(e):o||n||(t==null?void 0:t[0])}},G6={eip155:void 0,solana:void 0,polkadot:void 0,bip122:void 0,cosmos:void 0,sui:void 0,stacks:void 0},Zc=Mi({providers:{...G6},providerIds:{...G6}}),Ii={state:Zc,subscribeKey(n,e){return Eo(Zc,n,e)},subscribe(n){return Qs(Zc,()=>{n(Zc)})},subscribeProviders(n){return Qs(Zc.providers,()=>n(Zc.providers))},setProvider(n,e){n&&e&&(Zc.providers[n]=d0(e))},getProvider(n){if(n)return Zc.providers[n]},setProviderId(n,e){e&&(Zc.providerIds[n]=e)},getProviderId(n){if(n)return Zc.providerIds[n]},reset(){Zc.providers={...G6},Zc.providerIds={...G6}},resetChain(n){Zc.providers[n]=void 0,Zc.providerIds[n]=void 0}}
81,bW={transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u},Go={set(n,e){Zl.isClient&&localStorage.setItem(`${fn.STORAGE_KEY}${n}`,e)},get(n){return Zl.isClient?localStorage.getItem(`${fn.STORAGE_KEY}${n}`):null},delete(n,e){Zl.isClient&&(e?localStorage.removeItem(n):localStorage.removeItem(`${fn.STORAGE_KEY}${n}`))}},uI=30*1e3,Zl={checkIfAllowedToTriggerEmail(){const n=Go.get(fn.LAST_EMAIL_LOGIN_TIME);if(n){const e=Date.now()-Number(n);if(e<uI){const t=Math.ceil((uI-e)/1e3);throw new Error(`Please try again after ${t} seconds`)}}},getTimeToNextEmailLogin(){const n=Go.get(fn.LAST_EMAIL_LOGIN_TIME);if(n){const e=Date.now()-Number(n);if(e<uI)return Math.ceil((uI-e)/1e3)}return 0},checkIfRequestExists(n){return fi.NOT_SAFE_RPC_METHODS.includes(n.method)||fi.SAFE_RPC_METHODS.includes(n.method)},getResponseType(n){return typeof n=="string"&&((n==null?void 0:n.match(bW.transactionHash))||(n==null?void 0:n.match(bW.signedMessage)))?fn.RPC_RESPONSE_TYPE_TX:fn.RPC_RESPONSE_TYPE_OBJECT},checkIfRequestIsSafe(n){return fi.SAFE_RPC_METHODS.includes(n.method)},isClient:typeof window<"u"};var ai;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function t(i){throw new Error}n.assertNever=t,n.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},n.getValidEnumValues=i=>{const s=n.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return n.objectValues(o)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},n.find=(i,s)=>{for(const o of i)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ai||(ai={}));var n7;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(n7||(n7={}));const on=ai.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ym=n=>{switch(typeof n){case"undefined":return on.undefined;case"string":return on.string;case"number":return isNaN(n)?on.nan:on.number;case"boolean":return on.boolean;case"function":return on.function;case"bigint":return on.bigint;case"symbol":return on.symbol;case"object":return Array.isArray(n)?on.array:n===null?on.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?on.promise:typeof Map<"u"&&n instanceof Map?on.map:typeof Set<"u"&&n instanceof Set?on.set:typeof Date<"u"&&n instanceof Date?on.date:on.object;default:return on.unknown}}
vendor: 42,229 bytes, line 81
81,Bt=ai.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"]),B1e=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Gd extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let a=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,ai.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}Gd.create=n=>new Gd(n);const b_=(n,e)=>{let t;switch(n.code){case Bt.invalid_type:n.received===on.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case Bt.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,ai.jsonStringifyReplacer)}`;break;case Bt.unrecognized_keys:t=`Unrecognized key(s) in object: ${ai.joinValues(n.keys,", ")}`;break;case Bt.invalid_union:t="Invalid input";break;case Bt.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ai.joinValues(n.options)}`;break;case Bt.invalid_enum_value:t=`Invalid enum value. Expected ${ai.joinValues(n.options)}, received '${n.received}'`;break;case Bt.invalid_arguments:t="Invalid function arguments";break;case Bt.invalid_return_type:t="Invalid function return type";break;case Bt.invalid_date:t="Invalid date";break;case Bt.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:ai.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case Bt.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case Bt.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case Bt.custom:t="Invalid input";break;case Bt.invalid_intersection_types:t="Intersection results could not be merged";break;case Bt.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case Bt.not_finite:t="Number must be finite";break;default:t=e.defaultError,ai.assertNever(n)}return{message:t}};let hee=b_;function L1e(n){hee=n}function Z6(){return hee}const Q6=n=>{const{data:e,path:t,errorMaps:r,issueData:i}=n,s=[...t,...i.path||[]],o={...i,path:s};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},$1e=[];function un(n,e){const t=Q6({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Z6(),b_].filter(r=>!!r)});n.common.issues.push(t)}class Ya{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const i of t){if(i.status==="aborted")return ar;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const i of t)r.push({key:await i.key,value:await i.value});return Ya.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const i of t){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return ar;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const ar=Object.freeze({status:"aborted"}),fee=n=>({status:"dirty",value:n}),Ac=n=>({status:"valid",value:n}),r7=n=>n.status==="aborted",i7=n=>n.status==="dirty",v_=n=>n.status==="valid",X6=n=>typeof Promise<"u"&&n instanceof Promise;var zn;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(zn||(zn={}));class Bf{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vW=(n,e)=>{if(v_(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Gd(n.common.issues);return this._error=t,this._error}}};function dr(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:i}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:t??a.defaultError},description:i}}class Er{constructor(e){this.spa=this.safeParseAsync,this._def=e,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)}get description(){return this._def.description}_getType(e){return Ym(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ym(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ya,ctx:{common:e.parent.common,data:e.data,parsedType:Ym(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(X6(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const i={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ym(e)},s=this._parseSync({data:e,path:i.path,parent:i});return vW(i,s)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ym(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(X6(i)?i:Promise.resolve(i));return vW(r,s)}refine(e,t){const r=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Bt.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof t=="function"?t(r,i):t),!1))}_refinement(e){return new eh({schema:this,typeName:er.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return rg.create(this,this._def)}nullable(){return u1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zd.create(this,this._def)}promise(){return fx.create(this,this._def)}or(e){return S_.create([this,e],this._def)}and(e){return __.create(this,e,this._def)}transform(e){return new eh({...dr(this._def),schema:this,typeName:er.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new R_({...dr(this._def),innerType:this,defaultValue:t,typeName:er.ZodDefault})}brand(){return new gee({typeName:er.ZodBranded,type:this,...dr(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new nN({...dr(this._def),innerType:this,catchValue:t,typeName:er.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return UC.create(this,e)}readonly(){return iN.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const U1e=/^c[^\s-]{8,}$/i,j1e=/^[a-z][a-z0-9]*$/,z1e=/^[0-9A-HJKMNP-TV-Z]{26}$/,F1e=/^[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,W1e=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,H1e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Zk;const V1e=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,q1e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,K1e=n=>n.precision?n.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}Z$`):n.precision===0?n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Y1e(n,e){return!!((e==="v4"||!e)&&V1e.test(n)||(e==="v6"||!e)&&q1e.test(n))}class Vd extends Er{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==on.string){const s=this._getOrReturnCtx(e);return un(s,{code:Bt.invalid_type,expected:on.string,received:s.parsedType}),ar}const r=new Ya;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),un(i,{code:Bt.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),un(i,{code:Bt.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?un(i,{code:Bt.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&un(i,{code:Bt.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")W1e.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"email",code:Bt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Zk||(Zk=new RegExp(H1e,"u")),Zk.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"emoji",code:Bt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")F1e.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"uuid",code:Bt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")U1e.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"cuid",code:Bt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")j1e.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"cuid2",code:Bt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")z1e.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"ulid",code:Bt.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),un(i,{validation:"url",code:Bt.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"regex",code:Bt.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),un(i,{code:Bt.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),un(i,{code:Bt.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),un(i,{code:Bt.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?K1e(s).test(e.data)||(i=this._getOrReturnCtx(e,i),un(i,{code:Bt.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?Y1e(e.data,s.version)||(i=this._getOrReturnCtx(e,i),un(i,{validation:"ip",code:Bt.invalid_string,message:s.message}),r.dirty()):ai.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(i=>e.test(i),{validation:t,code:Bt.invalid_string,...zn.errToObj(r)})}_addCheck(e){return new Vd({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...zn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...zn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...zn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...zn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...zn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...zn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...zn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...zn.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...zn.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...zn.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...zn.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...zn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...zn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...zn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...zn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...zn.errToObj(t)})}nonempty(e){return this.min(1,zn.errToObj(e))}trim(){return new Vd({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Vd({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Vd({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Vd.create=n=>{var e;return new Vd({checks:[],typeName:er.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...dr(n)})};function G1e(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=t>r?t:r,s=parseInt(n.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class f0 extends Er{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==on.number){const s=this._getOrReturnCtx(e);return un(s,{code:Bt.invalid_type,expected:on.number,received:s.parsedType}),ar}let r;const i=new Ya;for(const s of this._def.checks)s.kind==="int"?ai.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),un(r,{code:Bt.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),un(r,{code:Bt.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),un(r,{code:Bt.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?G1e(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),un(r,{code:Bt.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),un(r,{code:Bt.not_finite,message:s.message}),i.dirty()):ai.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,zn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,zn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,zn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,zn.toString(t))}setLimit(e,t,r,i){return new f0({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:zn.toString(i)}]})}_addCheck(e){return new f0({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:zn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:zn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:zn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:zn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:zn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:zn.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ai.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}f0.create=n=>new f0({checks:[],typeName:er.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...dr(n)});class p0 extends Er{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==on.bigint){const s=this._getOrReturnCtx(e);return un(s,{code:Bt.invalid_type,expected:on.bigint,received:s.parsedType}),ar}let r;const i=new Ya;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),un(r,{code:Bt.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),un(r,{code:Bt.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),un(r,{code:Bt.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ai.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,zn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,zn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,zn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,zn.toString(t))}setLimit(e,t,r,i){return new p0({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:zn.toString(i)}]})}_addCheck(e){return new p0({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:zn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:zn.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}p0.create=n=>{var e;return new p0({checks:[],typeName:er.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...dr(n)})};class x_ extends Er{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==on.boolean){const r=this._getOrReturnCtx(e);return un(r,{code:Bt.invalid_type,expected:on.boolean,received:r.parsedType}),ar}return Ac(e.data)}}x_.create=n=>new x_({typeName:er.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...dr(n)});class c1 extends Er{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==on.date){const s=this._getOrReturnCtx(e);return un(s,{code:Bt.invalid_type,expected:on.date,received:s.parsedType}),ar}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return un(s,{code:Bt.invalid_date}),ar}const r=new Ya;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),un(i,{code:Bt.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),un(i,{code:Bt.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ai.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new c1({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:zn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:zn.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}c1.create=n=>new c1({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:er.ZodDate,...dr(n)});class J6 extends Er{_parse(e){if(this._getType(e)!==on.symbol){const r=this._getOrReturnCtx(e);return un(r,{code:Bt.invalid_type,expected:on.symbol,received:r.parsedType}),ar}return Ac(e.data)}}J6.create=n=>new J6({typeName:er.ZodSymbol,...dr(n)});class E_ extends Er{_parse(e){if(this._getType(e)!==on.undefined){const r=this._getOrReturnCtx(e);return un(r,{code:Bt.invalid_type,expected:on.undefined,received:r.parsedType}),ar}return Ac(e.data)}}E_.create=n=>new E_({typeName:er.ZodUndefined,...dr(n)});class A_ extends Er{_parse(e){if(this._getType(e)!==on.null){const r=this._getOrReturnCtx(e);return un(r,{code:Bt.invalid_type,expected:on.null,received:r.parsedType}),ar}return Ac(e.data)}}A_.create=n=>new A_({typeName:er.ZodNull,...dr(n)});class hx extends Er{constructor(){super(...arguments),this._any=!0}_parse(e){return Ac(e.data)}}hx.create=n=>new hx({typeName:er.ZodAny,...dr(n)});class Zy extends Er{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ac(e.data)}}Zy.create=n=>new Zy({typeName:er.ZodUnknown,...dr(n)});class lg extends Er{_parse(e){const t=this._getOrReturnCtx(e);return un(t,{code:Bt.invalid_type,expected:on.never,received:t.parsedType}),ar}}lg.create=n=>new lg({typeName:er.ZodNever,...dr(n)});class eN extends Er{_parse(e){if(this._getType(e)!==on.undefined){const r=this._getOrReturnCtx(e);return un(r,{code:Bt.invalid_type,expected:on.void,received:r.parsedType}),ar}return Ac(e.data)}}eN.create=n=>new eN({typeName:er.ZodVoid,...dr(n)});class Zd extends Er{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==on.array)return un(t,{code:Bt.invalid_type,expected:on.array,received:t.parsedType}),ar;if(i.exactLength!==null){const o=t.data.length>i.exactLength.value,a=t.data.length<i.exactLength.value;(o||a)&&(un(t,{code:o?Bt.too_big:Bt.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(un(t,{code:Bt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(un(t,{code:Bt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>i.type._parseAsync(new Bf(t,o,t.path,a)))).then(o=>Ya.mergeArray(r,o));const s=[...t.data].map((o,a)=>i.type._parseSync(new Bf(t,o,t.path,a)));return Ya.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new Zd({...this._def,minLength:{value:e,message:zn.toString(t)}})}max(e,t){return new Zd({...this._def,maxLength:{value:e,message:zn.toString(t)}})}length(e,t){return new Zd({...this._def,exactLength:{value:e,message:zn.toString(t)}})}nonempty(e){return this.min(1,e)}}Zd.create=(n,e)=>new Zd({type:n,minLength:null,maxLength:null,exactLength:null,typeName:er.ZodArray,...dr(e)});function y2(n){if(n instanceof ys){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=rg.create(y2(r))}return new ys({...n._def,shape:()=>e})}else return n instanceof Zd?new Zd({...n._def,type:y2(n.element)}):n instanceof rg?rg.create(y2(n.unwrap())):n instanceof u1?u1.create(y2(n.unwrap())):n instanceof Lf?Lf.create(n.items.map(e=>y2(e))):n}class ys extends Er{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=ai.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==on.object){const u=this._getOrReturnCtx(e);return un(u,{code:Bt.invalid_type,expected:on.object,received:u.parsedType}),ar}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof lg&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const c=[];for(const u of o){const d=s[u],f=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Bf(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof lg){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")a.length>0&&(un(i,{code:Bt.unrecognized_keys,keys:a}),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 a){const f=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Bf(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key;u.push({key:f,value:await d.value,alwaysSet:d.alwaysSet})}return u}).then(u=>Ya.mergeObjectSync(r,u)):Ya.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return zn.errToObj,new ys({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,r).message)!==null&&o!==void 0?o:r.defaultError;return t.code==="unrecognized_keys"?{message:(a=zn.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new ys({...this._def,unknownKeys:"strip"})}passthrough(){return new ys({...this._def,unknownKeys:"passthrough"})}extend(e){return new ys({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ys({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:er.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ys({...this._def,catchall:e})}pick(e){const t={};return ai.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new ys({...this._def,shape:()=>t})}omit(e){const t={};return ai.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new ys({...this._def,shape:()=>t})}deepPartial(){return y2(this)}partial(e){const t={};return ai.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}),new ys({...this._def,shape:()=>t})}required(e){const t={};return ai.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof rg;)s=s._def.innerType;t[r]=s}}),new ys({...this._def,shape:()=>t})}keyof(){return pee(ai.objectKeys(this.shape))}}ys.create=(n,e)=>new ys({shape:()=>n,unknownKeys:"strip",catchall:lg.create(),typeName:er.ZodObject,...dr(e)});ys.strictCreate=(n,e)=>new ys({shape:()=>n,unknownKeys:"strict",catchall:lg.create(),typeName:er.ZodObject,...dr(e)});ys.lazycreate=(n,e)=>new ys({shape:n,unknownKeys:"strip",catchall:lg.create(),typeName:er.ZodObject,...dr(e)});class S_ extends Er{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Gd(a.ctx.common.issues));return un(t,{code:Bt.invalid_union,unionErrors:o}),ar}if(t.common.async)return Promise.all(r.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of r){const u={...t,common:{...t.common,issues:[]},parent:null},d=c._parseSync({data:t.data,path:t.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Gd(c));return un(t,{code:Bt.invalid_union,unionErrors:a}),ar}}get options(){return this._def.options}}S_.create=(n,e)=>new S_({options:n,typeName:er.ZodUnion,...dr(e)});const h6=n=>n instanceof T_?h6(n.schema):n instanceof eh?h6(n.innerType()):n instanceof I_?[n.value]:n instanceof g0?n.options:n instanceof N_?Object.keys(n.enum):n instanceof R_?h6(n._def.innerType):n instanceof E_?[void 0]:n instanceof A_?[null]:null;class j8 extends Er{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==on.object)return un(t,{code:Bt.invalid_type,expected:on.object,received:t.parsedType}),ar;const r=this.discriminator,i=t.data[r],s=this.optionsMap.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(un(t,{code:Bt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ar)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const i=new Map;for(const s of t){const o=h6(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new j8({typeName:er.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...dr(r)})}}function s7(n,e){const t=Ym(n),r=Ym(e);if(n===e)return{valid:!0,data:n};if(t===on.object&&r===on.object){const i=ai.objectKeys(e),s=ai.objectKeys(n).filter(a=>i.indexOf(a)!==-1),o={...n,...e};for(const a of s){const c=s7(n[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(t===on.array&&r===on.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<n.length;s++){const o=n[s],a=e[s],c=s7(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return t===on.date&&r===on.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class __ extends Er{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(r7(s)||r7(o))return ar;const a=s7(s.value,o.value);return a.valid?((i7(s)||i7(o))&&t.dirty(),{status:t.value,value:a.data}):(un(r,{code:Bt.invalid_intersection_types}),ar)};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(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}__.create=(n,e,t)=>new __({left:n,right:e,typeName:er.ZodIntersection,...dr(t)});class Lf extends Er{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==on.array)return un(r,{code:Bt.invalid_type,expected:on.array,received:r.parsedType}),ar;if(r.data.length<this._def.items.length)return un(r,{code:Bt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ar;!this._def.rest&&r.data.length>this._def.items.length&&(un(r,{code:Bt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Bf(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>Ya.mergeArray(t,o)):Ya.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Lf({...this._def,rest:e})}}Lf.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lf({items:n,typeName:er.ZodTuple,rest:null,...dr(e)})};class C_ extends Er{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==on.object)return un(r,{code:Bt.invalid_type,expected:on.object,received:r.parsedType}),ar;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new Bf(r,a,r.path,a)),value:o._parse(new Bf(r,r.data[a],r.path,a))});return r.common.async?Ya.mergeObjectAsync(t,i):Ya.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof Er?new C_({keyType:e,valueType:t,typeName:er.ZodRecord,...dr(r)}):new C_({keyType:Vd.create(),valueType:e,typeName:er.ZodRecord,...dr(t)})}}class tN extends Er{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==on.map)return un(r,{code:Bt.invalid_type,expected:on.map,received:r.parsedType}),ar;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],u)=>({key:i._parse(new Bf(r,a,r.path,[u,"key"])),value:s._parse(new Bf(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=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 ar;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),a.set(u.value,d.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return ar;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),a.set(u.value,d.value)}return{status:t.value,value:a}}}}tN.create=(n,e,t)=>new tN({valueType:e,keyType:n,typeName:er.ZodMap,...dr(t)});class l1 extends Er{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==on.set)return un(r,{code:Bt.invalid_type,expected:on.set,received:r.parsedType}),ar;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(un(r,{code:Bt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(un(r,{code:Bt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const s=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return ar;d.status==="dirty"&&t.dirty(),u.add(d.value)}return{status:t.value,value:u}}const a=[...r.data.values()].map((c,u)=>s._parse(new Bf(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,t){return new l1({...this._def,minSize:{value:e,message:zn.toString(t)}})}max(e,t){return new l1({...this._def,maxSize:{value:e,message:zn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}l1.create=(n,e)=>new l1({valueType:n,minSize:null,maxSize:null,typeName:er.ZodSet,...dr(e)});class W2 extends Er{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==on.function)return un(t,{code:Bt.invalid_type,expected:on.function,received:t.parsedType}),ar;function r(a,c){return Q6({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Z6(),b_].filter(u=>!!u),issueData:{code:Bt.invalid_arguments,argumentsError:c}})}function i(a,c){return Q6({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Z6(),b_].filter(u=>!!u),issueData:{code:Bt.invalid_return_type,returnTypeError:c}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof fx){const a=this;return Ac(async function(...c){const u=new Gd([]),d=await a._def.args.parseAsync(c,s).catch(w=>{throw u.addIssue(r(c,w)),u}),f=await Reflect.apply(o,this,d);return await a._def.returns._def.type.parseAsync(f,s).catch(w=>{throw u.addIssue(i(f,w)),u})})}else{const a=this;return Ac(function(...c){const u=a._def.args.safeParse(c,s);if(!u.success)throw new Gd([r(c,u.error)]);const d=Reflect.apply(o,this,u.data),f=a._def.returns.safeParse(d,s);if(!f.success)throw new Gd([i(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new W2({...this._def,args:Lf.create(e).rest(Zy.create())})}returns(e){return new W2({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new W2({args:e||Lf.create([]).rest(Zy.create()),returns:t||Zy.create(),typeName:er.ZodFunction,...dr(r)})}}class T_ extends Er{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}T_.create=(n,e)=>new T_({getter:n,typeName:er.ZodLazy,...dr(e)});
vendor: 4,140 bytes, line 81
81class I_ extends Er{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return un(t,{received:t.data,code:Bt.invalid_literal,expected:this._def.value}),ar}return{status:"valid",value:e.data}}get value(){return this._def.value}}I_.create=(n,e)=>new I_({value:n,typeName:er.ZodLiteral,...dr(e)});function pee(n,e){return new g0({values:n,typeName:er.ZodEnum,...dr(e)})}class g0 extends Er{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return un(t,{expected:ai.joinValues(r),received:t.parsedType,code:Bt.invalid_type}),ar}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),r=this._def.values;return un(t,{received:t.data,code:Bt.invalid_enum_value,options:r}),ar}return Ac(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return g0.create(e)}exclude(e){return g0.create(this.options.filter(t=>!e.includes(t)))}}g0.create=pee;class N_ extends Er{_parse(e){const t=ai.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==on.string&&r.parsedType!==on.number){const i=ai.objectValues(t);return un(r,{expected:ai.joinValues(i),received:r.parsedType,code:Bt.invalid_type}),ar}if(t.indexOf(e.data)===-1){const i=ai.objectValues(t);return un(r,{received:r.data,code:Bt.invalid_enum_value,options:i}),ar}return Ac(e.data)}get enum(){return this._def.values}}N_.create=(n,e)=>new N_({values:n,typeName:er.ZodNativeEnum,...dr(e)});class fx extends Er{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==on.promise&&t.common.async===!1)return un(t,{code:Bt.invalid_type,expected:on.promise,received:t.parsedType}),ar;const r=t.parsedType===on.promise?t.data:Promise.resolve(t.data);return Ac(r.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}fx.create=(n,e)=>new fx({type:n,typeName:er.ZodPromise,...dr(e)});class eh extends Er{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===er.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{un(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);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 a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?ar:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?ar:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!v_(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>v_(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:t.value,value:a})):o);ai.assertNever(i)}}eh.create=(n,e,t)=>new eh({schema:n,typeName:er.ZodEffects,effect:e,...dr(t)});eh.createWithPreprocess=(n,e,t)=>new eh({schema:e,effect:{type:"preprocess",transform:n},typeName:er.ZodEffects,...dr(t)});
vendor: 3,444 bytes, line 81
81class rg extends Er{_parse(e){return this._getType(e)===on.undefined?Ac(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rg.create=(n,e)=>new rg({innerType:n,typeName:er.ZodOptional,...dr(e)});class u1 extends Er{_parse(e){return this._getType(e)===on.null?Ac(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}u1.create=(n,e)=>new u1({innerType:n,typeName:er.ZodNullable,...dr(e)});class R_ extends Er{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===on.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}R_.create=(n,e)=>new R_({innerType:n,typeName:er.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...dr(e)});class nN extends Er{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return X6(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Gd(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Gd(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}nN.create=(n,e)=>new nN({innerType:n,typeName:er.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...dr(e)});class rN extends Er{_parse(e){if(this._getType(e)!==on.nan){const r=this._getOrReturnCtx(e);return un(r,{code:Bt.invalid_type,expected:on.nan,received:r.parsedType}),ar}return{status:"valid",value:e.data}}}rN.create=n=>new rN({typeName:er.ZodNaN,...dr(n)});const Z1e=Symbol("zod_brand");class gee extends Er{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class UC extends Er{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ar:s.status==="dirty"?(t.dirty(),fee(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ar:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new UC({in:e,out:t,typeName:er.ZodPipeline})}}class iN extends Er{_parse(e){const t=this._def.innerType._parse(e);return v_(t)&&(t.value=Object.freeze(t.value)),t}}iN.create=(n,e)=>new iN({innerType:n,typeName:er.ZodReadonly,...dr(e)});const mee=(n,e={},t)=>n?hx.create().superRefine((r,i)=>{var s,o;if(!n(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:c})}}):hx.create(),Q1e={object:ys.lazycreate};var er;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",
81n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(er||(er={}));const X1e=(n,e={message:`Input not instance of ${n.name}`})=>mee(t=>t instanceof n,e),wee=Vd.create,yee=f0.create,J1e=rN.create,ebe=p0.create,bee=x_.create,tbe=c1.create,nbe=J6.create,rbe=E_.create,ibe=A_.create,sbe=hx.create,obe=Zy.create,abe=lg.create,cbe=eN.create,lbe=Zd.create,ube=ys.create,dbe=ys.strictCreate,hbe=S_.create,fbe=j8.create,pbe=__.create,gbe=Lf.create,mbe=C_.create,wbe=tN.create,ybe=l1.create,bbe=W2.create,vbe=T_.create,xbe=I_.create,Ebe=g0.create,Abe=N_.create,Sbe=fx.create,xW=eh.create,_be=rg.create,Cbe=u1.create,Tbe=eh.createWithPreprocess,Ibe=UC.create,Nbe=()=>wee().optional(),Rbe=()=>yee().optional(),Mbe=()=>bee().optional(),kbe={string:n=>Vd.create({...n,coerce:!0}),number:n=>f0.create({...n,coerce:!0}),boolean:n=>x_.create({...n,coerce:!0}),bigint:n=>p0.create({...n,coerce:!0}),date:n=>c1.create({...n,coerce:!0})},Obe=ar;var pe=Object.freeze({__proto__:null,defaultErrorMap:b_,setErrorMap:L1e,getErrorMap:Z6,makeIssue:Q6,EMPTY_PATH:$1e,addIssueToContext:un,ParseStatus:Ya,INVALID:ar,DIRTY:fee,OK:Ac,isAborted:r7,isDirty:i7,isValid:v_,isAsync:X6,get util(){return ai},get objectUtil(){return n7},ZodParsedType:on,getParsedType:Ym,ZodType:Er,ZodString:Vd,ZodNumber:f0,ZodBigInt:p0,ZodBoolean:x_,ZodDate:c1,ZodSymbol:J6,ZodUndefined:E_,ZodNull:A_,ZodAny:hx,ZodUnknown:Zy,ZodNever:lg,ZodVoid:eN,ZodArray:Zd,ZodObject:ys,ZodUnion:S_,ZodDiscriminatedUnion:j8,ZodIntersection:__,ZodTuple:Lf,ZodRecord:C_,ZodMap:tN,ZodSet:l1,ZodFunction:W2,ZodLazy:T_,ZodLiteral:I_,ZodEnum:g0,ZodNativeEnum:N_,ZodPromise:fx,ZodEffects:eh,ZodTransformer:eh,ZodOptional:rg,ZodNullable:u1,ZodDefault:R_,ZodCatch:nN,ZodNaN:rN,BRAND:Z1e,ZodBranded:gee,ZodPipeline:UC,ZodReadonly:iN,custom:mee,Schema:Er,ZodSchema:Er,late:Q1e,get ZodFirstPartyTypeKind(){return er},coerce:kbe,any:sbe,array:lbe,bigint:ebe,boolean:bee,date:tbe,discriminatedUnion:fbe,effect:xW,enum:Ebe,function:bbe,instanceof:X1e,intersection:pbe,lazy:vbe,literal:xbe,map:wbe,nan:J1e,nativeEnum:Abe,never:abe,null:ibe,nullable:Cbe,number:yee,object:ube,oboolean:Mbe,onumber:Rbe,optional:_be,ostring:Nbe,pipeline:Ibe,preprocess:Tbe,promise:Sbe,record:mbe,set:ybe,strictObject:dbe,string:wee,symbol:nbe,transformer:xW,tuple:gbe,undefined:rbe,union:hbe,unknown:obe,void:cbe,NEVER:Obe,ZodIssueCode:Bt,quotelessJson:B1e,ZodError:Gd});const Is=pe.object({message:pe.string()});function cn(n){return pe.literal(fn[n])}const z8=pe.object({serializedMessage:pe.string().optional(),accountAddress:pe.string(),chainId:pe.string(),notBefore:pe.string().optional(),domain:pe.string(),uri:pe.string(),version:pe.string(),nonce:pe.string(),statement:pe.string().optional(),resources:pe.array(pe.string()).optional(),requestId:pe.string().optional(),issuedAt:pe.string().optional(),expirationTime:pe.string().optional()});pe.object({accessList:pe.array(pe.string()),blockHash:pe.string().nullable(),blockNumber:pe.string().nullable(),chainId:pe.string().or(pe.number()),from:pe.string(),gas:pe.string(),hash:pe.string(),input:pe.string().nullable(),maxFeePerGas:pe.string(),maxPriorityFeePerGas:pe.string(),nonce:pe.string(),r:pe.string(),s:pe.string(),to:pe.string(),transactionIndex:pe.string().nullable(),type:pe.string(),v:pe.string(),value:pe.string()});const Pbe=pe.object({chainId:pe.string().or(pe.number()),rpcUrl:pe.optional(pe.string())}),Dbe=pe.object({email:pe.string().email()}),Bbe=pe.object({otp:pe.string()}),Lbe=pe.object({uri:pe.string(),preferredAccountType:pe.optional(pe.string()),chainId:pe.optional(pe.string().or(pe.number())),siwxMessage:pe.optional(z8),rpcUrl:pe.optional(pe.string())}),$be=pe.object({chainId:pe.optional(pe.string().or(pe.number())),preferredAccountType:pe.optional(pe.string()),socialUri:pe.optional(pe.string()),siwxMessage:pe.optional(z8),rpcUrl:pe.optional(pe.string())}
81),Ube=pe.object({provider:pe.enum(["google","github","apple","facebook","x","discord"])}),jbe=pe.object({email:pe.string().email()}),zbe=pe.object({otp:pe.string()}),Fbe=pe.object({otp:pe.string()}),Wbe=pe.object({themeMode:pe.optional(pe.enum(["light","dark"])),themeVariables:pe.optional(pe.record(pe.string(),pe.string().or(pe.number()))),w3mThemeVariables:pe.optional(pe.record(pe.string(),pe.string()))}),Hbe=pe.object({metadata:pe.object({name:pe.string(),description:pe.string(),url:pe.string(),icons:pe.array(pe.string())}).optional(),sdkVersion:pe.string().optional(),sdkType:pe.string().optional(),projectId:pe.string()}),Vbe=pe.object({type:pe.string()}),qbe=pe.object({action:pe.enum(["VERIFY_DEVICE","VERIFY_OTP","CONNECT"])}),Kbe=pe.object({url:pe.string()}),Ybe=pe.object({userName:pe.string()}),Gbe=pe.object({email:pe.string().optional().nullable(),address:pe.string(),chainId:pe.string().or(pe.number()),accounts:pe.array(pe.object({address:pe.string(),type:pe.enum([fi.ACCOUNT_TYPES.EOA,fi.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:pe.string().optional().nullable(),preferredAccountType:pe.optional(pe.string()),signature:pe.string().optional(),message:pe.string().optional(),siwxMessage:pe.optional(z8)}),Zbe=pe.object({action:pe.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),Qbe=pe.object({email:pe.string().email().optional().nullable(),address:pe.string(),chainId:pe.string().or(pe.number()),smartAccountDeployed:pe.optional(pe.boolean()),accounts:pe.array(pe.object({address:pe.string(),type:pe.enum([fi.ACCOUNT_TYPES.EOA,fi.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:pe.optional(pe.string()),signature:pe.string().optional(),message:pe.string().optional(),siwxMessage:pe.optional(z8)}),Xbe=pe.object({uri:pe.string()}),Jbe=pe.object({isConnected:pe.boolean()}),eve=pe.object({chainId:pe.string().or(pe.number())}),tve=pe.object({chainId:pe.string().or(pe.number())}),nve=pe.object({newEmail:pe.string().email()}),rve=pe.object({smartAccountEnabledNetworks:pe.array(pe.number())});pe.object({address:pe.string(),isDeployed:pe.boolean()});const ive=pe.object({version:pe.string().optional()}),sve=pe.object({type:pe.string(),address:pe.string()}),ove=pe.any(),ave=pe.object({method:pe.literal("eth_accounts")}),cve=pe.object({method:pe.literal("eth_blockNumber")}),lve=pe.object({method:pe.literal("eth_call"),params:pe.array(pe.any())}),uve=pe.object({method:pe.literal("eth_chainId")}),dve=pe.object({method:pe.literal("eth_estimateGas"),params:pe.array(pe.any())}),hve=pe.object({method:pe.literal("eth_feeHistory"),params:pe.array(pe.any())}),fve=pe.object({method:pe.literal("eth_gasPrice")}),pve=pe.object({method:pe.literal("eth_getAccount"),params:pe.array(pe.any())}),gve=pe.object({method:pe.literal("eth_getBalance"),params:pe.array(pe.any())}),mve=pe.object({method:pe.literal("eth_getBlockByHash"),params:pe.array(pe.any())}),wve=pe.object({method:pe.literal("eth_getBlockByNumber"),params:pe.array(pe.any())}),yve=pe.object({method:pe.literal("eth_getBlockReceipts"),params:pe.array(pe.any())}),bve=pe.object({method:pe.literal("eth_getBlockTransactionCountByHash"),params:pe.array(pe.any())}),vve=pe.object({method:pe.literal("eth_getBlockTransactionCountByNumber"),params:pe.array(pe.any())}),xve=pe.object({method:pe.literal("eth_getCode"),params:pe.array(pe.any())}),Eve=pe.object({method:pe.literal("eth_getFilterChanges"),params:pe.array(pe.any())}),Ave=pe.object({method:pe.literal("eth_getFilterLogs"),params:pe.array(pe.any())}),Sve=pe.object({method:pe.literal("eth_getLogs"),params:pe.array(pe.any())}),_ve=pe.object({method:pe.literal("eth_getProof"),params:pe.array(pe.any())}),Cve=pe.object({method:pe.literal("eth_getStorageAt"),params:pe.array(pe.any())}),Tve=pe.object({method:pe.literal("eth_getTransactionByBlockHashAndIndex"),params:pe.array(pe.any())}),Ive=pe.object({method:pe.literal("eth_getTransactionByBlockNumberAndIndex"),params:pe.array(pe.any())}),Nve=pe.object({method:pe.literal("eth_getTransactionByHash"),params:pe.array(pe.any())}),Rve=pe.object({method:pe.literal("eth_getTransactionCount"),params:pe.array(pe.any())}),Mve=pe.object({method:pe.literal("eth_getTransactionReceipt"),params:pe.array(pe.any())}),kve=pe.object({method:pe.literal("eth_getUncleCountByBlockHash"),params:pe.array(pe.any())}),Ove=pe.object({method:pe.literal("eth_getUncleCountByBlockNumber"),params:pe.array(pe.any())}),Pve=pe.object({method:pe.literal("eth_maxPriorityFeePerGas")}),Dve=pe.object({method:pe.literal("eth_newBlockFilter")}),Bve=pe.object({method:pe.literal("eth_newFilter"),params:pe.array(pe.any())}),Lve=pe.object({method:pe.literal("eth_newPendingTransactionFilter")}),$ve=pe.object({method:pe.literal("eth_sendRawTransaction"),params:pe.array(pe.any())}),Uve=pe.object({method:pe.literal("eth_syncing"),params:pe.array(pe.any())}),jve=pe.object({method:pe.literal("eth_uninstallFilter"),params:pe.array(pe.any())}),EW=pe.object({method:pe.literal("personal_sign"),params:pe.array(pe.any())}),zve=pe.object({method:pe.literal("eth_signTypedData_v4"),params:pe.array(pe.any())}),Fve=pe.object({method:pe.literal("eth_sendTransaction"),params:pe.array(pe.any())}),Wve=pe.object({method:pe.literal("solana_signMessage"),params:pe.object({message:pe.string(),pubkey:pe.string()})}),Hve=pe.object({method:pe.literal("solana_signTransaction"),params:pe.object({transaction:pe.string()})}),Vve=pe.object({method:pe.literal("solana_signAllTransactions"),params:pe.object({transactions:pe.array(pe.string())})}),qve=pe.object({method:pe.literal("solana_signAndSendTransaction"),params:pe.object({transaction:pe.string(),options:pe.object({skipPreflight:pe.boolean().optional(),preflightCommitment:pe.enum
81(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:pe.number().optional(),minContextSlot:pe.number().optional()}).optional()})}),Kve=pe.object({method:pe.literal("wallet_sendCalls"),params:pe.array(pe.object({chainId:pe.string().or(pe.number()).optional(),from:pe.string().optional(),version:pe.string().optional(),capabilities:pe.any().optional(),calls:pe.array(pe.object({to:pe.string().startsWith("0x"),data:pe.string().startsWith("0x").optional(),value:pe.string().optional()}))}))}),Yve=pe.object({method:pe.literal("wallet_getCallsStatus"),params:pe.array(pe.string())}),Gve=pe.object({method:pe.literal("wallet_getCapabilities"),params:pe.array(pe.string().or(pe.number()).optional()).optional()}),Zve=pe.object({method:pe.literal("wallet_grantPermissions"),params:pe.array(pe.any())}),Qve=pe.object({method:pe.literal("wallet_revokePermissions"),params:pe.any()}),Xve=pe.object({method:pe.literal("wallet_getAssets"),params:pe.any()}),AW=pe.object({token:pe.string()}),ln=pe.object({id:pe.string().optional()}),Qk={appEvent:ln.extend({type:cn("APP_SWITCH_NETWORK"),payload:Pbe}).or(ln.extend({type:cn("APP_CONNECT_EMAIL"),payload:Dbe})).or(ln.extend({type:cn("APP_CONNECT_DEVICE")})).or(ln.extend({type:cn("APP_CONNECT_OTP"),payload:Bbe})).or(ln.extend({type:cn("APP_CONNECT_SOCIAL"),payload:Lbe})).or(ln.extend({type:cn("APP_GET_FARCASTER_URI")})).or(ln.extend({type:cn("APP_CONNECT_FARCASTER")})).or(ln.extend({type:cn("APP_GET_USER"),payload:pe.optional($be)})).or(ln.extend({type:cn("APP_GET_SOCIAL_REDIRECT_URI"),payload:Ube})).or(ln.extend({type:cn("APP_SIGN_OUT")})).or(ln.extend({type:cn("APP_IS_CONNECTED"),payload:pe.optional(AW)})).or(ln.extend({type:cn("APP_GET_CHAIN_ID")})).or(ln.extend({type:cn("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(ln.extend({type:cn("APP_INIT_SMART_ACCOUNT")})).or(ln.extend({type:cn("APP_SET_PREFERRED_ACCOUNT"),payload:Vbe})).or(ln.extend({type:cn("APP_RPC_REQUEST"),payload:EW.or(Xve).or(ave).or(cve).or(lve).or(uve).or(dve).or(hve).or(fve).or(pve).or(gve).or(mve).or(wve).or(yve).or(bve).or(vve).or(xve).or(Eve).or(Ave).or(Sve).or(_ve).or(Cve).or(Tve).or(Ive).or(Nve).or(Rve).or(Mve).or(kve).or(Ove).or(Pve).or(Dve).or(Bve).or(Lve).or($ve).or(Uve).or(jve).or(EW).or(zve).or(Fve).or(Wve).or(Hve).or(Vve).or(qve).or(Yve).or(Kve).or(Gve).or(Zve).or(Qve).and(pe.object({chainId:pe.string().or(pe.number()).optional(),chainNamespace:pe.enum(["eip155","solana","polkadot","bip122","cosmos"]).optional(),rpcUrl:pe.string().optional()}))})).or(ln.extend({type:cn("APP_UPDATE_EMAIL"),payload:jbe})).or(ln.extend({type:cn("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:zbe})).or(ln.extend({type:cn("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:Fbe})).or(ln.extend({type:cn("APP_SYNC_THEME"),payload:Wbe})).or(ln.extend({type:cn("APP_SYNC_DAPP_DATA"),payload:Hbe})).or(ln.extend({type:cn("APP_RELOAD")})).or(ln.extend({type:cn("APP_RPC_ABORT")})),frameEvent:ln.extend({type:cn("FRAME_SWITCH_NETWORK_ERROR"),payload:Is}).or(ln.extend({type:cn("FRAME_SWITCH_NETWORK_SUCCESS"),payload:tve})).or(ln.extend({type:cn("FRAME_CONNECT_EMAIL_SUCCESS"),payload:qbe})).or(ln.extend({type:cn("FRAME_CONNECT_EMAIL_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:Kbe})).or(ln.extend({type:cn("FRAME_GET_FARCASTER_URI_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:Ybe})).or(ln.extend({type:cn("FRAME_CONNECT_FARCASTER_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_CONNECT_OTP_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_CONNECT_OTP_SUCCESS")})).or(ln.extend({type:cn("FRAME_CONNECT_DEVICE_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_CONNECT_DEVICE_SUCCESS")})).or(ln.extend({type:cn("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:Gbe})).or(ln.extend({type:cn("FRAME_CONNECT_SOCIAL_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_GET_USER_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_GET_USER_SUCCESS"),payload:Qbe})).or(ln.extend({type:cn("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:Xbe})).or(ln.extend({type:cn("FRAME_SIGN_OUT_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_SIGN_OUT_SUCCESS")})).or(ln.extend({type:cn("FRAME_IS_CONNECTED_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_IS_CONNECTED_SUCCESS"),payload:Jbe})).or(ln.extend({type:cn("FRAME_GET_CHAIN_ID_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_GET_CHAIN_ID_SUCCESS"),payload:eve})).or(ln.extend({type:cn("FRAME_RPC_REQUEST_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_RPC_REQUEST_SUCCESS"),payload:ove})).or(ln.extend({type:cn("FRAME_SESSION_UPDATE"),payload:AW})).or(ln.extend({type:cn("FRAME_UPDATE_EMAIL_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_UPDATE_EMAIL_SUCCESS"),payload:Zbe})).or(ln.extend({type:cn("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(ln.extend({type:cn("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:nve})).or(ln.extend({type:cn("FRAME_SYNC_THEME_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_SYNC_THEME_SUCCESS")})).or(ln.extend({type:cn("FRAME_SYNC_DAPP_DATA_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(ln.extend({type:cn("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:rve})).or(ln.extend({type:cn("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:sve})).or(ln.extend({type:cn("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_READY"),payload:ive})).or(ln.extend({type:cn("FRAME_RELOAD_ERROR"),payload:Is})).or(ln.extend({type:cn("FRAME_RELOAD_SUCCESS")}))};function Xk(n,e={}){var t;return typeof(e==null?void 0:e.type)=="string"&&((t=e==null?void 0:e.type)==null?void 0:t.includes(n))}function Jve({projectId:n,chainId:e,enableLogger:t,rpcUrl:r=Be.BLOCKCHAIN_API_RPC_URL,enableCloudAuthAccount:i=!1}){const s=new URL(Xue);return s.searchParams.set("projectId",n),s.searchParams.set("chainId",String(e)),s.searchParams.set("version",ede),s.searchParams.set("enableLogger",String(t)),s.searchParams.set("rpcUrl",r),i&&s.searchParams.set("enableCloudAuthAccount","true"),s.toString()}class e2e{constructor({projectId:e,isAppClient:t=!1,chainId:r="eip155:1",enableLogger:i=!0,enableCloudAuthAccount:s=!1,rpcUrl:o=Be.BLOCKCHAIN_API_RPC_URL}){if(this.iframe=null,this.iframeIsReady=!1,this.initFrame=()=>{const a=document.getElementById("w3m-iframe");this.iframe&&!a&&document.body.appendChild(this.iframe)},this.events={registerFrameEventHandler:(a,c,u)=>{function d({data:f}){var w;if(!Xk(fn.FRAME_EVENT_KEY,f))return;const m=Qk.frameEvent.safeParse(f);if(!m.success){console.warn("W3mFrame: invalid frame event",m.error.message);return}((w=m.data)==null?void 0:w.id)===a&&(c(m.data),window.removeEventListener("message",d))}Zl.isClient&&(window.addEventListener("message",d),u.addEventListener("abort",()=>{window.removeEventListener("message",d)}))},onFrameEvent:a=>{Zl.isClient&&window.addEventListener("message",({data:c})=>{if(!Xk(fn.FRAME_EVENT_KEY,c))return;const u=Qk.frameEvent.safeParse(c);u.success?a(u.data):console.warn("W3mFrame: invalid frame event",u.error.message)})},onAppEvent:a=>{Zl.isClient&&window.addEventListener("message",({data:c})=>{if(!Xk(fn.APP_EVENT_KEY,c))return;const u=Qk.appEvent.safeParse(c);u.success||console.warn("W3mFrame: invalid app event",u.error.message),a(c)})},postAppEvent:a=>{var c;if(Zl.isClient){if(!((c=this.iframe)!=null&&c.contentWindow))throw new Error("W3mFrame: iframe is not set");
81this.iframe.contentWindow.postMessage(a,"*")}},postFrameEvent:a=>{if(Zl.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");parent.postMessage(a,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((a,c)=>{this.frameLoadPromiseResolver={resolve:a,reject:c}}),this.rpcUrl=o,t&&(this.frameLoadPromise=new Promise((a,c)=>{this.frameLoadPromiseResolver={resolve:a,reject:c}}),Zl.isClient)){const a=document.createElement("iframe");a.id="w3m-iframe",a.src=Jve({projectId:e,chainId:r,enableLogger:i,rpcUrl:this.rpcUrl,enableCloudAuthAccount:s}),a.name="w3m-secure-iframe",a.style.position="fixed",a.style.zIndex="999999",a.style.display="none",a.style.border="none",a.style.animationDelay="0s, 50ms",a.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",a.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",this.iframe=a,this.iframe.onerror=()=>{var c;(c=this.frameLoadPromiseResolver)==null||c.reject("Unable to load email login dependency")},this.events.onFrameEvent(c=>{var u;c.type==="@w3m-frame/READY"&&(this.iframeIsReady=!0,(u=this.frameLoadPromiseResolver)==null||u.resolve(void 0))})}}get networks(){const e=["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(t=>({[t]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${t}&projectId=${this.projectId}`,chainId:t}}));return Object.assign({},...e)}}class t2e{constructor(e){var s;const t=qx({level:Jue}),{logger:r,chunkLoggerController:i}=c$({opts:t});this.logger=Qa(r,this.constructor.name),this.chunkLoggerController=i,typeof window<"u"&&((s=this.chunkLoggerController)!=null&&s.downloadLogsBlobInBrowser)&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{var o;(o=this.chunkLoggerController)!=null&&o.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:e})})}}class vee{constructor({projectId:e,chainId:t,enableLogger:r=!0,onTimeout:i,abortController:s,getActiveCaipNetwork:o,getCaipNetworks:a,enableCloudAuthAccount:c}){this.openRpcRequests=[],this.isInitialized=!1,r&&(this.w3mLogger=new t2e(e)),this.abortController=s,this.getActiveCaipNetwork=o,this.getCaipNetworks=a;const u=this.getRpcUrl(t);this.w3mFrame=new e2e({projectId:e,isAppClient:!0,chainId:t,enableLogger:r,rpcUrl:u,enableCloudAuthAccount:c}),this.onTimeout=i,this.getLoginEmailUsed()&&this.createFrame()}async createFrame(){this.w3mFrame.initFrame(),this.initPromise=new Promise(e=>{this.w3mFrame.events.onFrameEvent(t=>{t.type===fn.FRAME_READY&&setTimeout(()=>{e()},500)})}),await this.initPromise,this.isInitialized=!0,this.initPromise=void 0}
81async init(){if(!this.isInitialized){if(this.initPromise){await this.initPromise;return}await this.createFrame()}}getLoginEmailUsed(){return!!Go.get(fn.EMAIL_LOGIN_USED_KEY)}getEmail(){return Go.get(fn.EMAIL)}getUsername(){return Go.get(fn.SOCIAL_USERNAME)}async reload(){var e;try{await this.appEvent({type:fn.APP_RELOAD})}catch(t){throw(e=this.w3mLogger)==null||e.logger.error({error:t},"Error reloading iframe"),t}}async connectEmail(e){var t;try{Zl.checkIfAllowedToTriggerEmail(),await this.init();const r=await this.appEvent({type:fn.APP_CONNECT_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),r}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error connecting email"),r}}async connectDevice(){var e;try{return this.appEvent({type:fn.APP_CONNECT_DEVICE})}catch(t){throw(e=this.w3mLogger)==null||e.logger.error({error:t},"Error connecting device"),t}}async connectOtp(e){var t;try{return this.appEvent({type:fn.APP_CONNECT_OTP,payload:e})}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error connecting otp"),r}}async isConnected(){var e;try{if(!this.getLoginEmailUsed())return{isConnected:!1};const t=await this.appEvent({type:fn.APP_IS_CONNECTED});return t!=null&&t.isConnected||this.deleteAuthLoginCache(),t}catch(t){throw this.deleteAuthLoginCache(),(e=this.w3mLogger)==null||e.logger.error({error:t},"Error checking connection"),t}}async getChainId(){var e;try{const t=await this.appEvent({type:fn.APP_GET_CHAIN_ID});return this.setLastUsedChainId(t.chainId),t}catch(t){throw(e=this.w3mLogger)==null||e.logger.error({error:t},"Error getting chain id"),t}}async getSocialRedirectUri(e){var t;try{return await this.init(),this.appEvent({type:fn.APP_GET_SOCIAL_REDIRECT_URI,payload:e})}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error getting social redirect uri"),r}}async updateEmail(e){var t;try{const r=await this.appEvent({type:fn.APP_UPDATE_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),r}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error updating email"),r}}async updateEmailPrimaryOtp(e){var t;try{return this.appEvent({type:fn.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e})}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error updating email primary otp"),r}}async updateEmailSecondaryOtp(e){var t;try{const r=await this.appEvent({type:fn.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e});return this.setLoginSuccess(r.newEmail),r}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error updating email secondary otp"),r}}async syncTheme(e){var t;try{return this.appEvent({type:fn.APP_SYNC_THEME,payload:e})}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error syncing theme"),r}}async syncDappData(e){var t;try{return this.appEvent({type:fn.APP_SYNC_DAPP_DATA,payload:e})}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error syncing dapp data"),r}}async getSmartAccountEnabledNetworks(){var e;try{const t=await this.appEvent({type:fn.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(t.smartAccountEnabledNetworks),t}catch(t){throw this.persistSmartAccountEnabledNetworks([]),(e=this.w3mLogger)==null||e.logger.error({error:t},"Error getting smart account enabled networks"),t}}async setPreferredAccount(e){var t;try{return this.appEvent({type:fn.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}})}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error setting preferred account"),r}}async connect(e){var t,r;if(e!=null&&e.socialUri)try{await this.init();const i=this.getRpcUrl(e.chainId),s=await this.appEvent({type:fn.APP_CONNECT_SOCIAL,payload:{uri:e.socialUri,preferredAccountType:e.preferredAccountType,chainId:e.chainId,siwxMessage:e.siwxMessage,rpcUrl:i}});return s.userName&&this.setSocialLoginSuccess(s.userName),this.setLoginSuccess(s.email),this.setLastUsedChainId(s.chainId),this.user=s,s}catch(i){throw(t=this.w3mLogger)==null||t.logger.error({error:i},"Error connecting social"),i}else try{const i=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1,s=await this.getUser({chainId:i,preferredAccountType:e==null?void 0:e.preferredAccountType,siwxMessage:e==null?void 0:e.siwxMessage,rpcUrl:this.getRpcUrl(i)});
81return this.setLoginSuccess(s.email),this.setLastUsedChainId(s.chainId),this.user=s,s}catch(i){throw(r=this.w3mLogger)==null||r.logger.error({error:i},"Error connecting"),i}}async getUser(e){var t;try{await this.init();const r=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1,i=await this.appEvent({type:fn.APP_GET_USER,payload:{...e,chainId:r,rpcUrl:this.getRpcUrl(r)}});return this.user=i,i}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error connecting"),r}}async connectSocial({uri:e,chainId:t,preferredAccountType:r}){var i;try{await this.init();const s=this.getRpcUrl(t),o=await this.appEvent({type:fn.APP_CONNECT_SOCIAL,payload:{uri:e,chainId:t,rpcUrl:s,preferredAccountType:r}});return o.userName&&this.setSocialLoginSuccess(o.userName),o}catch(s){throw(i=this.w3mLogger)==null||i.logger.error({error:s},"Error connecting social"),s}}async getFarcasterUri(){var e;try{return await this.init(),await this.appEvent({type:fn.APP_GET_FARCASTER_URI})}catch(t){throw(e=this.w3mLogger)==null||e.logger.error({error:t},"Error getting farcaster uri"),t}}async connectFarcaster(){var e;try{const t=await this.appEvent({type:fn.APP_CONNECT_FARCASTER});return t.userName&&this.setSocialLoginSuccess(t.userName),t}catch(t){throw(e=this.w3mLogger)==null||e.logger.error({error:t},"Error connecting farcaster"),t}}async switchNetwork({chainId:e}){var t;try{const r=this.getRpcUrl(e),i=await this.appEvent({type:fn.APP_SWITCH_NETWORK,payload:{chainId:e,rpcUrl:r}});return this.setLastUsedChainId(i.chainId),i}catch(r){throw(t=this.w3mLogger)==null||t.logger.error({error:r},"Error switching network"),r}}async disconnect(){var e;try{return this.deleteAuthLoginCache(),await new Promise(async r=>{const i=setTimeout(()=>{r()},3e3);await this.appEvent({type:fn.APP_SIGN_OUT}),clearTimeout(i),r()})}catch(t){throw(e=this.w3mLogger)==null||e.logger.error({error:t},"Error disconnecting"),t}}async request(e){var r,i,s,o,a;const t=e;try{if(fi.GET_CHAIN_ID===e.method)return this.getLastUsedChainId();const c=e.chainNamespace||"eip155",u=(r=this.getActiveCaipNetwork(c))==null?void 0:r.id;t.chainNamespace=c,t.chainId=u,t.rpcUrl=this.getRpcUrl(u),(i=this.rpcRequestHandler)==null||i.call(this,e);const d=await this.appEvent({type:fn.APP_RPC_REQUEST,payload:t});return(s=this.rpcSuccessHandler)==null||s.call(this,d,t),d}catch(c){throw(o=this.rpcErrorHandler)==null||o.call(this,c,t),(a=this.w3mLogger)==null||a.logger.error({error:c},"Error requesting"),c}}onRpcRequest(e){this.rpcRequestHandler=e}onRpcSuccess(e){this.rpcSuccessHandler=e}onRpcError(e){this.rpcErrorHandler=e}onIsConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===fn.FRAME_IS_CONNECTED_SUCCESS&&t.payload.isConnected&&e()})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===fn.FRAME_IS_CONNECTED_ERROR&&e(),t.type===fn.FRAME_IS_CONNECTED_SUCCESS&&!t.payload.isConnected&&e()})}onConnect(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===fn.FRAME_GET_USER_SUCCESS&&e(t.payload)})}onSocialConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===fn.FRAME_CONNECT_SOCIAL_SUCCESS&&e(t.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===fn.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(t.payload):t.type===fn.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:fi.ACCOUNT_TYPES.EOA})})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}async rejectRpcRequests(){var e;try{await Promise.all(this.openRpcRequests.map(async({abortController:t,method:r})=>{fi.SAFE_RPC_METHODS.includes(r)||t.abort(),await this.appEvent({type:fn.APP_RPC_ABORT})})),this.openRpcRequests=[]}catch(t){(e=this.w3mLogger)==null||e.logger.error({error:t},"Error aborting RPC request")}}async appEvent(e){let t,r;function i(c){return c.replace("@w3m-app/","")}const s=[fn.APP_SYNC_DAPP_DATA,fn.APP_SYNC_THEME,fn.APP_SET_PREFERRED_ACCOUNT],o=i(e.type);return!this.w3mFrame.iframeIsReady&&!s.includes(e.type)&&(r=setTimeout(()=>{var c;(c=this.onTimeout)==null||c.call(this,"iframe_load_failed"),this.abortController.abort()},2e4)),await this.w3mFrame.frameLoadPromise,clearTimeout(r),[fn.APP_CONNECT_EMAIL,fn.APP_CONNECT_DEVICE,fn.APP_CONNECT_OTP,fn.APP_CONNECT_SOCIAL,fn.APP_GET_SOCIAL_REDIRECT_URI].map(i).includes(o)&&(t=setTimeout(()=>{var c;(c=this.onTimeout)==null||c.call(this,"iframe_request_timeout"),this.abortController.abort()},12e4)),new Promise((c,u)=>{var w,y,b;const d=Math.random().toString(36).substring(7);(b=(w=this.w3mLogger)==null?void 0:(y=w.logger).info)==null||b.call(y,{event:e,id:d},"Sending app event"),this.w3mFrame.events.postAppEvent({...e,id:d});const f=new AbortController;if(o==="RPC_REQUEST"){const E=e;this.openRpcRequests=[...this.openRpcRequests,{...E.payload,abortController:f}]}f.signal.addEventListener("abort",()=>{o==="RPC_REQUEST"?u(new Error("Request was aborted")):o!=="GET_FARCASTER_URI"&&u(new Error("Something went wrong"))});function m(E,T){var N,I,H;E.id===d&&((I=T==null?void 0:(N=T.logger).info)==null||I.call(N,{framEvent:E,id:d},"Received frame response"),E.type===`@w3m-frame/${o}_SUCCESS`?(t&&clearTimeout(t),r&&clearTimeout(r),"payload"in E&&c(E.payload),c(void 0)):E.type===`@w3m-frame/${o}_ERROR`&&(t&&clearTimeout(t),r&&clearTimeout(r),"payload"in E&&u(new Error(((H=E.payload)==null?void 0:H.message)||"An error occurred")),u(new Error("An error occurred"))))}this.w3mFrame.events.registerFrameEventHandler(d,E=>m(E,this.w3mLogger),this.abortController.signal)}
81)}setNewLastEmailLoginTime(){Go.set(fn.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){Go.set(fn.SOCIAL_USERNAME,e)}setLoginSuccess(e){e&&Go.set(fn.EMAIL,e),Go.set(fn.EMAIL_LOGIN_USED_KEY,"true"),Go.delete(fn.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){Go.delete(fn.EMAIL_LOGIN_USED_KEY),Go.delete(fn.EMAIL),Go.delete(fn.LAST_USED_CHAIN_KEY),Go.delete(fn.SOCIAL_USERNAME)}setLastUsedChainId(e){e&&Go.set(fn.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){const e=Go.get(fn.LAST_USED_CHAIN_KEY)??void 0,t=Number(e);return isNaN(t)?e:t}persistSmartAccountEnabledNetworks(e){Go.set(fn.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}getRpcUrl(e){var s,o;let t=e===void 0?void 0:"eip155";typeof e=="string"&&(e.includes(":")?t=(s=Ha.parseCaipNetworkId(e))==null?void 0:s.chainNamespace:Number.isInteger(Number(e))?t="eip155":t="solana");const r=this.getCaipNetworks(t),i=e?r.find(a=>String(a.id)===String(e)||a.caipNetworkId===e):r[0];return(o=i==null?void 0:i.rpcUrls.default.http)==null?void 0:o[0]}}class mS{constructor(){}static getInstance({projectId:e,chainId:t,enableLogger:r,onTimeout:i,abortController:s,getActiveCaipNetwork:o,getCaipNetworks:a}){var c;return mS.instance||(mS.instance=new vee({projectId:e,chainId:t,enableLogger:r,onTimeout:i,abortController:s,getActiveCaipNetwork:o,getCaipNetworks:a,enableCloudAuthAccount:!!((c=Ue.state.remoteFeatures)!=null&&c.emailCapture)})),mS.instance}}function M_(n,{strict:e=!0}={}){return!n||typeof n!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(n):n.startsWith("0x")}function o7(n){return M_(n,{strict:!1})?Math.ceil((n.length-2)/2):n.length}const xee="2.31.0";let bA={getDocsUrl:({docsBaseUrl:n,docsPath:e="",docsSlug:t})=>e?`${n??"https://viem.sh"}${e}${t?`#${t}`:""}`:void 0,version:`viem@${xee}`};class d1 extends Error{constructor(e,t={}){var a;const r=(()=>{var c;return t.cause instanceof d1?t.cause.details:(c=t.cause)!=null&&c.message?t.cause.message:t.details})(),i=t.cause instanceof d1&&t.cause.docsPath||t.docsPath,s=(a=bA.getDocsUrl)==null?void 0:a.call(bA,{...t,docsPath:i}),o=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...bA.version?[`Version: ${bA.version}`]:[]].join(` 82`);super(o,t.cause?{cause:t.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=i,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=xee}walk(e){return Eee(this,e)}}function Eee(n,e){return e!=null&&e(n)?n:n&&typeof n=="object"&&"cause"in n&&n.cause!==void 0?Eee(n.cause,e):e?null:n}class Aee extends d1{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function Yx(n,{dir:e,size:t=32}={}){return typeof n=="string"?n2e(n,{dir:e,size:t}):r2e(n,{dir:e,size:t})}function n2e(n,{dir:e,size:t=32}={}){if(t===null)return n;const r=n.replace("0x","");if(r.length>t*2)throw new Aee({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](t*2,"0")}`}function r2e(n,{dir:e,size:t=32}={}){if(t===null)return n;if(n.length>t)throw new Aee({size:n.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let i=0;i<t;i++){const s=e==="right";r[s?i:t-i-1]=n[s?i:n.length-i-1]}return r}class i2e extends d1{constructor({max:e,min:t,signed:r,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class s2e extends d1{constructor({givenSize:e,maxSize:t}
82){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function Gx(n,{size:e}){if(o7(n)>e)throw new s2e({givenSize:o7(n),maxSize:e})}function a7(n,e={}){const{signed:t}=e;e.size&&Gx(n,{size:e.size});const r=BigInt(n);if(!t)return r;const i=(n.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function o2e(n,e={}){return Number(a7(n,e))}const a2e=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function c7(n,e={}){return typeof n=="number"||typeof n=="bigint"?_ee(n,e):typeof n=="string"?u2e(n,e):typeof n=="boolean"?c2e(n,e):See(n,e)}function c2e(n,e={}){const t=`0x${Number(n)}`;return typeof e.size=="number"?(Gx(t,{size:e.size}),Yx(t,{size:e.size})):t}function See(n,e={}){let t="";for(let i=0;i<n.length;i++)t+=a2e[n[i]];const r=`0x${t}`;return typeof e.size=="number"?(Gx(r,{size:e.size}),Yx(r,{dir:"right",size:e.size})):r}function _ee(n,e={}){const{signed:t,size:r}=e,i=BigInt(n);let s;r?t?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof n=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&t?-s-1n:0;if(s&&i>s||i<o){const c=typeof n=="bigint"?"n":"";throw new i2e({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:t,size:r,value:`${n}${c}`})}const a=`0x${(t&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?Yx(a,{size:r}):a}const l2e=new TextEncoder;function u2e(n,e={}){const t=l2e.encode(n);return See(t,e)}const d2e=new TextEncoder;function h2e(n,e={}){return typeof n=="number"||typeof n=="bigint"?p2e(n,e):typeof n=="boolean"?f2e(n,e):M_(n)?Cee(n,e):Tee(n,e)}function f2e(n,e={}){const t=new Uint8Array(1);return t[0]=Number(n),typeof e.size=="number"?(Gx(t,{size:e.size}),Yx(t,{size:e.size})):t}const Dp={zero:48,nine:57,A:65,F:70,a:97,f:102};function SW(n){if(n>=Dp.zero&&n<=Dp.nine)return n-Dp.zero;if(n>=Dp.A&&n<=Dp.F)return n-(Dp.A-10);if(n>=Dp.a&&n<=Dp.f)return n-(Dp.a-10)}function Cee(n,e={}){let t=n;e.size&&(Gx(t,{size:e.size}),t=Yx(t,{dir:"right",size:e.size}));let r=t.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=SW(r.charCodeAt(a++)),u=SW(r.charCodeAt(a++));if(c===void 0||u===void 0)throw new d1(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[o]=c*16+u}return s}function p2e(n,e){const t=_ee(n,e);return Cee(t)}function Tee(n,e={}){const t=d2e.encode(n);return typeof e.size=="number"?(Gx(t,{size:e.size}),Yx(t,{dir:"right",size:e.size})):t}function Iee(n,e){const t=e||"hex",r=PD(M_(n,{strict:!1})?h2e(n):n);return t==="bytes"?r:c7(r)}class g2e extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Jk=new g2e(8192);function m2e(n,e){if(Jk.has(`${n}.${e}`))return Jk.get(`${n}.${e}`);const t=n.substring(2).toLowerCase(),r=Iee(Tee(t),"bytes"),i=t.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(r[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return Jk.set(`${n}.${e}`,s),s}function w2e(n){const e=Iee(`0x${n.substring(4)}`).substring(26);return m2e(`0x${e}`)}async function y2e({hash:n,signature:e}){const t=M_(n)?n:c7(n),{secp256k1:r}=await It(async()=>{const{secp256k1:o}=await import("./secp256k1-agJu7HzH.js");return{secp256k1:o}},[]);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:u,s:d,v:f,yParity:m}=e,w=Number(m??f),y=_W(w);return new r.Signature(a7(u),a7(d)).addRecoveryBit(y)}const o=M_(e)?e:c7(e);if(o7(o)!==65)throw new Error("invalid signature length");const a=o2e(`0x${o.slice(130)}`),c=_W(a);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(t.substring(2)).toHex(!1)}`}function _W(n){if(n===0||n===1)return n;if(n===27)return 0;if(n===28)return 1;throw new Error("Invalid yParityOrV value")}async function b2e({hash:n,signature:e}){return w2e(await y2e({hash:n,signature:e}))}var v2e={};const x2e=":";function H2(n){const[e,t]=n.split(x2e);return{namespace:e,reference:t}}function Nee(n,e){return n.includes(":")?[n]:e.chains||[]}var E2e=Object.defineProperty,A2e=Object.defineProperties,S2e=Object.getOwnPropertyDescriptors,CW=Object.getOwnPropertySymbols,_2e=Object.prototype.hasOwnProperty,C2e=Object.prototype.propertyIsEnumerable,l7=(n,e,t)=>e in n?E2e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,TW=(n,e)=>{for(var t in e||(e={}))_2e.call(e,t)&&l7(n,t,e[t]);if(CW)for(var t of CW(e))C2e.call(e,t)&&l7(n,t,e[t]);return n},T2e=(n,e)=>A2e(n,S2e(e)),IW=(n,e,t)=>l7(n,typeof e!="symbol"?e+"":e,t);const I2e="ReactNative",Ql={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},N2e="js";function sN(){return typeof Ji<"u"&&typeof Ji.versions<"u"&&typeof Ji.versions.node<"u"}function I0(){return!cg.getDocument()&&!!cg.getNavigator()&&navigator.product===I2e}function R2e(){return I0()&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Platform)<"u"&&(globalThis==null?void 0:globalThis.Platform.OS)==="android"}function M2e(){return I0()&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Platform)<"u"&&(globalThis==null?void 0:globalThis.Platform.OS)==="ios"}function Zx(){return!sN()&&!!cg.getNavigator()&&!!cg.getDocument()}function jC(){return I0()?Ql.reactNative:sN()?Ql.node:Zx()?Ql.browser:Ql.unknown}function NW(){var n;try{return I0()&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Application)<"u"?(n=globalThis.Application)==null?void 0:n.applicationId:void 0}catch{return}}function k2e(n,e){const t=new URLSearchParams(n);for(const r of Object.keys(e).sort())if(e.hasOwnProperty(r)){const i=e[r];i!==void 0&&t.set(r,i)}return t.toString()}function O2e(n){var e,t;const r=Ree();try{return n!=null&&n.url&&r.url&&new URL(n.url).host!==new URL(r.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${n.url} differs from the actual page url:${r.url}. This is probably unintended and can lead to issues.`),n.url=r.url),(e=n==null?void 0:n.icons)!=null&&e.length&&n.icons.length>0&&(n.icons=n.icons.filter(i=>i!=="")),T2e(TW(TW({},r),n),{url:(n==null?void 0:n.url)||r.url,name:(n==null?void 0:n.name)||r.name,description:(n==null?void 0:n.description)||r.description,icons:(t=n==null?void 0:n.icons)!=null&&t.length&&n.icons.length>0?n.icons:r.icons})}catch(i){return console.warn("Error populating app metadata",i),n||r}}function Ree(){return j0e.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function P2e(){if(jC()===Ql.reactNative&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Platform)<"u"){const{OS:t,Version:r}=globalThis.Platform;return[t,r].join("-")}const n=O0e();if(n===null)return"unknown";const e=n.os?n.os.replace(" ","").toLowerCase():"unknown";return n.type==="browser"?[e,n.name,n.version].join("-"):[e,n.version].join("-")}function D2e(){var n;const e=jC();return e===Ql.browser?[e,((n=cg.getLocation())==null?void 0:n.host)||"unknown"].join(":"):e}function Mee(n,e,t){const r=P2e(),i=D2e();return[[n,e].join("-"),[N2e,t].join("-"),r,i].join("/")}function B2e({protocol:n,version:e,relayUrl:t,sdkVersion:r,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a,packageName:c}){const u=t.split("?"),d=Mee(n,e,r),f={auth:i,ua:d,projectId:s,useOnCloseEvent:o,packageName:c||void 0,bundleId:a||void 0},m=k2e(u[1]||"",f);return u[0]+"?"+m}function Cy(n,e){return n.filter(t=>e.includes(t)).length===n.length}function u7(n){return Object.fromEntries(n.entries())}function d7(n){return new Map(Object.entries(n))}function fy(n=Ht.FIVE_MINUTES,e){const t=Ht.toMiliseconds(n||Ht.FIVE_MINUTES);let r,i,s,o;return{resolve:a=>{s&&r&&(clearTimeout(s),r(a),o=Promise.resolve(a))},reject:a=>
vendor: 14,881 bytes, line 82
82{s&&i&&(clearTimeout(s),i(a))},done:()=>new Promise((a,c)=>{if(o)return a(o);s=setTimeout(()=>{const u=new Error(e);o=Promise.reject(u),c(u)},t),r=a,i=c})}}function e0(n,e,t){return new Promise(async(r,i)=>{const s=setTimeout(()=>i(new Error(t)),e);try{const o=await n;r(o)}catch(o){i(o)}clearTimeout(s)})}function kee(n,e){if(typeof e=="string"&&e.startsWith(`${n}:`))return e;if(n.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(n.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${n}`)}function L2e(n){return kee("topic",n)}function $2e(n){return kee("id",n)}function Oee(n){const[e,t]=n.split(":"),r={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")r.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))r.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return r}function wo(n,e){return Ht.fromMiliseconds(Date.now()+Ht.toMiliseconds(n))}function Hm(n){return Date.now()>=Ht.toMiliseconds(n)}function yi(n,e){return`${n}${e?`:${e}`:""}`}function If(n=[],e=[]){return[...new Set([...n,...e])]}async function U2e({id:n,topic:e,wcDeepLink:t}){var r;try{if(!t)return;const i=typeof t=="string"?JSON.parse(t):t,s=i==null?void 0:i.href;if(typeof s!="string")return;const o=j2e(s,n,e),a=jC();if(a===Ql.browser){if(!((r=cg.getDocument())!=null&&r.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}z2e(o)}else a===Ql.reactNative&&typeof(globalThis==null?void 0:globalThis.Linking)<"u"&&await globalThis.Linking.openURL(o)}catch(i){console.error(i)}}function j2e(n,e,t){const r=`requestId=${e}&sessionTopic=${t}`;n.endsWith("/")&&(n=n.slice(0,-1));let i=`${n}`;if(n.startsWith("https://t.me")){const s=n.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${V2e(r,!0)}`}else i=`${i}/wc?${r}`;return i}function z2e(n){let e="_self";H2e()?e="_top":(W2e()||n.startsWith("https://")||n.startsWith("http://"))&&(e="_blank"),window.open(n,e,"noreferrer noopener")}async function F2e(n,e){let t="";try{if(Zx()&&(t=localStorage.getItem(e),t))return t;t=await n.getItem(e)}catch(r){console.error(r)}return t}function RW(n,e){if(!n.includes(e))return null;const t=n.split(/([&,?,=])/),r=t.indexOf(e);return t[r+2]}function MW(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,n=>{const e=Math.random()*16|0;return(n==="x"?e:e&3|8).toString(16)})}function x$(){return typeof Ji<"u"&&v2e.IS_VITEST==="true"}function W2e(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function H2e(){try{return window.self!==window.top}catch{return!1}}function V2e(n,e=!1){const t=pn.from(n).toString("base64");return e?t.replace(/[=]/g,""):t}function Pee(n){return pn.from(n,"base64").toString("utf-8")}function q2e(n){return new Promise(e=>setTimeout(e,n))}let K2e=class{constructor({limit:e}){IW(this,"limit"),IW(this,"set"),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){const t=this.set.values().next().value;t&&this.set.delete(t)}this.set.add(e)}}has(e){return this.set.has(e)}};const dI=BigInt(2**32-1),kW=BigInt(32);function Dee(n,e=!1){return e?{h:Number(n&dI),l:Number(n>>kW&dI)}:{h:Number(n>>kW&dI)|0,l:Number(n&dI)|0}}function Bee(n,e=!1){const t=n.length;let r=new Uint32Array(t),i=new Uint32Array(t);for(let s=0;s<t;s++){const{h:o,l:a}=Dee(n[s],e);[r[s],i[s]]=[o,a]}return[r,i]}const OW=(n,e,t)=>n>>>t,PW=(n,e,t)=>n<<32-t|e>>>t,Vm=(n,e,t)=>n>>>t|e<<32-t,qm=(n,e,t)=>n<<32-t|e>>>t,QA=(n,e,t)=>n<<64-t|e>>>t-32,XA=(n,e,t)=>n>>>t-32|e<<64-t,Y2e=(n,e)=>e,G2e=(n,e)=>n,Z2e=(n,e,t)=>n<<t|e>>>32-t,Q2e=(n,e,t)=>e<<t|n>>>32-t,X2e=(n,e,t)=>e<<t-32|n>>>64-t,J2e=(n,e,t)=>n<<t-32|e>>>64-t;function Ud(n,e,t,r){const i=(e>>>0)+(r>>>0);return{h:n+t+(i/2**32|0)|0,l:i|0}}const E$=(n,e,t)=>(n>>>0)+(e>>>0)+(t>>>0),A$=(n,e,t,r)=>e+t+r+(n/2**32|0)|0,exe=(n,e,t,r)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0),txe=(n,e,t,r,i)=>e+t+r+i+(n/2**32|0)|0,nxe=(n,e,t,r,i)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),rxe=(n,e,t,r,i,s)=>e+t+r+i+s+(n/2**32|0)|0,qv=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function S$(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function ug(n){if(!Number.isSafeInteger(n)||n<0)throw new Error("positive integer expected, got "+n)}function Vu(n,...e){if(!S$(n))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(n.length))throw new Error("Uint8Array expected of length "+e+", got length="+n.length)}function _$(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");ug(n.outputLen),ug(n.blockLen)}function m0(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function C$(n,e){Vu(n);const t=e.outputLen;if(n.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function k_(n){return new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4))}function qu(...n){for(let e=0;e<n.length;e++)n[e].fill(0)}function eO(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function ef(n,e){return n<<32-e|n>>>e}const Lee=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function $ee(n){return n<<24&4278190080|n<<8&16711680|n>>>8&65280|n>>>24&255}const jp=Lee?n=>n:n=>$ee(n);function ixe(n){for(let e=0;e<n.length;e++)n[e]=$ee(n[e]);return n}const Km=Lee?n=>n:ixe,Uee=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",sxe=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function O_(n){if(Vu(n),Uee)return n.toHex();let e="";for(let t=0;t<n.length;t++)e+=sxe[n[t]];return e}const Bp={_0:48,_9:57,A:65,F:70,a:97,f:102};function DW(n){if(n>=Bp._0&&n<=Bp._9)return n-Bp._0;if(n>=Bp.A&&n<=Bp.F)return n-(Bp.A-10);if(n>=Bp.a&&n<=Bp.f)return n-(Bp.a-10)}function T$(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);if(Uee)return Uint8Array.fromHex(n);const e=n.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(t);for(let i=0,s=0;i<t;i++,s+=2){const o=DW(n.charCodeAt(s)),a=DW(n.charCodeAt(s+1));if(o===void 0||a===void 0){const c=n[s]+n[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[i]=o*16+a}return r}function oxe(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}function Qd(n){return typeof n=="string"&&(n=oxe(n)),Vu(n),n}function Ty(...n){let e=0;for(let r=0;r<n.length;r++){const i=n[r];Vu(i),e+=i.length}const t=new Uint8Array(e);for(let r=0,i=0;r<n.length;r++){const s=n[r];t.set(s,i),i+=s.length}return t}let F8=class{};function zC(n){const e=r=>n().update(Qd(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function axe(n){const e=(r,i)=>n(i).update(Qd(r)).digest(),t=n({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=r=>n(r),e}function Qx(n=32){if(qv&&typeof qv.getRandomValues=="function")return qv.getRandomValues(new Uint8Array(n));if(qv&&typeof qv.randomBytes=="function")return Uint8Array.from(qv.randomBytes(n));throw new Error("crypto.getRandomValues must be defined")}const cxe=BigInt(0),vA=BigInt(1),lxe=BigInt(2),uxe=BigInt(7),dxe=BigInt(256),hxe=BigInt(113),jee=[],zee=[],Fee=[];for(let n=0,e=vA,t=1,r=0;n<24;n++){[t,r]=[r,(2*t+3*r)%5],jee.push(2*(5*r+t)),zee.push((n+1)*(n+2)/2%64);let i=cxe;for(let s=0;s<7;s++)e=(e<<vA^(e>>uxe)*hxe)%dxe,e&lxe&&(i^=vA<<(vA<<BigInt(s))-vA);Fee.push(i)}const Wee=Bee(Fee,!0),fxe=Wee[0],pxe=Wee[1],BW=(n,e,t)=>t>32?X2e(n,e,t):Z2e(n,e,t),LW=(n,e,t)=>t>32?J2e(n,e,t):Q2e(n,e,t);function gxe(n,e=24){const t=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)t[o]=n[o]^n[o+10]^n[o+20]^n[o+30]^n[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=t[c],d=t[c+1],f=BW(u,d,1)^t[a],m=LW(u,d,1)^t[a+1];for(let w=0;w<50;w+=10)n[o+w]^=f,n[o+w+1]^=m}let i=n[2],s=n[3];for(let o=0;o<24;o++){const a=zee[o],c=BW(i,s,a),u=LW(i,s,a),d=jee[o];i=n[d],s=n[d+1],n[d]=c,n[d+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=n[o+a];for(let a=0;a<10;a++)n[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}n[0]^=fxe[r],n[1]^=pxe[r]}qu(t)}let mxe=class Hee extends F8{constructor(e,t,r,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=s,ug(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=k_(this.state)}clone(){return this._cloneInto()}keccak(){Km(this.state32),gxe(this.state32,this.rounds),Km(this.state32),this.posOut=0,this.pos=0}update(e){m0(this),e=Qd(e),Vu(e);const{blockLen:t,state:r}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(t-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:i}=this;e[r]^=t,(t&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){m0(this,!1),Vu(e),this.finish();const t=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(t.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ug(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(C$(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,qu(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Hee(t,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const wxe=(n,e,t)=>zC(()=>new mxe(e,n,t)),yxe=wxe(1,136,256/8);function bxe(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(t>>i&s),a=Number(t&s),c=r?4:0,u=r?0:4;n.setUint32(e+c,o,r),n.setUint32(e+u,a,r)}function vxe(n,e,t){return n&e^~n&t}function xxe(n,e,t){return n&e^n&t^e&t}let Vee=class extends F8{constructor(e,t,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=eO(this.buffer)}update(e){m0(this),e=Qd(e),Vu(e);const{view:t,buffer:r,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=eO(e);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){m0(this),C$(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;t[o++]=128,qu(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let f=o;f<i;f++)t[f]=0;bxe(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=eO(e),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++)a.setUint32(4*f,d[f],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=s,e.length=i,e.pos=a,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}};const Nm=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Oa=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Pa=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Exe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Rm=new Uint32Array(64);let Axe=class extends Vee{constructor(e=32){super(64,e,8,!1),this.A=Nm[0]|0,this.B=Nm[1]|0,this.C=Nm[2]|0,this.D=Nm[3]|0,this.E=Nm[4]|0,this.F=Nm[5]|0,this.G=Nm[6]|0,this.H=Nm[7]|0}get(){const{A:e,B:t,C:r,D:i,E:s,F:o,G:a,H:c}=this;return[e,t,r,i,s,o,a,c]}set(e,t,r,i,s,o,a,c){this.A=e|0,this.B=t|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let f=0;f<16;f++,t+=4)Rm[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){const m=Rm[f-15],w=Rm[f-2],y=ef(m,7)^ef(m,18)^m>>>3,b=ef(w,17)^ef(w,19)^w>>>10;Rm[f]=b+Rm[f-7]+y+Rm[f-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const m=ef(a,6)^ef(a,11)^ef(a,25),w=d+m+vxe(a,c,u)+Exe[f]+Rm[f]|0,y=(ef(r,2)^ef(r,13)^ef(r,22))+xxe(r,i,s)|0;d=u,u=c,c=a,a=o+w|0,o=s,s=i,i=r,r=w+y|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,i,s,o,a,c,u,d)}roundClean(){qu(Rm)}destroy(){this.set(0,0,0,0,0,0,0,0),qu(this.buffer)}};const qee=Bee(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0
82x5cb0a9dcbd41fbd4","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(n=>BigInt(n))),Sxe=qee[0],_xe=qee[1],Mm=new Uint32Array(80),km=new Uint32Array(80);let I$=class extends Vee{constructor(e=64){super(128,e,16,!1),this.Ah=Pa[0]|0,this.Al=Pa[1]|0,this.Bh=Pa[2]|0,this.Bl=Pa[3]|0,this.Ch=Pa[4]|0,this.Cl=Pa[5]|0,this.Dh=Pa[6]|0,this.Dl=Pa[7]|0,this.Eh=Pa[8]|0,this.El=Pa[9]|0,this.Fh=Pa[10]|0,this.Fl=Pa[11]|0,this.Gh=Pa[12]|0,this.Gl=Pa[13]|0,this.Hh=Pa[14]|0,this.Hl=Pa[15]|0}get(){const{Ah:e,Al:t,Bh:r,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:d,Fh:f,Fl:m,Gh:w,Gl:y,Hh:b,Hl:E}=this;return[e,t,r,i,s,o,a,c,u,d,f,m,w,y,b,E]}set(e,t,r,i,s,o,a,c,u,d,f,m,w,y,b,E){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=m|0,this.Gh=w|0,this.Gl=y|0,this.Hh=b|0,this.Hl=E|0}process(e,t){for(let I=0;I<16;I++,t+=4)Mm[I]=e.getUint32(t),km[I]=e.getUint32(t+=4);for(let I=16;I<80;I++){const H=Mm[I-15]|0,L=km[I-15]|0,U=Vm(H,L,1)^Vm(H,L,8)^OW(H,L,7),K=qm(H,L,1)^qm(H,L,8)^PW(H,L,7),Y=Mm[I-2]|0,k=km[I-2]|0,j=Vm(Y,k,19)^QA(Y,k,61)^OW(Y,k,6),V=qm(Y,k,19)^XA(Y,k,61)^PW(Y,k,6),W=exe(K,V,km[I-7],km[I-16]),$=txe(W,U,j,Mm[I-7],Mm[I-16]);Mm[I]=$|0,km[I]=W|0}let{Ah:r,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:u,Dl:d,Eh:f,El:m,Fh:w,Fl:y,Gh:b,Gl:E,Hh:T,Hl:N}=this;for(let I=0;I<80;I++){const H=Vm(f,m,14)^Vm(f,m,18)^QA(f,m,41),L=qm(f,m,14)^qm(f,m,18)^XA(f,m,41),U=f&w^~f&b,K=m&y^~m&E,Y=nxe(N,L,K,_xe[I],km[I]),k=rxe(Y,T,H,U,Sxe[I],Mm[I]),j=Y|0,V=Vm(r,i,28)^QA(r,i,34)^QA(r,i,39),W=qm(r,i,28)^XA(r,i,34)^XA(r,i,39),$=r&s^r&a^s&a,A=i&o^i&c^o&c;T=b|0,N=E|0,b=w|0,E=y|0,w=f|0,y=m|0,{h:f,l:m}=Ud(u|0,d|0,k|0,j|0),u=a|0,d=c|0,a=s|0,c=o|0,s=r|0,o=i|0;const _=E$(j,W,A);r=A$(_,k,V,$),i=_|0}({h:r,l:i}=Ud(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:o}=Ud(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=Ud(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l:d}=Ud(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:m}=Ud(this.Eh|0,this.El|0,f|0,m|0),{h:w,l:y}=Ud(this.Fh|0,this.Fl|0,w|0,y|0),{h:b,l:E}=Ud(this.Gh|0,this.Gl|0,b|0,E|0),{h:T,l:N}=Ud(this.Hh|0,this.Hl|0,T|0,N|0),this.set(r,i,s,o,a,c,u,d,f,m,w,y,b,E,T,N)}roundClean(){qu(Mm,km)}destroy(){qu(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Cxe=class extends I${constructor(){super(48),this.Ah=Oa[0]|0,this.Al=Oa[1]|0,this.Bh=Oa[2]|0,this.Bl=Oa[3]|0,this.Ch=Oa[4]|0,this.Cl=Oa[5]|0,this.Dh=Oa[6]|0,this.Dl=Oa[7]|0,this.Eh=Oa[8]|0,this.El=Oa[9]|0,this.Fh=Oa[10]|0,this.Fl=Oa[11]|0,this.Gh=Oa[12]|0,this.Gl=Oa[13]|0,this.Hh=Oa[14]|0,this.Hl=Oa[15]|0}};const Da=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);let Txe=class extends I${constructor(){super(32),this.Ah=Da[0]|0,this.Al=Da[1]|0,this.Bh=Da[2]|0,this.Bl=Da[3]|0,this.Ch=Da[4]|0,this.Cl=Da[5]|0,this.Dh=Da[6]|0,this.Dl=Da[7]|0,this.Eh=Da[8]|0,this.El=Da[9]|0,this.Fh=Da[10]|0,this.Fl=Da[11]|0,this.Gh=Da[12]|0,this.Gl=Da[13]|0,this.Hh=Da[
vendor: 27,791 bytes, lines 82-85
8214]|0,this.Hl=Da[15]|0}};const W8=zC(()=>new Axe),Ixe=zC(()=>new I$),Nxe=zC(()=>new Cxe),Rxe=zC(()=>new Txe),Mxe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),mo=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),rn=new Uint32Array(32);function Om(n,e,t,r,i,s){const o=i[s],a=i[s+1];let c=rn[2*n],u=rn[2*n+1],d=rn[2*e],f=rn[2*e+1],m=rn[2*t],w=rn[2*t+1],y=rn[2*r],b=rn[2*r+1],E=E$(c,d,o);u=A$(E,u,f,a),c=E|0,{Dh:b,Dl:y}={Dh:b^u,Dl:y^c},{Dh:b,Dl:y}={Dh:Y2e(b,y),Dl:G2e(b)},{h:w,l:m}=Ud(w,m,b,y),{Bh:f,Bl:d}={Bh:f^w,Bl:d^m},{Bh:f,Bl:d}={Bh:Vm(f,d,24),Bl:qm(f,d,24)},rn[2*n]=c,rn[2*n+1]=u,rn[2*e]=d,rn[2*e+1]=f,rn[2*t]=m,rn[2*t+1]=w,rn[2*r]=y,rn[2*r+1]=b}function Pm(n,e,t,r,i,s){const o=i[s],a=i[s+1];let c=rn[2*n],u=rn[2*n+1],d=rn[2*e],f=rn[2*e+1],m=rn[2*t],w=rn[2*t+1],y=rn[2*r],b=rn[2*r+1],E=E$(c,d,o);u=A$(E,u,f,a),c=E|0,{Dh:b,Dl:y}={Dh:b^u,Dl:y^c},{Dh:b,Dl:y}={Dh:Vm(b,y,16),Dl:qm(b,y,16)},{h:w,l:m}=Ud(w,m,b,y),{Bh:f,Bl:d}={Bh:f^w,Bl:d^m},{Bh:f,Bl:d}={Bh:QA(f,d,63),Bl:XA(f,d,63)},rn[2*n]=c,rn[2*n+1]=u,rn[2*e]=d,rn[2*e+1]=f,rn[2*t]=m,rn[2*t+1]=w,rn[2*r]=y,rn[2*r+1]=b}function kxe(n,e={},t,r,i){if(ug(t),n<0||n>t)throw new Error("outputLen bigger than keyLen");const{key:s,salt:o,personalization:a}=e;if(s!==void 0&&(s.length<1||s.length>t))throw new Error("key length must be undefined or 1.."+t);if(o!==void 0&&o.length!==r)throw new Error("salt must be undefined or "+r);if(a!==void 0&&a.length!==i)throw new Error("personalization must be undefined or "+i)}class Oxe extends F8{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,ug(e),ug(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=k_(this.buffer)}update(e){m0(this),e=Qd(e),Vu(e);const{blockLen:t,buffer:r,buffer32:i}=this,s=e.length,o=e.byteOffset,a=e.buffer;for(let c=0;c<s;){this.pos===t&&(Km(i),this.compress(i,0,!1),Km(i),this.pos=0);const u=Math.min(t-this.pos,s-c),d=o+c;if(u===t&&!(d%4)&&c+u<s){const f=new Uint32Array(a,d,Math.floor((s-c)/4));Km(f);for(let m=0;c+t<s;m+=i.length,c+=t)this.length+=t,this.compress(f,m,!1);Km(f);continue}r.set(e.subarray(c,c+u),this.pos),this.pos+=u,this.length+=u,c+=u}return this}digestInto(e){m0(this),C$(e,this);const{pos:t,buffer32:r}=this;this.finished=!0,qu(this.buffer.subarray(t)),Km(r),this.compress(r,0,!0),Km(r);const i=k_(e);this.get().forEach((s,o)=>i[o]=jp(s))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){const{buffer:t,length:r,finished:i,destroyed:s,outputLen:o,pos:a}=this;return e||(e=new this.constructor({dkLen:o})),e.set(...this.get()),e.buffer.set(t),e.destroyed=s,e.finished=i,e.length=r,e.pos=a,e.outputLen=o,e}clone(){return this._cloneInto()}}class Pxe extends Oxe{constructor(e={}){const t=e.dkLen===void 0?64:e.dkLen;super(128,t),this.v0l=mo[0]|0,this.v0h=mo[1]|0,this.v1l=mo[2]|0,this.v1h=mo[3]|0,this.v2l=mo[4]|0,this.v2h=mo[5]|0,this.v3l=mo[6]|0,this.v3h=mo[7]|0,this.v4l=mo[8]|0,this.v4h=mo[9]|0,this.v5l=mo[10]|0,this.v5h=mo[11]|0,this.v6l=mo[12]|0,this.v6h=mo[13]|0,this.v7l=mo[14]|0,this.v7h=mo[15]|0,kxe(t,e,64,16,16);let{key:r,personalization:i,salt:s}=e,o=0;if(r!==void 0&&(r=Qd(r),o=r.length),this.v0l^=this.outputLen|o<<8|65536|1<<24,s!==void 0){s=Qd(s);const a=k_(s);this.v4l^=jp(a[0]),this.v4h^=jp(a[1]),this.v5l^=jp(a[2]),this.v5h^=jp(a[3])}if(i!==void 0){i=Qd(i);const a=k_(i);this.v6l^=jp(a[0]),this.v6h^=jp(a[1]),this.v7l^=jp(a[2]),this.v7h^=jp(a[3])}if(r!==void 0){const a=new Uint8Array(this.blockLen);a.set(r),this.update(a)}}get(){let{v0l:e,v0h:t,v1l:r,v1h:i,v2l:s,v2h:o,v3l:a,v3h:c,v4l:u,v4h:d,v5l:f,v5h:m,v6l:w,v6h:y,v7l:b,v7h:E}=this;return[e,t,r,i,s,o,a,c,u,d,f,m,w,y,b,E]}set(e,t,r,i,s,o,a,c,u,d,f,m,w,y,b,E){this.v0l=e|0,this.v0h=t|0,this.v1l=r|0,this.v1h=i|0,this.v2l=s|0,this.v2h=o|0,this.v3l=a|0,this.v3h=c|0,this.v4l=u|0,this.v4h=d|0,this.v5l=f|0,this.v5h=m|0,this.v6l=w|0,this.v6h=y|0,this.v7l=b|0,this.v7h=E|0}compress(e,t,r){this.get().forEach((c,u)=>rn[u]=c),rn.set(mo,16);let{h:i,l:s}=Dee(BigInt(this.length));rn[24]=mo[8]^s,rn[25]=mo[9]^i,r&&(rn[28]=~rn[28],rn[29]=~rn[29]);let o=0;const a=Mxe;for(let c=0;c<12;c++)Om(0,4,8,12,e,t+2*a[o++]),Pm(0,4,8,12,e,t+2*a[o++]),Om(1,5,9,13,e,t+2*a[o++]),Pm(1,5,9,13,e,t+2*a[o++]),Om(2,6,10,14,e,t+2*a[o++]),Pm(2,6,10,14,e,t+2*a[o++]),Om(3,7,11,15,e,t+2*a[o++]),Pm(3,7,11,15,e,t+2*a[o++]),Om(0,5,10,15,e,t+2*a[o++]),Pm(0,5,10,15,e,t+2*a[o++]),Om(1,6,11,12,e,t+2*a[o++]),Pm(1,6,11,12,e,t+2*a[o++]),Om(2,7,8,13,e,t+2*a[o++]),Pm(2,7,8,13,e,t+2*a[o++]),Om(3,4,9,14,e,t+2*a[o++]),Pm(3,4,9,14,e,t+2*a[o++]);this.v0l^=rn[0]^rn[16],this.v0h^=rn[1]^rn[17],this.v1l^=rn[2]^rn[18],this.v1h^=rn[3]^rn[19],this.v2l^=rn[4]^rn[20],this.v2h^=rn[5]^rn[21],this.v3l^=rn[6]^rn[22],this.v3h^=rn[7]^rn[23],this.v4l^=rn[8]^rn[24],this.v4h^=rn[9]^rn[25],this.v5l^=rn[10]^rn[26],this.v5h^=rn[11]^rn[27],this.v6l^=rn[12]^rn[28],this.v6h^=rn[13]^rn[29],this.v7l^=rn[14]^rn[30],this.v7h^=rn[15]^rn[31],qu(rn)}destroy(){this.destroyed=!0,qu(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Dxe=axe(n=>new Pxe(n)),Bxe="https://rpc.walletconnect.org/v1";function Kee(n){const e=`�Ethereum Signed Message: 83${n.length}`,t=new TextEncoder().encode(e+n);return"0x"+pn.from(yxe(t)).toString("hex")}async function Lxe(n,e,t,r,i,s){switch(t.t){case"eip191":return await $xe(n,e,t.s);case"eip1271":return await Uxe(n,e,t.s,r,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${t.t}`)}}async function $xe(n,e,t){return(await b2e({hash:Kee(e),signature:t})).toLowerCase()===n.toLowerCase()}async function Uxe(n,e,t,r,i,s){const o=H2(r);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${r}`);try{const a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",u=t.substring(2),d=(u.length/2).toString(16).padStart(64,"0"),f=(e.startsWith("0x")?e:Kee(e)).substring(2),m=a+f+c+d+u,w=await fetch(`${s||Bxe}/?chainId=${r}&projectId=${i}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:jxe(),jsonrpc:"2.0",method:"eth_call",params:[{to:n,data:m},"latest"]})}),{result:y}=await w.json();return y?y.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function jxe(){return Date.now()+Math.floor(Math.random()*1e3)}function zxe(n){const e=atob(n),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);const r=t[0];if(r===0)throw new Error("No signatures found");const i=1+r*64;if(t.length<i)throw new Error("Transaction data too short for claimed signature count");if(t.length<100)throw new Error("Transaction too short");const s=pn.from(n,"base64").slice(1,65);return Os.encode(s)}function Fxe(n){const e=new Uint8Array(pn.from(n,"base64")),t=Array.from("TransactionData::").map(s=>s.charCodeAt(0)),r=new Uint8Array(t.length+e.length);r.set(t),r.set(e,t.length);const i=Dxe(r,{dkLen:32});return Os.encode(i)}function $W(n){const e=new Uint8Array(W8(Wxe(n)));return Os.encode(e)}function Wxe(n){if(n instanceof Uint8Array)return n;if(Array.isArray(n))return new Uint8Array(n);if(typeof n=="object"&&n!=null&&n.data)return new Uint8Array(Object.values(n.data));if(typeof n=="object"&&n)return new Uint8Array(Object.values(n));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}function UW(n){const e=pn.from(n,"base64"),t=Swe(e).txn;if(!t)throw new Error("Invalid signed transaction: missing 'txn' field");const r=gwe(t),i=pn.from("TX"),s=pn.concat([i,pn.from(r)]),o=Rxe(s);return kwe.encode(o).replace(/=+$/,"")}function tO(n){const e=[];let t=BigInt(n);for(;t>=BigInt(128);)e.push(Number(t&BigInt(127)|BigInt(128))),t>>=BigInt(7);return e.push(Number(t)),pn.from(e)}function Hxe(n){const e=pn.from(n.signed.bodyBytes,"base64"),t=pn.from(n.signed.authInfoBytes,"base64"),r=pn.from(n.signature.signature,"base64"),i=[];i.push(pn.from([10])),i.push(tO(e.length)),i.push(e),i.push(pn.from([18])),i.push(tO(t.length)),i.push(t),i.push(pn.from([26])),i.push(tO(r.length)),i.push(r);const s=pn.concat(i),o=W8(s);return pn.from(o).toString("hex").toUpperCase()}var Vxe=Object.defineProperty,qxe=Object.defineProperties,Kxe=Object.getOwnPropertyDescriptors,jW=Object.getOwnPropertySymbols,Yxe=Object.prototype.hasOwnProperty,Gxe=Object.prototype.propertyIsEnumerable,zW=(n,e,t)=>e in n?Vxe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Zxe=(n,e)=>{for(var t in e||(e={}))Yxe.call(e,t)&&zW(n,t,e[t]);if(jW)for(var t of jW(e))Gxe.call(e,t)&&zW(n,t,e[t]);return n},Qxe=(n,e)=>qxe(n,Kxe(e));const Xxe="did:pkh:",N$=n=>n==null?void 0:n.split(":"),Jxe=n=>{const e=n&&N$(n);if(e)return n.includes(Xxe)?e[3]:e[1]},h7=n=>{const e=n&&N$(n);if(e)return e[2]+":"+e[3]},oN=n=>{const e=n&&N$(n);if(e)return e.pop()};async function FW(n){const{cacao:e,projectId:t}=n,{s:r,p:i}=e,s=Yee(i,i.iss),o=oN(i.iss);return await Lxe(o,s,r,h7(i.iss),t)}const Yee=(n,e)=>{const t=`${n.domain} wants you to sign in with your Ethereum account:`,r=oN(e);if(!n.aud&&!n.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=n.statement||void 0;const s=`URI: ${n.aud||n.uri}`,o=`Version: ${n.version}`,a=`Chain ID: ${Jxe(e)}`,c=`Nonce: ${n.nonce}`,u=`Issued At: ${n.iat}`,d=n.exp?`Expiration Time: ${n.exp}`:void 0,f=n.nbf?`Not Before: ${n.nbf}`:void 0,m=n.requestId?`Request ID: ${n.requestId}`:void 0,w=n.resources?`Resources:${n.resources.map(b=>` 84- ${b}`).join("")}`:void 0,y=f6(n.resources);if(y){const b=P_(y);i=cEe(i,b)}return[t,r,"",i,"",s,o,a,c,u,d,f,m,w].filter(b=>b!=null).join(` 85`)};function eEe(n){return pn.from(JSON.stringify(n)).toString("base64")}function tEe(n){return JSON.parse(pn.from(n,"base64").toString("utf-8"))}function h1(n){if(!n)throw new Error("No recap provided, value is undefined");if(!n.att)throw new Error("No `att` property found");const e=Object.keys(n.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(t=>{const r=n.att[t];if(Array.isArray(r))throw new Error(`Resource must be an object: ${t}`);if(typeof r!="object")throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${t}`);Object.keys(r).forEach(i=>{const s=r[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function nEe(n,e,t,r={}){return t==null||t.sort((i,s)=>i.localeCompare(s)),{att:{[n]:rEe(e,t,r)}}}function rEe(n,e,t={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const r=e.map(i=>({[`${n}/${i}`]:[t]}));return Object.assign({},...r)}function Gee(n){return h1(n),`urn:recap:${eEe(n).replace(/=/g,"")}`}function P_(n){const e=tEe(n.replace("urn:recap:",""));return h1(e),e}function iEe(n,e,t){const r=nEe(n,e,t);return Gee(r)}function sEe(n){return n&&n.includes("urn:recap:")}function oEe(n,e){const t=P_(n),r=P_(e),i=aEe(t,r);return Gee(i)}function aEe(n,e){h1(n),h1(e);const t=Object.keys(n.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),r={att:{}};return t.forEach(i=>{var s,o;Object.keys(((s=n.att)==null?void 0:s[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,u;r.att[i]=Qxe(Zxe({},r.att[i]),{[a]:((c=n.att[i])==null?void 0:c[a])||((u=e.att[i])==null?void 0:u[a])})})}),r}function cEe(n="",e){h1(e);const t="I further authorize the stated URI to perform the following actions on my behalf: ";if(n.includes(t))return n;const r=[];let i=0;Object.keys(e.att).forEach(a=>{const c=Object.keys(e.att[a]).map(f=>({ability:f.split("/")[0],action:f.split("/")[1]}));c.sort((f,m)=>f.action.localeCompare(m.action));const u={};c.forEach(f=>{u[f.ability]||(u[f.ability]=[]),u[f.ability].push(f.action)});const d=Object.keys(u).map(f=>(i++,`(${i}) '${f}': '${u[f].join("', '")}' for '${a}'.`));r.push(d.join(", ").replace(".,","."))});const s=r.join(" "),o=`${t}${s}`;return`${n?n+" ":""}${o}`}function WW(n){var e;const t=P_(n);h1(t);const r=(e=t.att)==null?void 0:e.eip155;return r?Object.keys(r).map(i=>i.split("/")[1]):[]}function HW(n){const e=P_(n);h1(e);const t=[];return Object.values(e.att).forEach(r=>{Object.values(r).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&t.push(i[0].chains)})}),[...new Set(t.flat())]}function f6(n){if(!n)return;const e=n==null?void 0:n[n.length-1];return sEe(e)?e:void 0}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function Zee(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function f7(n){if(typeof n!="boolean")throw new Error(`boolean expected, not ${n}`)}function nO(n){if(!Number.isSafeInteger(n)||n<0)throw new Error("positive integer expected, got "+n)}function il(n,...e){if(!Zee(n))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(n.length))throw new Error("Uint8Array expected of length "+e+", got length="+n.length)}function VW(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function lEe(n,e){il(n);const t=e.outputLen;if(n.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function i0(n){return new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4))}function px(...n){for(let e=0;e<n.length;e++)n[e].fill(0)}function uEe(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}const dEe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function hEe(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}function p7(n){if(typeof n=="string")n=hEe(n);else if(Zee(n))n=g7(n);else throw new Error("Uint8Array expected, got "+typeof n);return n}function fEe(n,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(n,e)}function pEe(n,e){if(n.length!==e.length)return!1;let t=0;for(let r=0;r<n.length;r++)t|=n[r]^e[r];return t===0}const gEe=(n,e)=>{function t(r,...i){if(il(r),!dEe)throw new Error("Non little-endian hardware is not yet supported");if(n.nonceLength!==void 0){const u=i[0];if(!u)throw new Error("nonce / iv required");n.varSizeNonce?il(u):il(u,n.nonceLength)}const s=n.tagLength;s&&i[1]!==void 0&&il(i[1]);const o=e(r,...i),a=(u,d)=>{if(d!==void 0){if(u!==2)throw new Error("cipher output not supported");il(d)}};let c=!1;return{encrypt(u,d){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,il(u),a(o.encrypt.length,d),o.encrypt(u,d)},decrypt(u,d){if(il(u),s&&u.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return a(o.decrypt.length,d),o.decrypt(u,d)}}}return Object.assign(t,n),t};function qW(n,e,t=!0){if(e===void 0)return new Uint8Array(n);if(e.length!==n)throw new Error("invalid output length, expected "+n+", got: "+e.length);if(t&&!wEe(e))throw new Error("invalid output, must be aligned");return e}function KW(n,e,t,r){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(t>>i&s),a=Number(t&s);n.setUint32(e+4,o,r),n.setUint32(e+0,a,r)}function mEe(n,e,t){f7(t);const r=new Uint8Array(16),i=uEe(r);return KW(i,0,BigInt(e),t),KW(i,8,BigInt(n),t),r}function wEe(n){return n.byteOffset%4===0}function g7(n){return Uint8Array.from(n)}const Qee=n=>Uint8Array.from(n.split("").map(e=>e.charCodeAt(0))),yEe=Qee("expand 16-byte k"),bEe=Qee("expand 32-byte k"),vEe=i0(yEe),xEe=i0(bEe);function ni(n,e){return n<<e|n>>>32-e}function m7(n){return n.byteOffset%4===0}const hI=64,EEe=16,Xee=2**32-1,YW=new Uint32Array;function AEe(n,e,t,r,i,s,o,a){const c=i.length,u=new Uint8Array(hI),d=i0(u),f=m7(i)&&m7(s),m=f?i0(i):YW,w=f?i0(s):YW;for(let y=0;y<c;o++){if(n(e,t,r,d,o,a),o>=Xee)throw new Error("arx: counter overflow");const b=Math.min(hI,c-y);if(f&&b===hI){const E=y/4;if(y%4!==0)throw new Error("arx: invalid block position");for(let T=0,N;T<EEe;T++)N=E+T,w[N]=m[N]^d[T];y+=hI;continue}for(let E=0,T;E<b;E++)T=y+E,s[T]=i[T]^u[E];y+=b}}function SEe(n,e){const{allowShortKeys:t,extendNonceFn:r,counterLength:i,counterRight:s,rounds:o}=fEe({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof n!="function")throw new Error("core must be a function");return nO(i),nO(o),f7(s),f7(t),(a,c,u,d,f=0)=>{il(a),il(c),il(u);const m=u.length;if(d===void 0&&(d=new Uint8Array(m)),il(d),nO(f),f<0||f>=Xee)throw new Error("arx: counter overflow");if(d.length<m)throw new Error(`arx: output (${d.length}) is shorter than data (${m})`);const w=[];let y=a.length,b,E;if(y===32)w.push(b=g7(a)),E=xEe;else if(y===16&&t)b=new Uint8Array(32),b.set(a),b.set(a,16),E=vEe,w.push(b);else throw new Error(`arx: invalid 32-byte key, got length=${y}`);m7(c)||w.push(c=g7(c));const T=i0(b);if(r){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");r(E,T,i0(c.subarray(0,16)),T),c=c.subarray(16)}const N=16-i;if(N!==c.length)throw new Error(`arx: nonce must be ${N} or 16 bytes`);if(N!==12){const H=new Uint8Array(12);H.set(c,s?0:12-c.length),c=H,w.push(c)}const I=i0(c);return AEe(n,E,T,I,u,d,f,o),px(...w),d}}const Vo=(n,e)=>n[e++]&255|(n[e++]&255)<<8;class _Ee{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=p7(e),il(e,32);const t=Vo(e,0),r=Vo(e,2),i=Vo(e,4),s=Vo(e,6),o=Vo(e,8),a=Vo(e,10),c=Vo(e,12),u=Vo(e,14);this.r[0]=t&8191,this.r[1]=(t>>>13|r<<3)&8191,this.r[2]=(r>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|u<<8)&8191,this.r[9]=u>>>5&127;for(let d=0;d<8;d++)this.pad[d]=Vo(e,16+2*d)}process(e,t,r=!1){const i=r?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],u=o[2],d=o[3],f=o[4],m=o[5],w=o[6],y=o[7],b=o[8],E=o[9],T=Vo(e,t+0),N=Vo(e,t+2),I=Vo(e,t+4),H=Vo(e,t+6),L=Vo(e,t+8),U=Vo(e,t+10),K=Vo(e,t+12),Y=Vo(e,t+14);let k=s[0]+(T&8191),j=s[1]+((T>>>13|N<<3)&8191),V=s[2]+((N>>>10|I<<6)&8191),W=s[3]+((I>>>7|H<<9)&8191),$=s[4]+((H>>>4|L<<12)&8191),A=s[5]+(L>>>1&8191),_=s[6]+((L>>>14|U<<2)&8191),R=s[7]+((U>>>11|K<<5)&8191),P=s[8]+((K>>>8|Y<<8)&8191),q=s[9]+(Y>>>5|i),F=0,z=F+k*a+j*(5*E)+V*(5*b)+W*(5*y)+$*(5*w);F=z>>>13,z&=8191,z+=A*(5*m)+_*(5*f)+R*(5*d)+P*(5*u)+q*(5*c),F+=z>>>13,z&=8191;let B=F+k*c+j*a+V*(5*E)+W*(5*b)+$*(5*y);F=B>>>13,B&=8191,B+=A*(5*w)+_*(5*m)+R*(5*f)+P*(5*d)+q*(5*u),F+=B>>>13,B&=8191;let C=F+k*u+j*c+V*a+W*(5*E)+$*(5*b);F=C>>>13,C&=8191,C+=A*(5*y)+_*(5*w)+R*(5*m)+P*(5*f)+q*(5*d),F+=C>>>13,C&=8191;let M=F+k*d+j*u+V*c+W*a+$*(5*E);F=M>>>13,M&=8191,M+=A*(5*b)+_*(5*y)+R*(5*w)+P*(5*m)+q*(5*f),F+=M>>>13,M&=8191;let Z=F+k*f+j*d+V*u+W*c+$*a;F=Z>>>13,Z&=8191,Z+=A*(5*E)+_*(5*b)+R*(5*y)+P*(5*w)+q*(5*m),F+=Z>>>13,Z&=8191;let J=F+k*m+j*f+V*d+W*u+$*c;F=J>>>13,J&=8191,J+=A*a+_*(5*E)+R*(5*b)+P*(5*y)+q*(5*w),F+=J>>>13,J&=8191;let ae=F+k*w+j*m+V*f+W*d+$*u;F=ae>>>13,ae&=8191,ae+=A*c+_*a+R*(5*E)+P*(5*b)+q*(5*y),F+=ae>>>13,ae&=8191;let we=F+k*y+j*w+V*m+W*f+$*d;F=we>>>13,we&=8191,we+=A*u+_*c+R*a+P*(5*E)+q*(5*b),F+=we>>>13,we&=8191;let he=F+k*b+j*y+V*w+W*m+$*f;F=he>>>13,he&=8191,he+=A*d+_*u+R*c+P*a+q*(5*E),F+=he>>>13,he&=8191;let xe=F+k*E+j*b+V*y+W*w+$*m;F=xe>>>13,xe&=8191,xe+=A*f+_*d+R*u+P*c+q*a,F+=xe>>>13,xe&=8191,F=(F<<2)+F|0,F=F+z|0,z=F&8191,F=F>>>13,B+=F,s[0]=z,s[1]=B,s[2]=C,s[3]=M,s[4]=Z,s[5]=J,s[6]=ae,s[7]=we,s[8]=he,s[9]=xe}finalize(){const{h:e,pad:t}=this,r=new Uint16Array(10);let i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,r[0]=e[0]+5,i=r[0]>>>13,r[0]&=8191;for(let a=1;a<10;a++)r[a]=e[a]+i,i=r[a]>>>13,r[a]&=8191;r[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)r[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|r[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+t[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+t[a]|0)+(o>>>16)|0,e[a]=o&65535;px(r)}update(e){VW(this),e=p7(e),il(e);const{buffer:t,blockLen:r}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);if(o===r){for(;r<=i-s;s+=r)this.process(e,s);continue}t.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===r&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){px(this.h,this.r,this.buffer,this.pad)}digestInto(e){VW(this),lEe(e,this),this.finished=!0;const{buffer:t,h:r}=this;let{pos:i}=this;if(i){for(t[i++]=1;i<16;i++)t[i]=0;this.process(t,0,!0)}this.finalize();let s=0;for(let o=0;o<8;o++)e[s++]=r[o]>>>0,e[s++]=r[o]>>>8;return e}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}}function CEe(n){const e=(r,i)=>n(i).update(p7(r)).digest(),t=n(new Uint8Array(32));return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=r=>n(r),e}const TEe=CEe(n=>new _Ee(n));function IEe(n,e,t,r,i,s=20){let o=n[0],a=n[1],c=n[2],u=n[3],d=e[0],f=e[1],m=e[2],w=e[3],y=e[4],b=e[5],E=e[6],T=e[7],N=i,I=t[0],H=t[1],L=t[2],U=o,K=a,Y=c,k=u,j=d,V=f,W=m,$=w,A=y,_=b,R=E,P=T,q=N,F=I,z=H,B=L;for(let M=0;M<s;M+=2)U=U+j|0,q=ni(q^U,16),A=A+q|0,j=ni(j^A,12),U=U+j|0,q=ni(q^U,8),A=A+q|0,j=ni(j^A,7),K=K+V|0,F=ni(F^K,16),_=_+F|0,V=ni(V^_,12),K=K+V|0,F=ni(F^K,8),_=_+F|0,V=ni(V^_,7),Y=Y+W|0,z=ni(z^Y,16),R=R+z|0,W=ni(W^R,12),Y=Y+W|0,z=ni(z^Y,8),R=R+z|0,W=ni(W^R,7),k=k+$|0,B=ni(B^k,16),P=P+B|0,$=ni($^P,12),k=k+$|0,B=ni(B^k,8),P=P+B|0,$=ni($^P,7),U=U+V|0,B=ni(B^U,16),R=R+B|0,V=ni(V^R,12),U=U+V|0,B=ni(B^U,8),R=R+B|0,V=ni(V^R,7),K=K+W|0,q=ni(q^K,16),P=P+q|0,W=ni(W^P,12),K=K+W|0,q=ni(q^K,8),P=P+q|0,W=ni(W^P,7),Y=Y+$|0,F=ni(F^Y,16),A=A+F|0,$=ni($^A,12),Y=Y+$|0,F=ni(F^Y,8),A=A+F|0,$=ni($^A,7),k=k+j|0,z=ni(z^k,16),_=_+z|0,j=ni(j^_,12),k=k+j|0,z=ni(z^k,8),_=_+z|0,j=ni(j^_,7);let C=0;r[C++]=o+U|0,r[C++]=a+K|0,r[C++]=c+Y|0,r[C++]=u+k|0,r[C++]=d+j|0,r[C++]=f+V|0,r[C++]=m+W|0,r[C++]=w+$|0,r[C++]=y+A|0,r[C++]=b+_|0,r[C++]=E+R|0,r[C++]=T+P|0,r[C++]=N+q|0,r[C++]=I+F|0,r[C++]=H+z|0,r[C++]=L+B|0}const NEe=SEe(IEe,{counterRight:!1,counterLength:4,allowShortKeys:!1}),REe=new Uint8Array(16),GW=(n,e)=>{n.update(e);const t=e.length%16;t&&n.update(REe.subarray(t))},MEe=new Uint8Array(32);function ZW(n,e,t,r,i){const s=n(e,t,MEe),o=TEe.create(s);i&&GW(o,i),GW(o,r);const a=mEe(r.length,i?i.length:0,!0);o.update(a);const c=o.digest();return px(s,a),c}const kEe=n=>(e,t,r)=>({encrypt(i,s){const o=i.length;s=qW(o+16,s,!1),s.set(i);const a=s.subarray(0,-16);n(e,t,a,a,1);const c=ZW(n,e,t,a,r);return s.set(c,o),px(c),s},decrypt(i,s){s=qW(i.length-16,s,!1);const o=i.subarray(0,-16),a=i.subarray(-16),c=ZW(n,e,t,o,r);if(!pEe(a,c))throw new Error("invalid tag");return s.set(i.subarray(0,-16)),n(e,t,s,s,1),px(c),s}}),Jee=gEe({blockSize:64,nonceLength:12,tagLength:16},kEe(NEe));let ete=class extends F8{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,_$(e);const r=Qd(t);if(this.iHash=e.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 i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),qu(s)}update(e){return m0(this),this.iHash.update(e),this}digestInto(e){m0(this),Vu(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const H8=(n,e,t)=>new ete(n,e).update(t).digest();H8.create=(n,e)=>new ete(n,e);function OEe(n,e,t){return _$(n),t===void 0&&(t=new Uint8Array(n.outputLen)),H8(n,Qd(t),Qd(e))}const rO=Uint8Array.from([0]),QW=Uint8Array.of();function PEe(n,e,t,r=32){_$(n),ug(r);const i=n.outputLen;if(r>255*i)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(r/i);t===void 0&&(t=QW);const o=new Uint8Array(s*i),a=H8.create(n,e),c=a._cloneInto(),u=new Uint8Array(a.outputLen);for(let d=0;d<s;d++)rO[0]=d+1,c.update(d===0?QW:u).update(t).update(rO).digestInto(u),o.set(u,i*d),a._cloneInto(c);return a.destroy(),c.destroy(),qu(u,rO),o.slice(0,r)}const DEe=(n,e,t,r,i)=>PEe(n,OEe(n,e,t),r,i),V8=W8,R$=BigInt(0),w7=BigInt(1);function aN(n,e){if(typeof e!="boolean")throw new Error(n+" boolean expected, got "+e)}function fI(n){const e=n.toString(16);return e.length&1?"0"+e:e}function tte(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?R$:BigInt("0x"+n)}function q8(n){return tte(O_(n))}function cN(n){return Vu(n),tte(O_(Uint8Array.from(n).reverse()))}function M$(n,e){return T$(n.toString(16).padStart(e*2,"0"))}function k$(n,e){return M$(n,e).reverse()}function nl(n,e,t){let r;if(typeof e=="string")try{r=T$(e)}catch(s){throw new Error(n+" must be hex string or Uint8Array, cause: "+s)}else if(S$(e))r=Uint8Array.from(e);else throw new Error(n+" must be hex string or Uint8Array");const i=r.length;if(typeof t=="number"&&i!==t)throw new Error(n+" of length "+t+" expected, got "+i);return r}const iO=n=>typeof n=="bigint"&&R$<=n;function BEe(n,e,t){return iO(n)&&iO(e)&&iO(t)&&e<=n&&n<t}function y7(n,e,t,r){if(!BEe(e,t,r))throw new Error("expected valid "+n+": "+t+" <= n < "+r+", got "+e)}function LEe(n){let e;for(e=0;n>R$;n>>=w7,e+=1);return e}const K8=n=>(w7<<BigInt(n))-w7;function $Ee(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");const r=m=>new Uint8Array(m),i=m=>Uint8Array.of(m);let s=r(n),o=r(n),a=0;const c=()=>{s.fill(1),o.fill(0),a=0},u=(...m)=>t(o,s,...m),d=(m=r(0))=>{o=u(i(0),m),s=u(),m.length!==0&&(o=u(i(1),m),s=u())},f=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let m=0;const w=[];for(;m<e;){s=u();const y=s.slice();w.push(y),m+=s.length}return Ty(...w)};return(m,w)=>{c(),d(m);let y;for(;!(y=w(f()));)d();return c(),y}}function Y8(n,e,t={}){if(!n||typeof n!="object")throw new Error("expected valid options object");function r(i,s,o){const a=n[i];if(o&&a===void 0)return;const c=typeof a;if(c!==s||a===null)throw new Error(`param "${i}
85" is invalid: expected ${s}, got ${c}`)}Object.entries(e).forEach(([i,s])=>r(i,s,!1)),Object.entries(t).forEach(([i,s])=>r(i,s,!0))}function XW(n){const e=new WeakMap;return(t,...r)=>{const i=e.get(t);if(i!==void 0)return i;const s=n(t,...r);return e.set(t,s),s}}const ll=BigInt(0),vc=BigInt(1),Iy=BigInt(2),UEe=BigInt(3),nte=BigInt(4),rte=BigInt(5),ite=BigInt(8);function Uu(n,e){const t=n%e;return t>=ll?t:e+t}function Ld(n,e,t){let r=n;for(;e-- >ll;)r*=r,r%=t;return r}function JW(n,e){if(n===ll)throw new Error("invert: expected non-zero number");if(e<=ll)throw new Error("invert: expected positive modulus, got "+e);let t=Uu(n,e),r=e,i=ll,s=vc;for(;t!==ll;){const o=r/t,a=r%t,c=i-s*o;r=t,t=a,i=s,s=c}if(r!==vc)throw new Error("invert: does not exist");return Uu(i,e)}function ste(n,e){const t=(n.ORDER+vc)/nte,r=n.pow(e,t);if(!n.eql(n.sqr(r),e))throw new Error("Cannot find square root");return r}function jEe(n,e){const t=(n.ORDER-rte)/ite,r=n.mul(e,Iy),i=n.pow(r,t),s=n.mul(e,i),o=n.mul(n.mul(s,Iy),i),a=n.mul(s,n.sub(o,n.ONE));if(!n.eql(n.sqr(a),e))throw new Error("Cannot find square root");return a}function zEe(n){if(n<BigInt(3))throw new Error("sqrt is not defined for small field");let e=n-vc,t=0;for(;e%Iy===ll;)e/=Iy,t++;let r=Iy;const i=Xx(n);for(;eH(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(t===1)return ste;let s=i.pow(r,e);const o=(e+vc)/Iy;return function(a,c){if(a.is0(c))return c;if(eH(a,c)!==1)throw new Error("Cannot find square root");let u=t,d=a.mul(a.ONE,s),f=a.pow(c,e),m=a.pow(c,o);for(;!a.eql(f,a.ONE);){if(a.is0(f))return a.ZERO;let w=1,y=a.sqr(f);for(;!a.eql(y,a.ONE);)if(w++,y=a.sqr(y),w===u)throw new Error("Cannot find square root");const b=vc<<BigInt(u-w-1),E=a.pow(d,b);u=w,d=a.sqr(E),f=a.mul(f,d),m=a.mul(m,E)}return m}}function FEe(n){return n%nte===UEe?ste:n%ite===rte?jEe:zEe(n)}const WEe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function HEe(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},t=WEe.reduce((r,i)=>(r[i]="function",r),e);return Y8(n,t),n}function VEe(n,e,t){if(t<ll)throw new Error("invalid exponent, negatives unsupported");if(t===ll)return n.ONE;if(t===vc)return e;let r=n.ONE,i=e;for(;t>ll;)t&vc&&(r=n.mul(r,i)),i=n.sqr(i),t>>=vc;return r}function ote(n,e,t=!1){const r=new Array(e.length).fill(t?n.ZERO:void 0),i=e.reduce((o,a,c)=>n.is0(a)?o:(r[c]=o,n.mul(o,a)),n.ONE),s=n.inv(i);return e.reduceRight((o,a,c)=>n.is0(a)?o:(r[c]=n.mul(o,r[c]),n.mul(o,a)),s),r}function eH(n,e){const t=(n.ORDER-vc)/Iy,r=n.pow(e,t),i=n.eql(r,n.ONE),s=n.eql(r,n.ZERO),o=n.eql(r,n.neg(n.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function qEe(n,e){e!==void 0&&ug(e);const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function Xx(n,e,t=!1,r={}){if(n<=ll)throw new Error("invalid field: expected ORDER > 0, got "+n);let i,s;if(typeof e=="object"&&e!=null){if(r.sqrt||t)throw new Error("cannot specify opts in two arguments");const d=e;d.BITS&&(i=d.BITS),d.sqrt&&(s=d.sqrt),typeof d.isLE=="boolean"&&(t=d.isLE)}else typeof e=="number"&&(i=e),r.sqrt&&(s=r.sqrt);const{nBitLength:o,nByteLength:a}=qEe(n,i);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const u=Object.freeze({ORDER:n,isLE:t,BITS:o,BYTES:a,MASK:K8(o),ZERO:ll,ONE:vc,create:d=>Uu(d,n),isValid:d=>{if(typeof d!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof d);return ll<=d&&d<n},is0:d=>d===ll,isValidNot0:d=>!u.is0(d)&&u.isValid(d),isOdd:d=>(d&vc)===vc,neg:d=>Uu(-d,n),eql:(d,f)=>d===f,sqr:d=>Uu(d*d,n),add:(d,f)=>Uu(d+f,n),sub:(d,f)=>Uu(d-f,n),mul:(d,f)=>Uu(d*f,n),pow:(d,f)=>VEe(u,d,f),div:(d,f)=>Uu(d*JW(f,n),n),sqrN:d=>d*d,addN:(d,f)=>d+f,subN:(d,f)=>d-f,mulN:(d,f)=>d*f,inv:d=>JW(d,n),sqrt:s||(d=>(c||(c=FEe(n)),c(u,d))),toBytes:d=>t?k$(d,a):M$(d,a),fromBytes:d=>{if(d.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+d.length);return t?cN(d):q8(d)},invertBatch:d=>ote(u,d),cmov:(d,f,m)=>m?f:d});return Object.freeze(u)}function ate(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function cte(n){const e=ate(n);return e+Math.ceil(e/2)}function KEe(n,e,t=!1){const r=n.length,i=ate(e),s=cte(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=t?cN(n):q8(n),a=Uu(o,e-vc)+vc;return t?k$(a,i):M$(a,i)}const gx=BigInt(0),Ny=BigInt(1);function wS(n,e){const t=e.negate();return n?t:e}function YEe(n,e,t){const r=s=>s.pz,i=ote(n.Fp,t.map(r));return t.map((s,o)=>
vendor: 10,752 bytes, line 85
85s.toAffine(i[o])).map(n.fromAffine)}function lte(n,e){if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+n)}function sO(n,e){lte(n,e);const t=Math.ceil(e/n)+1,r=2**(n-1),i=2**n,s=K8(n),o=BigInt(n);return{windows:t,windowSize:r,mask:s,maxNumber:i,shiftBy:o}}function tH(n,e,t){const{windowSize:r,mask:i,maxNumber:s,shiftBy:o}=t;let a=Number(n&i),c=n>>o;a>r&&(a-=s,c+=Ny);const u=e*r,d=u+Math.abs(a)-1,f=a===0,m=a<0,w=e%2!==0;return{nextN:c,offset:d,isZero:f,isNeg:m,isNegF:w,offsetF:u}}function GEe(n,e){if(!Array.isArray(n))throw new Error("array expected");n.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function ZEe(n,e){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const oO=new WeakMap,ute=new WeakMap;function aO(n){return ute.get(n)||1}function nH(n){if(n!==gx)throw new Error("invalid wNAF")}function QEe(n,e){return{constTimeNegate:wS,hasPrecomputes(t){return aO(t)!==1},unsafeLadder(t,r,i=n.ZERO){let s=t;for(;r>gx;)r&Ny&&(i=i.add(s)),s=s.double(),r>>=Ny;return i},precomputeWindow(t,r){const{windows:i,windowSize:s}=sO(r,e),o=[];let a=t,c=a;for(let u=0;u<i;u++){c=a,o.push(c);for(let d=1;d<s;d++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(t,r,i){let s=n.ZERO,o=n.BASE;const a=sO(t,e);for(let c=0;c<a.windows;c++){const{nextN:u,offset:d,isZero:f,isNeg:m,isNegF:w,offsetF:y}=tH(i,c,a);i=u,f?o=o.add(wS(w,r[y])):s=s.add(wS(m,r[d]))}return nH(i),{p:s,f:o}},wNAFUnsafe(t,r,i,s=n.ZERO){const o=sO(t,e);for(let a=0;a<o.windows&&i!==gx;a++){const{nextN:c,offset:u,isZero:d,isNeg:f}=tH(i,a,o);if(i=c,!d){const m=r[u];s=s.add(f?m.negate():m)}}return nH(i),s},getPrecomputes(t,r,i){let s=oO.get(r);return s||(s=this.precomputeWindow(r,t),t!==1&&(typeof i=="function"&&(s=i(s)),oO.set(r,s))),s},wNAFCached(t,r,i){const s=aO(t);return this.wNAF(s,this.getPrecomputes(s,t,i),r)},wNAFCachedUnsafe(t,r,i,s){const o=aO(t);return o===1?this.unsafeLadder(t,r,s):this.wNAFUnsafe(o,this.getPrecomputes(o,t,i),r,s)},setWindowSize(t,r){lte(r,e),ute.set(t,r),oO.delete(t)}}}function XEe(n,e,t,r){let i=e,s=n.ZERO,o=n.ZERO;for(;t>gx||r>gx;)t&Ny&&(s=s.add(i)),r&Ny&&(o=o.add(i)),i=i.double(),t>>=Ny,r>>=Ny;return{p1:s,p2:o}}function JEe(n,e,t,r){GEe(t,n),ZEe(r,e);const i=t.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=n.ZERO,a=LEe(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=K8(c),d=new Array(Number(u)+1).fill(o),f=Math.floor((e.BITS-1)/c)*c;let m=o;for(let w=f;w>=0;w-=c){d.fill(o);for(let b=0;b<s;b++){const E=r[b],T=Number(E>>BigInt(w)&u);d[T]=d[T].add(t[b])}let y=o;for(let b=d.length-1,E=o;b>0;b--)E=E.add(d[b]),y=y.add(E);if(m=m.add(y),w!==0)for(let b=0;b<c;b++)m=m.double()}return m}function rH(n,e){if(e){if(e.ORDER!==n)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return HEe(e),e}else return Xx(n)}function e3e(n,e,t={}){if(!e||typeof e!="object")throw new Error(`expected valid ${n} CURVE object`);for(const o of["p","n","h"]){const a=e[o];if(!(typeof a=="bigint"&&a>gx))throw new Error(`CURVE.${o} must be positive bigint`)}const r=rH(e.p,t.Fp),i=rH(e.n,t.Fn),s=["Gx","Gy","a","b"];for(const o of s)if(!r.isValid(e[o]))throw new Error(`CURVE.${o} must be valid field element of CURVE.Fp`);return{Fp:r,Fn:i}}BigInt(0),BigInt(1),BigInt(2),BigInt(8);const xA=BigInt(0),Kv=BigInt(1),pI=BigInt(2);function t3e(n){return Y8(n,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...n})}function n3e(n){const e=t3e(n),{P:t,type:r,adjustScalarBytes:i,powPminus2:s,randomBytes:o}=e,a=r==="x25519";if(!a&&r!=="x448")throw new Error("invalid type");const c=o||Qx,u=a?255:448,d=a?32:56,f=BigInt(a?9:5),m=BigInt(a?121665:39081),w=a?pI**BigInt(254):pI**BigInt(447),y=a?BigInt(8)*pI**BigInt(251)-Kv:BigInt(4)*pI**BigInt(445)-Kv,b=w+y+Kv,E=k=>Uu(k,t),T=N(f);function N(k){return k$(E(k),d)}function I(k){const j=nl("u coordinate",k,d);return a&&(j[31]&=127),E(cN(j))}function H(k){return cN(i(nl("scalar",k,d)))}function L(k,j){const V=Y(I(j),H(k));if(V===xA)throw new Error("invalid private or public key received");return N(V)}function U(k){return L(k,T)}function K(k,j,V){const W=E(k*(j-V));return j=E(j-W),V=E(V+W),{x_2:j,x_3:V}}function Y(k,j){y7("u",k,xA,t),y7("scalar",j,w,b);const V=j,W=k;let $=Kv,A=xA,_=k,R=Kv,P=xA;for(let F=BigInt(u-1);F>=xA;F--){const z=V>>F&Kv;P^=z,{x_2:$,x_3:_}=K(P,$,_),{x_2:A,x_3:R}=K(P,A,R),P=z;const B=$+A,C=E(B*B),M=$-A,Z=E(M*M),J=C-Z,ae=_+R,we=_-R,he=E(we*B),xe=E(ae*M),Se=he+xe,Re=he-xe;_=E(Se*Se),R=E(W*E(Re*Re)),$=E(C*Z),A=E(J*(C+E(m*J)))}({x_2:$,x_3:_}=K(P,$,_)),{x_2:A,x_3:R}=K(P,A,R);const q=s(A);return E($*q)}return{scalarMult:L,scalarMultBase:U,getSharedSecret:(k,j)=>L(k,j),getPublicKey:k=>U(k),utils:{randomPrivateKey:()=>c(d)},GuBytes:T.slice()}}BigInt(0);const r3e=BigInt(1),iH=BigInt(2),i3e=BigInt(3),s3e=BigInt(5);BigInt(8);const dte={p:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function o3e(n){const e=BigInt(10),t=BigInt(20),r=BigInt(40),i=BigInt(80),s=dte.p,o=n*n%s*n%s,a=Ld(o,iH,s)*o%s,c=Ld(a,r3e,s)*n%s,u=Ld(c,s3e,s)*c%s,d=Ld(u,e,s)*u%s,f=Ld(d,t,s)*d%s,m=Ld(f,r,s)*f%s,w=Ld(m,i,s)*m%s,y=Ld(w,i,s)*m%s,b=Ld(y,e,s)*u%s;return{pow_p_5_8:Ld(b,iH,s)*n%s,b2:o}}function a3e(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}const b7=(()=>{const n=dte.p;return n3e({P:n,type:"x25519",powPminus2:e=>{const{pow_p_5_8:t,b2:r}=o3e(e);return Uu(Ld(t,i3e,n)*r,n)},adjustScalarBytes:a3e})})();function sH(n){n.lowS!==void 0&&aN("lowS",n.lowS),n.prehash!==void 0&&aN("prehash",n.prehash)}class c3e extends Error{constructor(e=""){super(e)}}const Wp={Err:c3e,_tlv:{encode:(n,e)=>{const{Err:t}=Wp;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");const r=e.length/2,i=fI(r);if(i.length/2&128)throw new t("tlv.encode: long form length too big");const s=r>127?fI(i.length/2|128):"";return fI(n)+s+i+e},decode(n,e){const{Err:t}=Wp;let r=0;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[r++]!==n)throw new t("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new t("tlv.decode(long): indefinite length not supported");if(c>4)throw new t("tlv.decode(long): byte length is too big");const u=e.subarray(r,r+c);if(u.length!==c)throw new t("tlv.decode: length bytes not complete");if(u[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const d of u)o=o<<8|d;if(r+=c,o<128)throw new t("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new t("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(n){const{Err:e}=Wp;if(n<yS)throw new e("integer: negative integers are not allowed");let t=fI(n);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return t},decode(n){const{Err:e}=Wp;if(n[0]&128)throw new e("invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return q8(n)}},toSig(n){const{Err:e,_int:t,_tlv:r}=Wp,i=nl("signature",n),{v:s,l:o}=r.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:u,l:d}=r.decode(2,c);if(d.length)throw new e("invalid signature: left bytes after parsing");return{r:t.decode(a),s:t.decode(u)}},hexFromSig(n){const{_tlv:e,_int:t}=Wp,r=e.encode(2,t.encode(n.r)),i=e.encode(2,t.encode(n.s)),s=r+i;return e.encode(48,s)}},yS=BigInt(0),bS=BigInt(1),l3e=BigInt(2),gI=BigInt(3),u3e=BigInt(4);function d3e(n,e,t){function r(i){const s=n.sqr(i),o=n.mul(s,i);return n.add(n.add(o,n.mul(i,e)),t)}return r}function hte(n,e,t){const{BYTES:r}=n;function i(s){let o;if(typeof s=="bigint")o=s;else{let a=nl("private key",s);if(e){if(!e.includes(a.length*2))throw new Error("invalid private key");const c=new Uint8Array(r);c.set(a,c.length-a.length),a=c}try{o=n.fromBytes(a)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof s}`)}}if(t&&(o=n.create(o)),!n.isValidNot0(o))throw new Error("invalid private key: out of range [1..N-1]");return o}return i}function h3e(n,e={}){const{Fp:t,Fn:r}=e3e("weierstrass",n,e),{h:i,n:s}=n;Y8(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:o}=e;if(o&&(!t.is0(n.a)||typeof o.beta!="bigint"||typeof o.splitScalar!="function"))throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');function a(){if(!t.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function c(Y,k,j){const{x:V,y:W}=k.toAffine(),$=t.toBytes(V);if(aN("isCompressed",j),j){a();const A=!t.isOdd(W);return Ty(fte(A),$)}else return Ty(Uint8Array.of(4),$,t.toBytes(W))}function u(Y){Vu(Y);const k=t.BYTES,j=k+1,V=2*k+1,W=Y.length,$=Y[0],A=Y.subarray(1);if(W===j&&($===2||$===3)){const _=t.fromBytes(A);if(!t.isValid(_))throw new Error("bad point: is not on curve, wrong x");const R=m(_);let P;try{P=t.sqrt(R)}catch(F){const z=F instanceof Error?": "+F.message:"";throw new Error("bad point: is not on curve, sqrt error"+z)}a();const q=t.isOdd(P);return($&1)===1!==q&&(P=t.neg(P)),{x:_,y:P}}else if(W===V&&$===4){const _=t.fromBytes(A.subarray(k*0,k*1)),R=t.fromBytes(A.subarray(k*1,k*2));if(!w(_,R))throw new Error("bad point: is not on curve");return{x:_,y:R}}else throw new Error(`bad point: got length ${W}, expected compressed=${j} or uncompressed=${V}`)}const d=e.toBytes||c,f=e.fromBytes||u,m=d3e(t,n.a,n.b);function w(Y,k){const j=t.sqr(k),V=m(Y);return t.eql(j,V)}if(!w(n.Gx,n.Gy))throw new Error("bad curve params: generator point");const y=t.mul(t.pow(n.a,gI),u3e),b=t.mul(t.sqr(n.b),BigInt(27));if(t.is0(t.add(y,b)))throw new Error("bad curve params: a or b");function E(Y,k,j=!1){if(!t.isValid(k)||j&&t.is0(k))throw new Error(`bad point coordinate ${Y}`);return k}function T(Y){if(!(Y instanceof L))throw new Error("ProjectivePoint expected")}const N=XW((Y,k)=>{const{px:j,py:V,pz:W}=Y;if(t.eql(W,t.ONE))return{x:j,y:V};const $=Y.is0();k==null&&(k=$?t.ONE:t.inv(W));const A=t.mul(j,k),_=t.mul(V,k),R=t.mul(W,k);if($)return{x:t.ZERO,y:t.ZERO};
vendor: 5,505 bytes, line 85
85if(!t.eql(R,t.ONE))throw new Error("invZ was invalid");return{x:A,y:_}}),I=XW(Y=>{if(Y.is0()){if(e.allowInfinityPoint&&!t.is0(Y.py))return;throw new Error("bad point: ZERO")}const{x:k,y:j}=Y.toAffine();if(!t.isValid(k)||!t.isValid(j))throw new Error("bad point: x or y not field elements");if(!w(k,j))throw new Error("bad point: equation left != right");if(!Y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function H(Y,k,j,V,W){return j=new L(t.mul(j.px,Y),j.py,j.pz),k=wS(V,k),j=wS(W,j),k.add(j)}class L{constructor(k,j,V){this.px=E("x",k),this.py=E("y",j,!0),this.pz=E("z",V),Object.freeze(this)}static fromAffine(k){const{x:j,y:V}=k||{};if(!k||!t.isValid(j)||!t.isValid(V))throw new Error("invalid affine point");if(k instanceof L)throw new Error("projective point not allowed");return t.is0(j)&&t.is0(V)?L.ZERO:new L(j,V,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(k){return YEe(L,"pz",k)}static fromBytes(k){return Vu(k),L.fromHex(k)}static fromHex(k){const j=L.fromAffine(f(nl("pointHex",k)));return j.assertValidity(),j}static fromPrivateKey(k){const j=hte(r,e.allowedPrivateKeyLengths,e.wrapPrivateKey);return L.BASE.multiply(j(k))}static msm(k,j){return JEe(L,r,k,j)}precompute(k=8,j=!0){return K.setWindowSize(this,k),j||this.multiply(gI),this}_setWindowSize(k){this.precompute(k)}assertValidity(){I(this)}hasEvenY(){const{y:k}=this.toAffine();if(!t.isOdd)throw new Error("Field doesn't support isOdd");return!t.isOdd(k)}equals(k){T(k);const{px:j,py:V,pz:W}=this,{px:$,py:A,pz:_}=k,R=t.eql(t.mul(j,_),t.mul($,W)),P=t.eql(t.mul(V,_),t.mul(A,W));return R&&P}negate(){return new L(this.px,t.neg(this.py),this.pz)}double(){const{a:k,b:j}=n,V=t.mul(j,gI),{px:W,py:$,pz:A}=this;let _=t.ZERO,R=t.ZERO,P=t.ZERO,q=t.mul(W,W),F=t.mul($,$),z=t.mul(A,A),B=t.mul(W,$);return B=t.add(B,B),P=t.mul(W,A),P=t.add(P,P),_=t.mul(k,P),R=t.mul(V,z),R=t.add(_,R),_=t.sub(F,R),R=t.add(F,R),R=t.mul(_,R),_=t.mul(B,_),P=t.mul(V,P),z=t.mul(k,z),B=t.sub(q,z),B=t.mul(k,B),B=t.add(B,P),P=t.add(q,q),q=t.add(P,q),q=t.add(q,z),q=t.mul(q,B),R=t.add(R,q),z=t.mul($,A),z=t.add(z,z),q=t.mul(z,B),_=t.sub(_,q),P=t.mul(z,F),P=t.add(P,P),P=t.add(P,P),new L(_,R,P)}add(k){T(k);const{px:j,py:V,pz:W}=this,{px:$,py:A,pz:_}=k;let R=t.ZERO,P=t.ZERO,q=t.ZERO;const F=n.a,z=t.mul(n.b,gI);let B=t.mul(j,$),C=t.mul(V,A),M=t.mul(W,_),Z=t.add(j,V),J=t.add($,A);Z=t.mul(Z,J),J=t.add(B,C),Z=t.sub(Z,J),J=t.add(j,W);let ae=t.add($,_);return J=t.mul(J,ae),ae=t.add(B,M),J=t.sub(J,ae),ae=t.add(V,W),R=t.add(A,_),ae=t.mul(ae,R),R=t.add(C,M),ae=t.sub(ae,R),q=t.mul(F,J),R=t.mul(z,M),q=t.add(R,q),R=t.sub(C,q),q=t.add(C,q),P=t.mul(R,q),C=t.add(B,B),C=t.add(C,B),M=t.mul(F,M),J=t.mul(z,J),C=t.add(C,M),M=t.sub(B,M),M=t.mul(F,M),J=t.add(J,M),B=t.mul(C,J),P=t.add(P,B),B=t.mul(ae,J),R=t.mul(Z,R),R=t.sub(R,B),B=t.mul(Z,C),q=t.mul(ae,q),q=t.add(q,B),new L(R,P,q)}subtract(k){return this.add(k.negate())}is0(){return this.equals(L.ZERO)}multiply(k){const{endo:j}=e;if(!r.isValidNot0(k))throw new Error("invalid scalar: out of range");let V,W;const $=A=>K.wNAFCached(this,A,L.normalizeZ);if(j){const{k1neg:A,k1:_,k2neg:R,k2:P}=j.splitScalar(k),{p:q,f:F}=$(_),{p:z,f:B}=$(P);W=F.add(B),V=H(j.beta,q,z,A,R)}else{const{p:A,f:_}=$(k);V=A,W=_}return L.normalizeZ([V,W])[0]}multiplyUnsafe(k){const{endo:j}=e,V=this;if(!r.isValid(k))throw new Error("invalid scalar: out of range");if(k===yS||V.is0())return L.ZERO;if(k===bS)return V;if(K.hasPrecomputes(this))return this.multiply(k);if(j){const{k1neg:W,k1:$,k2neg:A,k2:_}=j.splitScalar(k),{p1:R,p2:P}=XEe(L,V,$,_);return H(j.beta,R,P,W,A)}else return K.wNAFCachedUnsafe(V,k)}multiplyAndAddUnsafe(k,j,V){const W=this.multiplyUnsafe(j).add(k.multiplyUnsafe(V));return W.is0()?void 0:W}toAffine(k){return N(this,k)}isTorsionFree(){const{isTorsionFree:k}=e;return i===bS?!0:k?k(L,this):K.wNAFCachedUnsafe(this,s).is0()}clearCofactor(){const{clearCofactor:k}=e;return i===bS?this:k?k(L,this):this.multiplyUnsafe(i)}toBytes(k=!0){return aN("isCompressed",k),this.assertValidity(),d(L,this,k)}toRawBytes(k=!0){return this.toBytes(k)}toHex(k=!0){return O_(this.toBytes(k))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}L.BASE=new L(n.Gx,n.Gy,t.ONE),L.ZERO=new L(t.ZERO,t.ONE,t.ZERO),L.Fp=t,L.Fn=r;const U=r.BITS,K=QEe(L,e.endo?Math.ceil(U/2):U);return L}function fte(n){return Uint8Array.of(n?2:3)}function f3e(n,e,t={}){Y8(e,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=e.randomBytes||Qx,i=e.hmac||((V,...W)=>H8(e.hash,V,Ty(...W))),{Fp:s,Fn:o}=n,{ORDER:a,BITS:c}=o;function u(V){const W=a>>bS;return V>W}function d(V){return u(V)?o.neg(V):V}function f(V,W){if(!o.isValidNot0(W))throw new Error(`invalid signature ${V}: out of range 1..CURVE.n`)}class m{constructor(W,$,A){f("r",W),f("s",$),this.r=W,this.s=$,A!=null&&(this.recovery=A),Object.freeze(this)}static fromCompact(W){const $=o.BYTES,A=nl("compactSignature",W,$*2);return new m(o.fromBytes(A.subarray(0,$)),o.fromBytes(A.subarray($,$*2)))}static fromDER(W){const{r:$,s:A}=Wp.toSig(nl("DER",W));return new m($,A)}assertValidity(){}addRecoveryBit(W){return new m(this.r,this.s,W)}recoverPublicKey(W){const $=s.ORDER,{r:A,s:_,recovery:R}=this;if(R==null||![0,1,2,3].includes(R))throw new Error("recovery id invalid");if(a*l3e<$&&R>1)throw new Error("recovery id is ambiguous for h>1 curve");const P=R===2||R===3?A+a:A;if(!s.isValid(P))throw new Error("recovery id 2 or 3 invalid");
vendor: 36,420 bytes, lines 85-91
85const q=s.toBytes(P),F=n.fromHex(Ty(fte((R&1)===0),q)),z=o.inv(P),B=I(nl("msgHash",W)),C=o.create(-B*z),M=o.create(_*z),Z=n.BASE.multiplyUnsafe(C).add(F.multiplyUnsafe(M));if(Z.is0())throw new Error("point at infinify");return Z.assertValidity(),Z}hasHighS(){return u(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,o.neg(this.s),this.recovery):this}toBytes(W){if(W==="compact")return Ty(o.toBytes(this.r),o.toBytes(this.s));if(W==="der")return T$(Wp.hexFromSig(this));throw new Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return O_(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return O_(this.toBytes("compact"))}}const w=hte(o,t.allowedPrivateKeyLengths,t.wrapPrivateKey),y={isValidPrivateKey(V){try{return w(V),!0}catch{return!1}},normPrivateKeyToScalar:w,randomPrivateKey:()=>{const V=a;return KEe(r(cte(V)),V)},precompute(V=8,W=n.BASE){return W.precompute(V,!1)}};function b(V,W=!0){return n.fromPrivateKey(V).toBytes(W)}function E(V){if(typeof V=="bigint")return!1;if(V instanceof n)return!0;const W=nl("key",V).length,$=s.BYTES,A=$+1,_=2*$+1;if(!(t.allowedPrivateKeyLengths||o.BYTES===A))return W===A||W===_}function T(V,W,$=!0){if(E(V)===!0)throw new Error("first arg must be private key");if(E(W)===!1)throw new Error("second arg must be public key");return n.fromHex(W).multiply(w(V)).toBytes($)}const N=e.bits2int||function(V){if(V.length>8192)throw new Error("input is too large");const W=q8(V),$=V.length*8-c;return $>0?W>>BigInt($):W},I=e.bits2int_modN||function(V){return o.create(N(V))},H=K8(c);function L(V){return y7("num < 2^"+c,V,yS,H),o.toBytes(V)}function U(V,W,$=K){if(["recovered","canonical"].some(Z=>Z in $))throw new Error("sign() legacy options not supported");const{hash:A}=e;let{lowS:_,prehash:R,extraEntropy:P}=$;_==null&&(_=!0),V=nl("msgHash",V),sH($),R&&(V=nl("prehashed msgHash",A(V)));const q=I(V),F=w(W),z=[L(F),L(q)];if(P!=null&&P!==!1){const Z=P===!0?r(s.BYTES):P;z.push(nl("extraEntropy",Z))}const B=Ty(...z),C=q;function M(Z){const J=N(Z);if(!o.isValidNot0(J))return;const ae=o.inv(J),we=n.BASE.multiply(J).toAffine(),he=o.create(we.x);if(he===yS)return;const xe=o.create(ae*o.create(C+he*F));if(xe===yS)return;let Se=(we.x===he?0:2)|Number(we.y&bS),Re=xe;return _&&u(xe)&&(Re=d(xe),Se^=1),new m(he,Re,Se)}return{seed:B,k2sig:M}}const K={lowS:e.lowS,prehash:!1},Y={lowS:e.lowS,prehash:!1};function k(V,W,$=K){const{seed:A,k2sig:_}=U(V,W,$);return $Ee(e.hash.outputLen,o.BYTES,i)(A,_)}n.BASE.precompute(8);function j(V,W,$,A=Y){const _=V;W=nl("msgHash",W),$=nl("publicKey",$),sH(A);const{lowS:R,prehash:P,format:q}=A;if("strict"in A)throw new Error("options.strict was renamed to lowS");if(q!==void 0&&!["compact","der","js"].includes(q))throw new Error('format must be "compact", "der" or "js"');const F=typeof _=="string"||S$(_),z=!F&&!q&&typeof _=="object"&&_!==null&&typeof _.r=="bigint"&&typeof _.s=="bigint";if(!F&&!z)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let B,C;try{if(z)if(q===void 0||q==="js")B=new m(_.r,_.s);else throw new Error("invalid format");if(F){try{q!=="compact"&&(B=m.fromDER(_))}catch(Se){if(!(Se instanceof Wp.Err))throw Se}!B&&q!=="der"&&(B=m.fromCompact(_))}C=n.fromHex($)}catch{return!1}if(!B||R&&B.hasHighS())return!1;P&&(W=e.hash(W));const{r:M,s:Z}=B,J=I(W),ae=o.inv(Z),we=o.create(J*ae),he=o.create(M*ae),xe=n.BASE.multiplyUnsafe(we).add(C.multiplyUnsafe(he));return xe.is0()?!1:o.create(xe.x)===M}return Object.freeze({getPublicKey:b,getSharedSecret:T,sign:k,verify:j,utils:y,Point:n,Signature:m})}function p3e(n){const e={a:n.a,b:n.b,p:n.Fp.ORDER,n:n.n,h:n.h,Gx:n.Gx,Gy:n.Gy},t=n.Fp,r=Xx(e.n,n.nBitLength),i={Fp:t,Fn:r,allowedPrivateKeyLengths:n.allowedPrivateKeyLengths,allowInfinityPoint:n.allowInfinityPoint,endo:n.endo,wrapPrivateKey:n.wrapPrivateKey,isTorsionFree:n.isTorsionFree,clearCofactor:n.clearCofactor,fromBytes:n.fromBytes,toBytes:n.toBytes};return{CURVE:e,curveOpts:i}}function g3e(n){const{CURVE:e,curveOpts:t}=p3e(n),r={hash:n.hash,hmac:n.hmac,randomBytes:n.randomBytes,lowS:n.lowS,bits2int:n.bits2int,bits2int_modN:n.bits2int_modN};return{CURVE:e,curveOpts:t,ecdsaOpts:r}}function m3e(n,e){return Object.assign({},e,{ProjectivePoint:e.Point,CURVE:n})}function w3e(n){const{CURVE:e,curveOpts:t,ecdsaOpts:r}=g3e(n),i=h3e(e,t),s=f3e(i,r,t);return m3e(n,s)}function v7(n,e){const t=r=>w3e({...n,hash:r});return{...t(e),create:t}}const pte={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},gte={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},mte={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},y3e=Xx(pte.p),b3e=Xx(gte.p),v3e=Xx(mte.p),x3e=v7({...pte,Fp:y3e,lowS:!1},W8);v7({...gte,Fp:b3e,lowS:!1},Nxe),v7({...mte,Fp:v3e,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},Ixe);const E3e=x3e,wte="base10",xc="base16",qd="base64pad",Gm="base64url",FC="utf8",yte=0,ig=1,WC=2,A3e=0,oH=1,vS=12,O$=32;function S3e(){const n=b7.utils.randomPrivateKey(),e=b7.getPublicKey(n);return{privateKey:fl(n,xc),publicKey:fl(e,xc)}}function x7(){const n=Qx(O$);return fl(n,xc)}function _3e(n,e){const t=b7.getSharedSecret(zu(n,xc),zu(e,xc)),r=DEe(V8,t,void 0,void 0,O$);return fl(r,xc)}function p6(n){const e=V8(zu(n,xc));return fl(e,xc)}function yf(n){const e=V8(zu(n,FC));return fl(e,xc)}function bte(n){return zu(`${n}`,wte)}function f1(n){return Number(fl(n,wte))}function vte(n){return n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xte(n){const e=n.replace(/-/g,"+").replace(/_/g,"/"),t=(4-e.length%4)%4;return e+"=".repeat(t)}function C3e(n){const e=bte(typeof n.type<"u"?n.type:yte);if(f1(e)===ig&&typeof n.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof n.senderPublicKey<"u"?zu(n.senderPublicKey,xc):void 0,r=typeof n.iv<"u"?zu(n.iv,xc):Qx(vS),i=zu(n.symKey,xc),s=Jee(i,r).encrypt(zu(n.message,FC)),o=Ete({type:e,sealed:s,iv:r,senderPublicKey:t});return n.encoding===Gm?vte(o):o}function T3e(n){const e=zu(n.symKey,xc),{sealed:t,iv:r}=D_({encoded:n.encoded,encoding:n.encoding}),i=Jee(e,r).decrypt(t);if(i===null)throw new Error("Failed to decrypt");return fl(i,FC)}function I3e(n,e){const t=bte(WC),r=Qx(vS),i=zu(n,FC),s=Ete({type:t,sealed:i,iv:r});return e===Gm?vte(s):s}function N3e(n,e){const{sealed:t}=D_({encoded:n,encoding:e});return fl(t,FC)}function Ete(n){if(f1(n.type)===WC)return fl(pS([n.type,n.sealed]),qd);if(f1(n.type)===ig){if(typeof n.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return fl(pS([n.type,n.senderPublicKey,n.iv,n.sealed]),qd)}return fl(pS([n.type,n.iv,n.sealed]),qd)}function D_(n){const e=(n.encoding||qd)===Gm?xte(n.encoded):n.encoded,t=zu(e,qd),r=t.slice(A3e,oH),i=oH;if(f1(r)===ig){const c=i+O$,u=c+vS,d=t.slice(i,c),f=t.slice(c,u),m=t.slice(u);return{type:r,sealed:m,iv:f,senderPublicKey:d}}if(f1(r)===WC){const c=t.slice(i),u=Qx(vS);return{type:r,sealed:c,iv:u}}const s=i+vS,o=t.slice(i,s),a=t.slice(s);return{type:r,sealed:a,iv:o}}function R3e(n,e){const t=D_({encoded:n,encoding:e==null?void 0:e.encoding});return Ate({type:f1(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?fl(t.senderPublicKey,xc):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Ate(n){const e=(n==null?void 0:n.type)||yte;if(e===ig){if(typeof(n==null?void 0:n.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(n==null?void 0:n.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:n==null?void 0:n.senderPublicKey,receiverPublicKey:n==null?void 0:n.receiverPublicKey}}function aH(n){return n.type===ig&&typeof n.senderPublicKey=="string"&&typeof n.receiverPublicKey=="string"}function cH(n){return n.type===WC}function M3e(n){const e=pn.from(n.x,"base64"),t=pn.from(n.y,"base64");return pS([new Uint8Array([4]),e,t])}function k3e(n,e){const[t,r,i]=n.split("."),s=pn.from(xte(i),"base64");if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32),a=s.slice(32,64),c=`${t}.${r}`,u=V8(c),d=M3e(e);if(!E3e.verify(pS([o,a]),u,d))throw new Error("Invalid signature");return GD(n).payload}const O3e="irn";function lN(n){return(n==null?void 0:n.relay)||{protocol:O3e}}function JA(n){const e=Nye[n];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${n}`);return e}function P3e(n,e="-"){const t={},r="relay"+e;return Object.keys(n).forEach(i=>{if(i.startsWith(r)){const s=i.replace(r,""),o=n[i];t[s]=o}}),t}function lH(n){if(!n.includes("wc:")){const u=Pee(n);u!=null&&u.includes("wc:")&&(n=u)}n=n.includes("wc://")?n.replace("wc://",""):n,n=n.includes("wc:")?n.replace("wc:",""):n;const e=n.indexOf(":"),t=n.indexOf("?")!==-1?n.indexOf("?"):void 0,r=n.substring(0,e),i=n.substring(e+1,t).split("@"),s=typeof t<"u"?n.substring(t):"",o=new URLSearchParams(s),a={};o.forEach((u,d)=>{a[d]=u});const c=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:r,topic:D3e(i[0]),version:parseInt(i[1],10),symKey:a.symKey,relay:P3e(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function D3e(n){return n.startsWith("//")?n.substring(2):n}function B3e(n,e="-"){const t="relay",r={};return Object.keys(n).forEach(i=>{const s=i,o=t+e+s;n[s]&&(r[o]=n[s])}),r}function uH(n){const e=new URLSearchParams,t=B3e(n.relay);Object.keys(t).sort().forEach(i=>{e.set(i,t[i])}),e.set("symKey",n.symKey),n.expiryTimestamp&&e.set("expiryTimestamp",n.expiryTimestamp.toString()),n.methods&&e.set("methods",n.methods.join(","));const r=e.toString();return`${n.protocol}:${n.topic}@${n.version}?${r}`}function mI(n,e,t){return`${n}?wc_ev=${t}&topic=${e}`}var L3e=Object.defineProperty,$3e=Object.defineProperties,U3e=Object.getOwnPropertyDescriptors,dH=Object.getOwnPropertySymbols,j3e=Object.prototype.hasOwnProperty,z3e=Object.prototype.propertyIsEnumerable,hH=(n,e,t)=>e in n?L3e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,F3e=(n,e)=>{for(var t in e||(e={}))j3e.call(e,t)&&hH(n,t,e[t]);if(dH)for(var t of dH(e))z3e.call(e,t)&&hH(n,t,e[t]);return n},W3e=(n,e)=>$3e(n,U3e(e));function Jx(n){const e=[];return n.forEach(t=>{const[r,i]=t.split(":");e.push(`${r}:${i}`)}),e}function H3e(n){const e=[];return Object.values(n).forEach(t=>{e.push(...Jx(t.accounts))}),e}function V3e(n,e){const t=[];return Object.values(n).forEach(r=>{Jx(r.accounts).includes(e)&&t.push(...r.methods)}),t}function q3e(n,e){const t=[];return Object.values(n).forEach(r=>{Jx(r.accounts).includes(e)&&t.push(...r.events)}),t}function G8(n){return n.includes(":")}function S2(n){return G8(n)?n.split(":")[0]:n}function fH(n){var e,t,r;const i={};if(!Nf(n))return i;for(const[s,o]of Object.entries(n)){const a=G8(s)?[s]:o.chains,c=o.methods||[],u=o.events||[],d=S2(s);i[d]=W3e(F3e({},i[d]),{chains:If(a,(e=i[d])==null?void 0:e.chains),methods:If(c,(t=i[d])==null?void 0:t.methods),events:If(u,(r=i[d])==null?void 0:r.events)})}return i}function K3e(n){const e={};return n==null||n.forEach(t=>{var r;const[i,s]=t.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[],methods:[]}),e[i].accounts.push(t),(r=e[i].chains)==null||r.push(`${i}:${s}`)}),e}function pH(n,e){e=e.map(r=>r.replace("did:pkh:",""));const t=K3e(e);for(const[r,i]of Object.entries(t))i.methods?i.methods=If(i.methods,n):i.methods=n,i.events=["chainChanged","accountsChanged"];return t}function Y3e(n,e){var t,r,i,s,o,a;const c=fH(n),u=fH(e),d={},f=Object.keys(c).concat(Object.keys(u));for(const m of f)d[m]={chains:If((t=c[m])==null?void 0:t.chains,(r=u[m])==null?void 0:r.chains),methods:If((i=c[m])==null?void 0:i.methods,(s=u[m])==null?void 0:s.methods),events:If((o=c[m])==null?void 0:o.events,(a=u[m])==null?void 0:a.events)};return d}const G3e={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},Z3e={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function zt(n,e){const{message:t,code:r}=Z3e[n];return{message:e?`${t} ${e}`:t,code:r}}function hs(n,e){const{message:t,code:r}=G3e[n];return{message:e?`${t} ${e}`:t,code:r}}function sg(n,e){return!!Array.isArray(n)}function Nf(n){return Object.getPrototypeOf(n)===Object.prototype&&Object.keys(n).length}function sa(n){return typeof n>"u"}function uo(n,e){return e&&sa(n)?!0:typeof n=="string"&&!!n.trim().length}function P$(n,e){return e&&sa(n)?!0:typeof n=="number"&&!isNaN(n)}function Q3e(n,e){const{requiredNamespaces:t}=e,r=Object.keys(n.namespaces),i=Object.keys(t);let s=!0;return Cy(i,r)?(r.forEach(o=>{const{accounts:a,methods:c,events:u}=n.namespaces[o],d=Jx(a),f=t[o];(!Cy(Nee(o,f),d)||!Cy(f.methods,c)||!Cy(f.events,u))&&(s=!1)}),s):!1}function uN(n){return uo(n,!1)&&n.includes(":")?n.split(":").length===2:!1}function X3e(n){if(uo(n,!1)&&n.includes(":")){const e=n.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&uN(t)}}return!1}function J3e(n){function e(t){try{return typeof new URL(t)<"u"}catch{return!1}}try{if(uo(n,!1)){if(e(n))return!0;const t=Pee(n);return e(t)}}catch{}return!1}function eAe(n){var e;return(e=n==null?void 0:n.proposer)==null?void 0:e.publicKey}function tAe(n){return n==null?void 0:n.topic}function nAe(n,e){let t=null;return uo(n==null?void 0:n.publicKey,!1)||(t=zt("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function gH(n){let e=!0;return sg(n)?n.length&&(e=n.every(t=>uo(t,!1))):e=!1,e}function rAe(n,e,t){let r=null;return sg(e)&&e.length?e.forEach(i=>{r||uN(i)||(r=hs("UNSUPPORTED_CHAINS",`${t}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):uN(n)||(r=hs("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),r}function iAe(n,e,t){let r=null;return Object.entries(n).forEach(([i,s])=>{if(r)return;const o=rAe(i,Nee(i,s),`${e} ${t}`);o&&(r=o)}),r}function sAe(n,e){let t=null;return sg(n)?n.forEach(r=>{t||X3e(r)||(t=hs("UNSUPPORTED_ACCOUNTS",`${e}, account ${r} should be a string and conform to "namespace:chainId:address" format`))}):t=hs("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function oAe(n,e){let t=null;return Object.values(n).forEach(r=>{if(t)return;const i=sAe(r==null?void 0:r.accounts,`${e} namespace`);i&&(t=i)}),t}function aAe(n,e){let t=null;return gH(n==null?void 0:n.methods)?gH(n==null?void 0:n.events)||(t=hs("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=hs("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function Ste(n,e){let t=null;return Object.values(n).forEach(r=>{if(t)return;const i=aAe(r,`${e}, namespace`);i&&(t=i)}),t}function cAe(n,e,t){let r=null;if(n&&Nf(n)){const i=Ste(n,e);i&&(r=i);const s=iAe(n,e,t);s&&(r=s)}else r=zt("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return r}function cO(n,e){let t=null;if(n&&Nf(n)){const r=Ste(n,e);r&&(t=r);const i=oAe(n,e);i&&(t=i)}else t=zt("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function _te(n){return uo(n.protocol,!0)}function lAe(n,e){let t=!1;return n?n&&sg(n)&&n.length&&n.forEach(r=>{t=_te(r)}):t=!0,t}function uAe(n){return typeof n=="number"}function tl(n){return typeof n<"u"&&typeof n!==null}function dAe(n){return!(!n||typeof n!="object"||!n.code||!P$(n.code,!1)||!n.message||!uo(n.message,!1))}function hAe(n){return!(sa(n)||!uo(n.method,!1))}function fAe(n){return!(sa(n)||sa(n.result)&&sa(n.error)||!P$(n.id,!1)||!uo(n.jsonrpc,!1))}function pAe(n){return!(sa(n)||!uo(n.name,!1))}function mH(n,e){return!(!uN(e)||!H3e(n).includes(e))}function gAe(n,e,t){return uo(t,!1)?V3e(n,e).includes(t):!1}function mAe(n,e,t){return uo(t,!1)?q3e(n,e).includes(t):!1}function wH(n,e,t){let r=null;const i=wAe(n),s=yAe(e),o=Object.keys(i),a=Object.keys(s),c=yH(Object.keys(n)),u=yH(Object.keys(e)),d=c.filter(f=>!u.includes(f));return d.length&&(r=zt("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces. 86 Required: ${d.toString()} 87 Received: ${Object.keys(e).toString()}`)),Cy(o,a)||(r=zt("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces. 88 Required: ${o.toString()} 89 Approved: ${a.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||r)return;const m=Jx(e[f].accounts);m.includes(f)||(r=zt("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${f} 90 Required: ${f} 91 Approved: ${m.toString()}`))}),o.forEach(f=>{r||(Cy(i[f].methods,s[f].methods)?Cy(i[f].events,s[f].events)||(r=zt("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${f}`)):r=zt("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${f}`))}),r}function wAe(n){const e={};return Object.keys(n).forEach(t=>{var r;t.includes(":")?e[t]=n[t]:(r=n[t].chains)==null||r.forEach(i=>{e[i]={methods:n[t].methods,events:n[t].events}})}),e}function yH(n){return[...new Set(n.map(e=>e.includes(":")?e.split(":")[0]:e))]}function yAe(n){const e={};return Object.keys(n).forEach(t=>{if(t.includes(":"))e[t]=n[t];else{const r=Jx(n[t].accounts);r==null||r.forEach(i=>{e[i]={accounts:n[t].accounts.filter(s=>s.includes(`${i}:`)),methods:n[t].methods,events:n[t].events}})}}),e}function bAe(n,e){return P$(n,!1)&&n<=e.max&&n>=e.min}function bH(){const n=jC();return new Promise(e=>{switch(n){case Ql.browser:e(vAe());break;case Ql.reactNative:e(xAe());break;case Ql.node:e(EAe());break;default:e(!0)}})}function vAe(){return Zx()&&(navigator==null?void 0:navigator.onLine)}async function xAe(){if(I0()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo){const n=await(globalThis==null?void 0:globalThis.NetInfo.fetch());return n==null?void 0:n.isConnected}return!0}function EAe(){return!0}function AAe(n){switch(jC()){case Ql.browser:SAe(n);break;case Ql.reactNative:_Ae(n);break}}function SAe(n){!I0()&&Zx()&&(window.addEventListener("online",()=>n(!0)),window.addEventListener("offline",()=>n(!1)))}function _Ae(n){I0()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo&&(globalThis==null||globalThis.NetInfo.addEventListener(e=>n(e==null?void 0:e.isConnected)))}function CAe(){var n;return Zx()&&cg.getDocument()?((n=cg.getDocument())==null?void 0:n.visibilityState)==="visible":!0}const lO={};class EA{static get(e){return lO[e]}static set(e,t){lO[e]=t}static delete(e){delete lO[e]}}function TAe(n){const e=Os.decode(n);if(e.length<33)throw new Error("Too short to contain a public key");return e.slice(1,33)}function IAe({publicKey:n,signature:e,payload:t}){var r;const i=E7(t.method),s=128|parseInt(((r=t.version)==null?void 0:r.toString())||"4"),o=MAe(t.address),a=t.era==="00"?new Uint8Array([0]):E7(t.era);if(a.length!==1&&a.length!==2)throw new Error("Invalid era length");const c=parseInt(t.nonce,16),u=new Uint8Array([c&255,c>>8&255]),d=BigInt(`0x${RAe(t.tip)}`),f=OAe(d),m=new Uint8Array([0,...n,o,...e,...a,...u,...f,...i]),w=kAe(m.length+1);return new Uint8Array([...w,s,...m])}function NAe(n){const e=E7(n),t=Oye.blake2b(e,void 0,32);return"0x"+pn.from(t).toString("hex")}function E7(n){return new Uint8Array(n.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function RAe(n){return n.startsWith("0x")?n.slice(2):n}function MAe(n){const e=Os.decode(n)[0];return e===42?0:e===60?2:1}function kAe(n){if(n<64)return new Uint8Array([n<<2]);if(n<16384){const e=n<<2|1;return new Uint8Array([e&255,e>>8&255])}else if(n<1<<30){const e=n<<2|2;return new Uint8Array([e&255,e>>8&255,e>>16&255,e>>24&255])}else throw new Error("Compact encoding > 2^30 not supported")}function OAe(n){if(n<BigInt(1)<<BigInt(6))return new Uint8Array([Number(n<<BigInt(2))]);if(n<BigInt(1)<<BigInt(14)){const e=n<<BigInt(2)|BigInt(1);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255))])}else if(n<BigInt(1)<<BigInt(30)){const e=n<<BigInt(2)|BigInt(2);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255)),Number(e>>BigInt(16)&BigInt(255)),Number(e>>BigInt(24)&BigInt(255))])}else throw new Error("BigInt compact encoding not supported > 2^30")}function PAe(n){const e=Uint8Array.from(pn.from(n.signature,"hex")),t=TAe(n.transaction.address),r=IAe({publicKey:t,signature:e,payload:n.transaction}),i=pn.from(r).toString("hex");return NAe(i)}var DAe={};const Cte="wc",Tte=2,A7="core",$f=`${Cte}@2:${A7}:`,BAe={logger:"error"},LAe={database:":memory:"},$Ae="crypto",vH="client_ed25519_seed",UAe=Ht.ONE_DAY,jAe="keychain",zAe="0.3",FAe="messages",WAe="0.3",xH=Ht.SIX_HOURS,HAe="publisher",Ite="irn",VAe="error",Nte="wss://relay.walletconnect.org",qAe="relayer",Po={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},KAe="_subscription",_u={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},YAe=.1,S7="2.21.5",is={link_mode:"link_mode",relay:"relay"},g6={inbound:"inbound",outbound:"outbound"},GAe="0.3",ZAe="WALLETCONNECT_CLIENT_ID",EH="WALLETCONNECT_LINK_MODE_APPS",Fl={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},QAe="subscription",XAe="0.3",JAe="pairing",eSe="0.3",AA={wc_pairingDelete:{req:{ttl:Ht.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Ht.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Ht.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Ht.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Ht.ONE_DAY,prompt:!1,tag:0},res:{ttl:Ht.ONE_DAY,prompt:!1,tag:0}}},by={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Od={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},tSe="history",nSe="0.3",rSe="expirer",Pu={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},iSe="0.3",sSe="verify-api",oSe="https://verify.walletconnect.com",Rte="https://verify.walletconnect.org",xS=Rte,aSe=`${xS}/v3`,cSe=[oSe,Rte],lSe="echo",uSe="https://echo.walletconnect.com",uf={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},zp={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Pd={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},ny={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},ry={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"},SA={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},dSe=.1,hSe="event-client",fSe=86400,pSe="https://pulse.walletconnect.org/batch";function gSe(n,e){if(n.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<n.length;i++){var s=n.charAt(i),o=s.charCodeAt(0);if(t[o]!==255)throw new TypeError(s+" is ambiguous");t[o]=i}var a=n.length,c=n.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function f(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var b=0,E=0,T=0,N=y.length;T!==N&&y[T]===0;)T++,b++;for(var I=(N-T)*d+1>>>0,H=new Uint8Array(I);T!==N;){for(var L=y[T],U=0,K=I-1;(L!==0||U<E)&&K!==-1;K--,U++)L+=256*H[K]>>>0,H[K]=L%a>>>0,L=L/a>>>0;if(L!==0)throw new Error("Non-zero carry");E=U,T++}for(var Y=I-E;Y!==I&&H[Y]===0;)Y++;for(var k=c.repeat(b);Y<I;++Y)k+=n.charAt(H[Y]);return k}function m(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;var b=0;if(y[b]!==" "){for(var E=0,T=0;y[b]===c;)E++,b++;for(var N=(y.length-b)*u+1>>>0,I=new Uint8Array(N);y[b];){var H=t[y.charCodeAt(b)];if(H===255)return;for(var L=0,U=N-1;(H!==0||L<T)&&U!==-1;U--,L++)H+=a*I[U]>>>0,I[U]=H%256>>>0,H=H/256>>>0;if(H!==0)throw new Error("Non-zero carry");T=L,b++}if(y[b]!==" "){for(var K=N-T;K!==N&&I[K]===0;)K++;for(var Y=new Uint8Array(E+(N-K)),k=E;K!==N;)Y[k++]=I[K++];return Y}}}function w(y){var b=m(y);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:m,decode:w}}var mSe=gSe,wSe=mSe;const Mte=n=>{if(n instanceof Uint8Array&&n.constructor.name==="Uint8Array")return n;if(n instanceof ArrayBuffer)return new Uint8Array(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength);throw new Error("Unknown type, must be binary type")},ySe=n=>new TextEncoder().encode(n),bSe=n=>new TextDecoder().decode(n);class vSe{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class xSe{constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return kte(this,e)}}class ESe{constructor(e){this.decoders=e}or(e){return kte(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const kte=(n,e)=>new ESe({...n.decoders||{[n.prefix]:n},...e.decoders||{[e.prefix]:e}});class ASe{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new vSe(e,t,r),this.decoder=new xSe(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Z8=({name:n,prefix:e,encode:t,decode:r})=>new ASe(n,e,t,r),HC=({prefix:n,name:e,alphabet:t})=>{const{encode:r,decode:i}=wSe(t,e);return Z8({prefix:n,name:e,encode:r,decode:s=>Mte(i(s))})},SSe=(n,e,t,r)=>{const i={};for(let d=0;d<e.length;++d)i[e[d]]=d;let s=n.length;for(;n[s-1]==="=";)--s;const o=new Uint8Array(s*t/8|0);let a=0,c=0,u=0;for(let d=0;d<s;++d){const f=i[n[d]];if(f===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<t|f,a+=t,a>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},_Se=(n,e,t)=>{const r=e[e.length-1]==="=",i=(1<<t)-1;let s="",o=0,a=0;for(let c=0;c<n.length;++c)for(a=a<<8|n[c],o+=8;o>t;)o-=t,s+=e[i&a>>o];if(o&&(s+=e[i&a<<t-o]),r)for(;s.length*t&7;)s+="=";return s},pa=({name:n,prefix:e,bitsPerChar:t,alphabet:r})=>Z8({prefix:e,name:n,encode(i){return _Se(i,r,t)},decode(i){return SSe(i,r,t,n)}}),CSe=Z8({prefix:"\0",name:"identity",encode:n=>bSe(n),decode:n=>ySe(n)});var TSe=Object.freeze({__proto__:null,identity:CSe});const ISe=pa({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var NSe=Object.freeze({__proto__:null,base2:ISe});const RSe=pa({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var MSe=Object.freeze({__proto__:null,base8:RSe});const kSe=HC({prefix:"9",name:"base10",alphabet:"0123456789"});var OSe=Object.freeze({__proto__:null,base10:kSe});const PSe=pa({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),DSe=pa({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var BSe=Object.freeze({__proto__:null,base16:PSe,base16upper:DSe});const LSe=pa({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),$Se=pa({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),USe=pa({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),jSe=pa({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),zSe=pa({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),FSe=pa({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),WSe=pa({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),HSe=pa({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),VSe=pa({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var qSe=Object.freeze({__proto__:null,base32:LSe,base32upper:$Se,base32pad:USe,base32padupper:jSe,base32hex:zSe,base32hexupper:FSe,base32hexpad:WSe,base32hexpadupper:HSe,base32z:VSe});const KSe=HC({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),YSe=HC({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var GSe=Object.freeze({__proto__:null,base36:KSe,base36upper:YSe});const ZSe=HC({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),QSe=HC({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var XSe=Object.freeze({__proto__:null,base58btc:ZSe,base58flickr:QSe});const JSe=pa({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),e_e=pa({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),t_e=pa({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),n_e=pa({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var r_e=Object.freeze({__proto__:null,base64:JSe,base64pad:e_e,base64url:t_e,base64urlpad:n_e});const Ote=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ðð
91ð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),i_e=Ote.reduce((n,e,t)=>(n[t]=e,n),[]),s_e=Ote.reduce((n,e,t)=>(n[e.codePointAt(0)]=t,n),[]);function o_e(n){return n.reduce((e,t)=>(e+=i_e[t],e),"")}function a_e(n){const e=[];for(const t of n){const r=s_e[t.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(r)}return new Uint8Array(e)}const c_e=Z8({prefix:"ð",name:"base256emoji",encode:o_e,decode:a_e});var l_e=Object.freeze({__proto__:null,base256emoji:c_e}),u_e=Pte,AH=128,d_e=-128,h_e=Math.pow(2,31);function Pte(n,e,t){e=e||[],t=t||0;for(var r=t;n>=h_e;)e[t++]=n&255|AH,n/=128;for(;n&d_e;)e[t++]=n&255|AH,n>>>=7;return e[t]=n|0,Pte.bytes=t-r+1,e}var f_e=_7,p_e=128,SH=127;function _7(n,r){var t=0,r=r||0,i=0,s=r,o,a=n.length;do{if(s>=a)throw _7.bytes=0,new RangeError("Could not decode varint");o=n[s++],t+=i<28?(o&SH)<<i:(o&SH)*Math.pow(2,i),i+=7}while(o>=p_e);return _7.bytes=s-r,t}var g_e=Math.pow(2,7),m_e=Math.pow(2,14),w_e=Math.pow(2,21),y_e=Math.pow(2,28),b_e=Math.pow(2,35),v_e=Math.pow(2,42),x_e=Math.pow(2,49),E_e=Math.pow(2,56),A_e=Math.pow(2,63),S_e=function(n){return n<g_e?1:n<m_e?2:n<w_e?3:n<y_e?4:n<b_e?5:n<v_e?6:n<x_e?7:n<E_e?8:n<A_e?9:10},__e={encode:u_e,decode:f_e,encodingLength:S_e},Dte=__e;const _H=(n,e,t=0)=>(Dte.encode(n,e,t),e),CH=n=>Dte.encodingLength(n),C7=(n,e)=>{const t=e.byteLength,r=CH(n),i=r+CH(t),s=new Uint8Array(i+t);return _H(n,s,0),_H(t,s,r),s.set(e,i),new C_e(n,t,e,s)};
vendor: 53,186 bytes, line 91
91let C_e=class{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}};const Bte=({name:n,code:e,encode:t})=>new T_e(n,e,t);let T_e=class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?C7(this.code,t):t.then(r=>C7(this.code,r))}else throw Error("Unknown type, must be binary type")}};const Lte=n=>async e=>new Uint8Array(await crypto.subtle.digest(n,e)),I_e=Bte({name:"sha2-256",code:18,encode:Lte("SHA-256")}),N_e=Bte({name:"sha2-512",code:19,encode:Lte("SHA-512")});var R_e=Object.freeze({__proto__:null,sha256:I_e,sha512:N_e});const $te=0,M_e="identity",Ute=Mte,k_e=n=>C7($te,Ute(n)),O_e={code:$te,name:M_e,encode:Ute,digest:k_e};var P_e=Object.freeze({__proto__:null,identity:O_e});new TextEncoder,new TextDecoder;const TH={...TSe,...NSe,...MSe,...OSe,...BSe,...qSe,...GSe,...XSe,...r_e,...l_e};({...R_e,...P_e});function jte(n){return globalThis.Buffer!=null?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n}function D_e(n=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?jte(globalThis.Buffer.allocUnsafe(n)):new Uint8Array(n)}function zte(n,e,t,r){return{name:n,prefix:e,encoder:{name:n,prefix:e,encode:t},decoder:{decode:r}}}const IH=zte("utf8","u",n=>"u"+new TextDecoder("utf8").decode(n),n=>new TextEncoder().encode(n.substring(1))),uO=zte("ascii","a",n=>{let e="a";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e},n=>{n=n.substring(1);const e=D_e(n.length);for(let t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e}),B_e={utf8:IH,"utf-8":IH,hex:TH.base16,latin1:uO,ascii:uO,binary:uO,...TH};function L_e(n,e="utf8"){const t=B_e[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?jte(globalThis.Buffer.from(n,"utf-8")):t.decoder.decode(`${t.prefix}${n}`)}var $_e=Object.defineProperty,U_e=(n,e,t)=>e in n?$_e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,tf=(n,e,t)=>U_e(n,typeof e!="symbol"?e+"":e,t);let j_e=class{constructor(e,t){this.core=e,this.logger=t,tf(this,"keychain",new Map),tf(this,"name",jAe),tf(this,"version",zAe),tf(this,"initialized",!1),tf(this,"storagePrefix",$f),tf(this,"init",async()=>{if(!this.initialized){const r=await this.getKeyChain();typeof r<"u"&&(this.keychain=r),this.initialized=!0}}),tf(this,"has",r=>(this.isInitialized(),this.keychain.has(r))),tf(this,"set",async(r,i)=>{this.isInitialized(),this.keychain.set(r,i),await this.persist()}),tf(this,"get",r=>{this.isInitialized();const i=this.keychain.get(r);if(typeof i>"u"){const{message:s}=zt("NO_MATCHING_KEY",`${this.name}: ${r}`);throw new Error(s)}return i}),tf(this,"del",async r=>{this.isInitialized(),this.keychain.delete(r),await this.persist()}),this.core=e,this.logger=Qa(t,this.name)}get context(){return bl(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,u7(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?d7(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var z_e=Object.defineProperty,F_e=(n,e,t)=>e in n?z_e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,qo=(n,e,t)=>F_e(n,typeof e!="symbol"?e+"":e,t);let W_e=class{constructor(e,t,r){this.core=e,this.logger=t,qo(this,"name",$Ae),qo(this,"keychain"),qo(this,"randomSessionIdentifier",x7()),qo(this,"initialized",!1),qo(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),qo(this,"hasKeys",i=>(this.isInitialized(),this.keychain.has(i))),qo(this,"getClientId",async()=>{this.isInitialized();const i=await this.getClientSeed(),s=FF(i);return HJ(s.publicKey)}),qo(this,"generateKeyPair",()=>{this.isInitialized();const i=S3e();return this.setPrivateKey(i.publicKey,i.privateKey)}),qo(this,"signJWT",async i=>{this.isInitialized();const s=await this.getClientSeed(),o=FF(s),a=this.randomSessionIdentifier;return await S0e(a,i,UAe,o)}),qo(this,"generateSharedKey",(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=_3e(a,s);return this.setSymKey(c,o)}),qo(this,"setSymKey",async(i,s)=>{this.isInitialized();const o=s||p6(i);return await this.keychain.set(o,i),o}),qo(this,"deleteKeyPair",async i=>{this.isInitialized(),await this.keychain.del(i)}),qo(this,"deleteSymKey",async i=>{this.isInitialized(),await this.keychain.del(i)}),qo(this,"encode",async(i,s,o)=>{this.isInitialized();const a=Ate(o),c=ag(s);if(cH(a))return I3e(c,o==null?void 0:o.encoding);if(aH(a)){const m=a.senderPublicKey,w=a.receiverPublicKey;i=await this.generateSharedKey(m,w)}const u=this.getSymKey(i),{type:d,senderPublicKey:f}=a;return C3e({type:d,symKey:u,message:c,senderPublicKey:f,encoding:o==null?void 0:o.encoding})}),qo(this,"decode",async(i,s,o)=>{this.isInitialized();const a=R3e(s,o);if(cH(a)){const c=N3e(s,o==null?void 0:o.encoding);return a1(c)}if(aH(a)){const c=a.receiverPublicKey,u=a.senderPublicKey;i=await this.generateSharedKey(c,u)}try{const c=this.getSymKey(i),u=T3e({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return a1(u)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}}),qo(this,"getPayloadType",(i,s=qd)=>{const o=D_({encoded:i,encoding:s});return f1(o.type)}),qo(this,"getPayloadSenderPublicKey",(i,s=qd)=>{const o=D_({encoded:i,encoding:s});return o.senderPublicKey?fl(o.senderPublicKey,xc):void 0}),this.core=e,this.logger=Qa(t,this.name),this.keychain=r||new j_e(this.core,this.logger)}get context(){return bl(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(vH)}catch{e=x7(),await this.keychain.set(vH,e)}return L_e(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var H_e=Object.defineProperty,V_e=Object.defineProperties,q_e=Object.getOwnPropertyDescriptors,NH=Object.getOwnPropertySymbols,K_e=Object.prototype.hasOwnProperty,Y_e=Object.prototype.propertyIsEnumerable,T7=(n,e,t)=>e in n?H_e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,G_e=(n,e)=>{for(var t in e||(e={}))K_e.call(e,t)&&T7(n,t,e[t]);if(NH)for(var t of NH(e))Y_e.call(e,t)&&T7(n,t,e[t]);return n},Z_e=(n,e)=>V_e(n,q_e(e)),jl=(n,e,t)=>T7(n,typeof e!="symbol"?e+"":e,t);let Q_e=class extends Epe{constructor(e,t){super(e,t),this.logger=e,this.core=t,jl(this,"messages",new Map),jl(this,"messagesWithoutClientAck",new Map),jl(this,"name",FAe),jl(this,"version",WAe),jl(this,"initialized",!1),jl(this,"storagePrefix",$f),jl(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const r=await this.getRelayerMessages();typeof r<"u"&&(this.messages=r);const i=await this.getRelayerMessagesWithoutClientAck();typeof i<"u"&&(this.messagesWithoutClientAck=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(r){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(r)}finally{this.initialized=!0}}}),jl(this,"set",async(r,i,s)=>{this.isInitialized();const o=yf(i);let a=this.messages.get(r);if(typeof a>"u"&&(a={}),typeof a[o]<"u")return o;if(a[o]=i,this.messages.set(r,a),s===g6.inbound){const c=this.messagesWithoutClientAck.get(r)||{};this.messagesWithoutClientAck.set(r,Z_e(G_e({},c),{[o]:i}))}return await this.persist(),o}),jl(this,"get",r=>{this.isInitialized();let i=this.messages.get(r);return typeof i>"u"&&(i={}),i}),jl(this,"getWithoutAck",r=>{this.isInitialized();const i={};for(const s of r){const o=this.messagesWithoutClientAck.get(s)||{};i[s]=Object.values(o)}return i}),jl(this,"has",(r,i)=>{this.isInitialized();const s=this.get(r),o=yf(i);return typeof s[o]<"u"}),jl(this,"ack",async(r,i)=>{this.isInitialized();const s=this.messagesWithoutClientAck.get(r);if(typeof s>"u")return;const o=yf(i);delete s[o],Object.keys(s).length===0?this.messagesWithoutClientAck.delete(r):this.messagesWithoutClientAck.set(r,s),await this.persist()}),jl(this,"del",async r=>{this.isInitialized(),this.messages.delete(r),this.messagesWithoutClientAck.delete(r),await this.persist()}),this.logger=Qa(e,this.name),this.core=t}get context(){return bl(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,u7(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,u7(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?d7(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?d7(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var X_e=Object.defineProperty,J_e=Object.defineProperties,eCe=Object.getOwnPropertyDescriptors,RH=Object.getOwnPropertySymbols,tCe=Object.prototype.hasOwnProperty,nCe=Object.prototype.propertyIsEnumerable,I7=(n,e,t)=>e in n?X_e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,wI=(n,e)=>{for(var t in e||(e={}))tCe.call(e,t)&&I7(n,t,e[t]);if(RH)for(var t of RH(e))nCe.call(e,t)&&I7(n,t,e[t]);return n},dO=(n,e)=>J_e(n,eCe(e)),Dd=(n,e,t)=>I7(n,typeof e!="symbol"?e+"":e,t);class rCe extends Ape{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,Dd(this,"events",new Qu.EventEmitter),Dd(this,"name",HAe),Dd(this,"queue",new Map),Dd(this,"publishTimeout",Ht.toMiliseconds(Ht.ONE_MINUTE)),Dd(this,"initialPublishTimeout",Ht.toMiliseconds(Ht.ONE_SECOND*15)),Dd(this,"needsTransportRestart",!1),Dd(this,"publish",async(r,i,s)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:r,message:i,opts:s}});const a=(s==null?void 0:s.ttl)||xH,c=lN(s),u=(s==null?void 0:s.prompt)||!1,d=(s==null?void 0:s.tag)||0,f=(s==null?void 0:s.id)||_y().toString(),m={topic:r,message:i,opts:{ttl:a,relay:c,prompt:u,tag:d,id:f,attestation:s==null?void 0:s.attestation,tvf:s==null?void 0:s.tvf}},w=`Failed to publish payload, please try again. id:${f} tag:${d}`;try{const y=new Promise(async b=>{const E=({id:N})=>{m.opts.id===N&&(this.removeRequestFromQueue(N),this.relayer.events.removeListener(Po.publish,E),b(m))};this.relayer.events.on(Po.publish,E);const T=e0(new Promise((N,I)=>{this.rpcPublish({topic:r,message:i,ttl:a,prompt:u,tag:d,id:f,attestation:s==null?void 0:s.attestation,tvf:s==null?void 0:s.tvf}).then(N).catch(H=>{this.logger.warn(H,H==null?void 0:H.message),I(H)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${f} tag:${d}`);try{await T,this.events.removeListener(Po.publish,E)}catch(N){this.queue.set(f,dO(wI({},m),{attempt:1})),this.logger.warn(N,N==null?void 0:N.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,topic:r,message:i,opts:s}}),await e0(y,this.publishTimeout,w)}catch(y){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(y),(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw y}finally{this.queue.delete(f)}}),Dd(this,"on",(r,i)=>{this.events.on(r,i)}),Dd(this,"once",(r,i)=>{this.events.once(r,i)}),Dd(this,"off",(r,i)=>{this.events.off(r,i)}),Dd(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.relayer=e,this.logger=Qa(t,this.name),this.registerEventListeners()}get context(){return bl(this.logger)}async rpcPublish(e){var t,r,i,s;const{topic:o,message:a,ttl:c=xH,prompt:u,tag:d,id:f,attestation:m,tvf:w}=e,y={method:JA(lN().protocol).publish,params:wI({topic:o,message:a,ttl:c,prompt:u,tag:d,attestation:m},w),id:f};sa((t=y.params)==null?void 0:t.prompt)&&((r=y.params)==null||delete r.prompt),sa((i=y.params)==null?void 0:i.tag)&&((s=y.params)==null||delete s.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:y});const b=await this.relayer.request(y);return this.relayer.events.emit(Po.publish,e),this.logger.debug("Successfully Published Payload"),b}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{const r=e.attempt+1;this.queue.set(t,dO(wI({},e),{attempt:r}));const{topic:i,message:s,opts:o,attestation:a}=e;this.logger.warn({},`Publisher: queue->publishing: ${e.opts.id}, tag: ${e.opts.tag}, attempt: ${r}`),await this.rpcPublish(dO(wI({},e),{topic:i,message:s,ttl:o.ttl,prompt:o.prompt,tag:o.tag,id:o.id,attestation:a,tvf:o.tvf})),this.logger.warn({},`Publisher: queue->published: ${e.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(W1.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Po.connection_stalled);return}this.checkQueue()}),this.relayer.on(Po.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}var iCe=Object.defineProperty,sCe=(n,e,t)=>e in n?iCe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Yv=(n,e,t)=>sCe(n,typeof e!="symbol"?e+"":e,t);class oCe{constructor(){Yv(this,"map",new Map),Yv(this,"set",(e,t)=>{const r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])}),Yv(this,"get",e=>this.map.get(e)||[]),Yv(this,"exists",(e,t)=>this.get(e).includes(t)),Yv(this,"delete",(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,t))return;const i=r.filter(s=>s!==t);if(!i.length){this.map.delete(e);return}this.map.set(e,i)}),Yv(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var aCe=Object.defineProperty,cCe=Object.defineProperties,lCe=Object.getOwnPropertyDescriptors,MH=Object.getOwnPropertySymbols,uCe=Object.prototype.hasOwnProperty,dCe=Object.prototype.propertyIsEnumerable,N7=(n,e,t)=>e in n?aCe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,_A=(n,e)=>{for(var t in e||(e={}))uCe.call(e,t)&&N7(n,t,e[t]);if(MH)for(var t of MH(e))dCe.call(e,t)&&N7(n,t,e[t]);return n},hO=(n,e)=>cCe(n,lCe(e)),$i=(n,e,t)=>N7(n,typeof e!="symbol"?e+"":e,t);let hCe=class extends Cpe{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,$i(this,"subscriptions",new Map),$i(this,"topicMap",new oCe),$i(this,"events",new Qu.EventEmitter),$i(this,"name",QAe),$i(this,"version",XAe),$i(this,"pending",new Map),$i(this,"cached",[]),$i(this,"initialized",!1),$i(this,"storagePrefix",$f),$i(this,"subscribeTimeout",Ht.toMiliseconds(Ht.ONE_MINUTE)),$i(this,"initialSubscribeTimeout",Ht.toMiliseconds(Ht.ONE_SECOND*15)),$i(this,"clientId"),$i(this,"batchSubscribeTopicsLimit",500),$i(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),$i(this,"subscribe",async(r,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:i}});try{const s=lN(i),o={topic:r,relay:s,transportType:i==null?void 0:i.transportType};this.pending.set(r,o);const a=await this.rpcSubscribe(r,s,i);return typeof a=="string"&&(this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:i}})),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}}),$i(this,"unsubscribe",async(r,i)=>{this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(r,i.id,i):await this.unsubscribeByTopic(r,i)}),$i(this,"isSubscribed",r=>new Promise(i=>{i(this.topicMap.topics.includes(r))})),$i(this,"isKnownTopic",r=>new Promise(i=>{i(this.topicMap.topics.includes(r)||this.pending.has(r)||this.cached.some(s=>s.topic===r))})),$i(this,"on",(r,i)=>{this.events.on(r,i)}),$i(this,"once",(r,i)=>{this.events.once(r,i)}),$i(this,"off",(r,i)=>{this.events.off(r,i)}),$i(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),$i(this,"start",async()=>{await this.onConnect()}),$i(this,"stop",async()=>{await this.onDisconnect()}),$i(this,"restart",async()=>{await this.restore(),await this.onRestart()}),$i(this,"checkPending",async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const r=[];this.pending.forEach(i=>{r.push(i)}),await this.batchSubscribe(r)}),$i(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(W1.pulse,async()=>{await this.checkPending()}),this.events.on(Fl.created,async r=>{const i=Fl.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()}),this.events.on(Fl.deleted,async r=>{const i=Fl.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()})}),this.relayer=e,this.logger=Qa(t,this.name),this.clientId=""}get context(){return bl(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const r=this.topicMap.get(e);await Promise.all(r.map(async i=>await this.unsubscribeById(e,i,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{const i=lN(r);await this.restartToComplete({topic:e,id:t,relay:i}),await this.rpcUnsubscribe(e,t,i);const s=hs("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,t,r){var i;(!r||(r==null?void 0:r.transportType)===is.relay)&&await this.restartToComplete({topic:e,id:e,relay:t});const s={method:JA(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const o=(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;try{const a=await this.getSubscriptionId(e);if((r==null?void 0:r.transportType)===is.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(d=>this.logger.warn(d))},Ht.toMiliseconds(Ht.ONE_SECOND)),a;const c=new Promise(async d=>{const f=m=>{m.topic===e&&(this.events.removeListener(Fl.created,f),d(m.id))};this.events.on(Fl.created,f);try{const m=await e0(new Promise((w,y)=>{this.relayer.request(s).catch(b=>{this.logger.warn(b,b==null?void 0:b.message),y(b)}).then(w)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(Fl.created,f),d(m)}catch{}}),u=await e0(c,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!u&&o)throw new Error(`Subscribing to ${e} failed, please try again`);return u?a:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Po.connection_stalled),o)throw a}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,r={method:JA(t.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{await await e0(new Promise(i=>{this.relayer.request(r).catch(s=>this.logger.warn(s)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(Po.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t=e[0].relay,r={method:JA(t.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});let i;try{i=await await e0(new Promise((s,o)=>{this.relayer.request(r).catch(a=>{this.logger.warn(a),o(a)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(Po.connection_stalled)}return i}rpcUnsubscribe(e,t,r){const i={method:JA(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,t){this.setSubscription(e,hO(_A({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,_A({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,_A({},t)),this.topicMap.set(t.topic,e),this.events.emit(Fl.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:r}=zt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(r)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(Fl.deleted,hO(_A({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Fl.sync)}async onRestart(){if(this.cached.length){const e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<t;r++){const i=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(i)}}this.events.emit(Fl.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=zt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async t=>hO(_A({},t),{id:await this.getSubscriptionId(t.topic)})))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await q2e(Ht.toMiliseconds(Ht.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return yf(e+await this.getClientId())}};var fCe=Object.defineProperty,kH=Object.getOwnPropertySymbols,pCe=Object.prototype.hasOwnProperty,gCe=Object.prototype.propertyIsEnumerable,R7=(n,e,t)=>e in n?fCe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,OH=(n,e)=>{for(var t in e||(e={}))pCe.call(e,t)&&R7(n,t,e[t]);if(kH)for(var t of kH(e))gCe.call(e,t)&&R7(n,t,e[t]);return n},ri=(n,e,t)=>R7(n,typeof e!="symbol"?e+"":e,t);let mCe=class extends Spe{constructor(e){super(e),ri(this,"protocol","wc"),ri(this,"version",2),ri(this,"core"),ri(this,"logger"),ri(this,"events",new Qu.EventEmitter),ri(this,"provider"),ri(this,"messages"),ri(this,"subscriber"),ri(this,"publisher"),ri(this,"name",qAe),ri(this,"transportExplicitlyClosed",!1),ri(this,"initialized",!1),ri(this,"connectionAttemptInProgress",!1),ri(this,"relayUrl"),ri(this,"projectId"),ri(this,"packageName"),ri(this,"bundleId"),ri(this,"hasExperiencedNetworkDisruption",!1),ri(this,"pingTimeout"),ri(this,"heartBeatTimeout",Ht.toMiliseconds(Ht.THIRTY_SECONDS+Ht.FIVE_SECONDS)),ri(this,"reconnectTimeout"),ri(this,"connectPromise"),ri(this,"reconnectInProgress",!1),ri(this,"requestsInFlight",[]),ri(this,"connectTimeout",Ht.toMiliseconds(Ht.ONE_SECOND*15)),ri(this,"request",async t=>{var r,i;this.logger.debug("Publishing Request Payload");const s=t.id||_y().toString();await this.toEstablishConnection();try{this.logger.trace({id:s,method:t.method,topic:(r=t.params)==null?void 0:r.topic},"relayer.request - publishing...");const o=`${s}:${((i=t.params)==null?void 0:i.tag)||""}`;this.requestsInFlight.push(o);const a=await this.provider.request(t);return this.requestsInFlight=this.requestsInFlight.filter(c=>c!==o),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}}),ri(this,"resetPingTimeout",()=>{sN()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var t,r,i,s;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(s=(i=(r=(t=this.provider)==null?void 0:t.connection)==null?void 0:r.socket)==null?void 0:i.terminate)==null||s.call(i)}catch(o){this.logger.warn(o,o==null?void 0:o.message)}},this.heartBeatTimeout))}),ri(this,"onPayloadHandler",t=>{this.onProviderPayload(t),this.resetPingTimeout()}),ri(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected ð"),this.startPingTimeout(),this.events.emit(Po.connect)}),ri(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected ð"),this.requestsInFlight=[],this.onProviderDisconnect()}),ri(this,"onProviderErrorHandler",t=>{this.logger.fatal(`Fatal socket error: ${t.message}`),this.events.emit(Po.error,t),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),ri(this,"registerProviderListeners",()=>{this.provider.on(_u.payload,this.onPayloadHandler),this.provider.on(_u.connect,this.onConnectHandler),this.provider.on(_u.disconnect,this.onDisconnectHandler),this.provider.on(_u.error,this.onProviderErrorHandler)}),this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Qa(e.logger,this.name):DC(qx({level:e.logger||VAe})),this.messages=new Q_e(this.logger,e.core),this.subscriber=new hCe(this,this.logger),this.publisher=new rCe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Nte,this.projectId=e.projectId,R2e()?this.packageName=NW():M2e()&&(this.bundleId=NW()),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e==null?void 0:e.message))}get context(){return bl(this.logger)}get connected(){var e,t,r;return((r=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:r.readyState)===1||!1}get connecting(){var e,t,r;return((r=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:r.readyState)===0||this.connectPromise!==void 0||!1}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:is.relay},g6.outbound)}async subscribe(e,t){var r,i,s;this.isInitialized(),(!(t!=null&&t.transportType)||(t==null?void 0:t.transportType)==="relay")&&await this.toEstablishConnection();const o=typeof((r=t==null?void 0:t.internal)==null?void 0:r.throwOnFailedPublish)>"u"?!0:(i=t==null?void 0:t.internal)==null?void 0:i.throwOnFailedPublish;let a=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",c;const u=d=>{d.topic===e&&(this.subscriber.off(Fl.created,u),c())};return await Promise.all([new Promise(d=>{c=d,this.subscriber.on(Fl.created,u)}),new Promise(async(d,f)=>{a=await this.subscriber.subscribe(e,OH({internal:{throwOnFailedPublish:o}},t)).catch(m=>{o&&f(m)})||a,d()})]),a}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await e0(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(t,r)=>{await this.connect(e).then(t).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await bH())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const t=e.sort((r,i)=>r.publishedAt-i.publishedAt);this.logger.debug(`Batch of ${t.length} message events sorted`);for(const r of t)try{await this.onMessageEvent(r)}catch(i){this.logger.warn(i,"Error while processing batch message event: "+(i==null?void 0:i.message))}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){const{topic:r}=e;if(!t.sessionExists){const i=wo(Ht.FIVE_MINUTES),s={topic:r,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,s)}this.events.emit(Po.message,e),await this.recordMessageEvent(e,g6.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let t=1;for(;t<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise(async(r,i)=>{const s=()=>{i(new Error("Connection interrupted while trying to connect"))};this.provider.once(_u.disconnect,s),await e0(new Promise((o,a)=>{this.provider.connect().then(o).catch(a)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{i(o)}).finally(()=>{this.provider.off(_u.disconnect,s),clearTimeout(this.reconnectTimeout)}),await new Promise(async(o,a)=>{const c=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(_u.disconnect,c),await this.subscriber.start().then(o).catch(a).finally(()=>{this.provider.off(_u.disconnect,c)})}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){await this.subscriber.stop();const i=r;this.logger.warn({},i.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(r=>setTimeout(r,Ht.toMiliseconds(t*1))),t++}}startPingTimeout(){var e,t,r,i,s;if(sN())try{(t=(e=this.provider)==null?void 0:e.connection)!=null&&t.socket&&((s=(i=(r=this.provider)==null?void 0:r.connection)==null?void 0:i.socket)==null||s.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o,o==null?void 0:o.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Xu(new A1e(B2e({sdkVersion:S7,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){const{topic:r,message:i}=e;await this.messages.set(r,i,t)}async shouldIgnoreMessageEvent(e){const{topic:t,message:r}=e;if(!r||r.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;const i=this.messages.has(t,r);return i&&this.logger.warn(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),v$(e)){if(!e.method.endsWith(KAe))return;const t=e.params,{topic:r,message:i,publishedAt:s,attestation:o}=t.data,a={topic:r,message:i,publishedAt:s,transportType:is.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(OH({type:"event",event:t.id},a)),this.events.emit(t.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else U8(e)&&this.events.emit(Po.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,g6.inbound),this.events.emit(Po.message,e))}async acknowledgePayload(e){const t=L8(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(_u.payload,this.onPayloadHandler),this.provider.off(_u.connect,this.onConnectHandler),this.provider.off(_u.disconnect,this.onDisconnectHandler),this.provider.off(_u.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await bH();AAe(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(r=>this.logger.error(r,r==null?void 0:r.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(W1.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&CAe())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(t){this.logger.warn(t,t==null?void 0:t.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(Po.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e==null?void 0:e.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},Ht.toMiliseconds(YAe)))))}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}};function wCe(n,e){return n===e||Number.isNaN(n)&&Number.isNaN(e)}function PH(n){return Object.getOwnPropertySymbols(n).filter(e=>Object.prototype.propertyIsEnumerable.call(n,e))}function DH(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const yCe="[object RegExp]",bCe="[object String]",vCe="[object Number]",xCe="[object Boolean]",BH="[object Arguments]",ECe="[object Symbol]",ACe="[object Date]",SCe="[object Map]",_Ce="[object Set]",CCe="[object Array]",TCe="[object Function]",ICe="[object ArrayBuffer]",fO="[object Object]",NCe="[object Error]",RCe="[object DataView]",MCe="[object Uint8Array]",kCe="[object Uint8ClampedArray]",OCe="[object Uint16Array]",PCe="[object Uint32Array]",DCe="[object BigUint64Array]",BCe="[object Int8Array]",LCe="[object Int16Array]",$Ce="[object Int32Array]",UCe="[object BigInt64Array]",jCe="[object Float32Array]",zCe="[object Float64Array]";function FCe(){}function LH(n){if(!n||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(n)==="[object Object]":!1}function WCe(n,e,t){return eS(n,e,void 0,void 0,void 0,void 0,t)}function eS(n,e,t,r,i,s,o){const a=o(n,e,t,r,i,s);if(a!==void 0)return a;if(typeof n==typeof e)switch(typeof n){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return n===e;case"number":return n===e||Object.is(n,e);case"function":return n===e;case"object":return ES(n,e,s,o)}return ES(n,e,s,o)}function ES(n,e,t,r){if(Object.is(n,e))return!0;let i=DH(n),s=DH(e);if(i===BH&&(i=fO),s===BH&&(s=fO),i!==s)return!1;switch(i){case bCe:return n.toString()===e.toString();case vCe:{const c=n.valueOf(),u=e.valueOf();return wCe(c,u)}case xCe:case ACe:case ECe:return Object.is(n.valueOf(),e.valueOf());case yCe:return n.source===e.source&&n.flags===e.flags;case TCe:return n===e}t=t??new Map;const o=t.get(n),a=t.get(e);if(o!=null&&a!=null)return o===e;t.set(n,e),t.set(e,n);try{switch(i){case SCe:{if(n.size!==e.size)return!1;for(const[c,u]of n.entries())if(!e.has(c)||!eS(u,e.get(c),c,n,e,t,r))return!1;return!0}case _Ce:{if(n.size!==e.size)return!1;const c=Array.from(n.values()),u=Array.from(e.values());for(let d=0;d<c.length;d++){const f=c[d],m=u.findIndex(w=>eS(f,w,void 0,n,e,t,r));if(m===-1)return!1;u.splice(m,1)}return!0}case CCe:case MCe:case kCe:case OCe:case PCe:case DCe:case BCe:case LCe:case $Ce:case UCe:case jCe:case zCe:{if(typeof pn<"u"&&pn.isBuffer(n)!==pn.isBuffer(e)||n.length!==e.length)return!1;for(let c=0;c<n.length;c++)if(!eS(n[c],e[c],c,n,e,t,r))return!1;return!0}case ICe:return n.byteLength!==e.byteLength?!1:ES(new Uint8Array(n),new Uint8Array(e),t,r);case RCe:return n.byteLength!==e.byteLength||n.byteOffset!==e.byteOffset?!1:ES(new Uint8Array(n),new Uint8Array(e),t,r);case NCe:return n.name===e.name&&n.message===e.message;case fO:{if(!(ES(n.constructor,e.constructor,t,r)||LH(n)&&LH(e)))return!1;const c=[...Object.keys(n),...PH(n)],u=[...Object.keys(e),...PH(e)];if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++){const f=c[d],m=n[f];if(!Object.hasOwn(e,f))return!1;const w=e[f];if(!eS(m,w,f,n,e,t,r))return!1}return!0}default:return!1}}finally{t.delete(n),t.delete(e)}}function HCe(n,e){return WCe(n,e,FCe)}var VCe=Object.defineProperty,$H=Object.getOwnPropertySymbols,qCe=Object.prototype.hasOwnProperty,KCe=Object.prototype.propertyIsEnumerable,M7=(n,e,t)=>e in n?VCe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,UH=(n,e)=>{for(var t in e||(e={}))qCe.call(e,t)&&M7(n,t,e[t]);if($H)for(var t of $H(e))KCe.call(e,t)&&M7(n,t,e[t]);return n},Qc=(n,e,t)=>M7(n,typeof e!="symbol"?e+"":e,t);let V1=class extends _pe{constructor(e,t,r,i=$f,s=void 0){super(e,t,r,i),this.core=e,this.logger=t,this.name=r,Qc(this,"map",new Map),Qc(this,"version",GAe),Qc(this,"cached",[]),Qc(this,"initialized",!1),Qc(this,"getKey"),Qc(this,"storagePrefix",$f),Qc(this,"recentlyDeleted",[]),Qc(this,"recentlyDeletedLimit",200),Qc(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!sa(o)?this.map.set(this.getKey(o),o):eAe(o)?this.map.set(o.id,o):tAe(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)}),Qc(this,"set",async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())}),Qc(this,"get",o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o))),Qc(this,"getAll",o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>HCe(a[c],o[c]))):this.values)),Qc(this,"update",async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=UH(UH({},this.getData(o)),a);this.map.set(o,c),await this.persist()}),Qc(this,"delete",async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())}),this.logger=Qa(t,this.name),this.storagePrefix=i,this.getKey=s}get context(){return bl(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:i}=zt("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:r}=zt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(r),new Error(r)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:t}=zt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var YCe=Object.defineProperty,GCe=(n,e,t)=>e in n?YCe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,zr=(n,e,t)=>GCe(n,typeof e!="symbol"?e+"":e,t);let ZCe=class{constructor(e,t){this.core=e,this.logger=t,zr(this,"name",JAe),zr(this,"version",eSe),zr(this,"events",new o$),zr(this,"pairings"),zr(this,"initialized",!1),zr(this,"storagePrefix",$f),zr(this,"ignoredPayloadTypes",[ig]),zr(this,"registeredMethods",[]),zr(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),zr(this,"register",({methods:r})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...r])]}),zr(this,"create",async r=>{this.isInitialized();const i=x7(),s=await this.core.crypto.setSymKey(i),o=wo(Ht.FIVE_MINUTES),a={protocol:Ite},c={topic:s,expiry:o,relay:a,active:!1,methods:r==null?void 0:r.methods},u=uH({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:a,expiryTimestamp:o,methods:r==null?void 0:r.methods});return this.events.emit(by.create,c),this.core.expirer.set(s,o),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:r==null?void 0:r.transportType}),{topic:s,uri:u}}),zr(this,"pair",async r=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:r==null?void 0:r.uri,trace:[uf.pairing_started]}});this.isValidPair(r,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:u}=lH(r.uri);i.props.properties.topic=s,i.addTrace(uf.pairing_uri_validation_success),i.addTrace(uf.pairing_uri_not_expired);let d;if(this.pairings.keys.includes(s)){if(d=this.pairings.get(s),i.addTrace(uf.existing_pairing),d.active)throw i.setError(zp.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(uf.pairing_not_expired)}const f=c||wo(Ht.FIVE_MINUTES),m={topic:s,relay:a,expiry:f,active:!1,methods:u};this.core.expirer.set(s,f),await this.pairings.set(s,m),i.addTrace(uf.store_new_pairing),r.activatePairing&&await this.activate({topic:s}),this.events.emit(by.create,m),i.addTrace(uf.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(uf.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(zp.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(w){throw i.setError(zp.subscribe_pairing_topic_failure),w}return i.addTrace(uf.subscribe_pairing_topic_success),m}),zr(this,"activate",async({topic:r})=>{this.isInitialized();const i=wo(Ht.FIVE_MINUTES);this.core.expirer.set(r,i),await this.pairings.update(r,{active:!0,expiry:i})}),zr(this,"ping",async r=>{this.isInitialized(),await this.isValidPing(r),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:i}=r;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=fy();this.events.once(yi("pairing_ping",s),({error:u})=>{u?c(u):a()}),await o()}}),zr(this,"updateExpiry",async({topic:r,expiry:i})=>{this.isInitialized(),await this.pairings.update(r,{expiry:i})}),zr(this,"updateMetadata",async({topic:r,metadata:i})=>{this.isInitialized(),await this.pairings.update(r,{peerMetadata:i})}),zr(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),zr(this,"disconnect",async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:i}=r;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",hs("USER_DISCONNECTED")),await this.deletePairing(i))}),zr(this,"formatUriFromPairing",r=>{this.isInitialized();const{topic:i,relay:s,expiry:o,methods:a}=r,c=this.core.crypto.keychain.get(i);return uH({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:s,expiryTimestamp:o,methods:a})}),zr(this,"sendRequest",async(r,i,s)=>{const o=Jm(i,s),a=await this.core.crypto.encode(r,o),c=AA[i].req;return this.core.history.set(r,o),this.core.relayer.publish(r,a,c),o.id}),zr(this,"sendResult",async(r,i,s)=>{const o=L8(r,s),a=await this.core.crypto.encode(i,o),c=(await this.core.history.get(i,r)).request.method,u=AA[c].res;await this.core.relayer.publish(i,a,u),await this.core.history.resolve(o)}),zr(this,"sendError",async(r,i,s)=>{const o=$8(r,s),a=await this.core.crypto.encode(i,o),c=(await this.core.history.get(i,r)).request.method,u=AA[c]?AA[c].res:AA.unregistered_method.res;await this.core.relayer.publish(i,a,u),await this.core.history.resolve(o)}),zr(this,"deletePairing",async(r,i)=>{await this.core.relayer.unsubscribe(r),await Promise.all([this.pairings.delete(r,hs("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(r),i?Promise.resolve():this.core.expirer.del(r)])}),zr(this,"cleanup",async()=>{const r=this.pairings.getAll().filter(i=>Hm(i.expiry));await Promise.all(r.map(i=>this.deletePairing(i.topic)))}),zr(this,"onRelayEventRequest",async r=>{const{topic:i,payload:s}=r;switch(s.method){case"wc_pairingPing":return await this.onPairingPingRequest(i,s);case"wc_pairingDelete":return await this.onPairingDeleteRequest(i,s);default:return await this.onUnknownRpcMethodRequest(i,s)}}),zr(this,"onRelayEventResponse",async r=>{const{topic:i,payload:s}=r,o=(await this.core.history.get(i,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}}),zr(this,"onPairingPingRequest",async(r,i)=>{const{id:s}=i;try{this.isValidPing({topic:r}),await this.sendResult(s,r,!0),this.events.emit(by.ping,{id:s,topic:r})}catch(o){await this.sendError(s,r,o),this.logger.error(o)}}),zr(this,"onPairingPingResponse",(r,i)=>{const{id:s}=i;setTimeout(()=>{pf(i)?this.events.emit(yi("pairing_ping",s),{}):$u(i)&&this.events.emit(yi("pairing_ping",s),{error:i.error})},500)}),zr(this,"onPairingDeleteRequest",async(r,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:r}),await this.deletePairing(r),this.events.emit(by.delete,{id:s,topic:r})}catch(o){await this.sendError(s,r,o),this.logger.error(o)}}),zr(this,"onUnknownRpcMethodRequest",async(r,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=hs("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,r,a),this.logger.error(a)}catch(a){await this.sendError(s,r,a),this.logger.error(a)}}),zr(this,"onUnknownRpcMethodResponse",r=>{this.registeredMethods.includes(r)||this.logger.error(hs("WC_METHOD_UNSUPPORTED",r))}),zr(this,"isValidPair",(r,i)=>{var s;if(!tl(r)){const{message:a}=zt("MISSING_OR_INVALID",`pair() params: ${r}`);throw i.setError(zp.malformed_pairing_uri),new Error(a)}if(!J3e(r.uri)){const{message:a}=zt("MISSING_OR_INVALID",`pair() uri: ${r.uri}`);throw i.setError(zp.malformed_pairing_uri),new Error(a)}const o=lH(r==null?void 0:r.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=zt("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(zp.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=zt("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(zp.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&Ht.toMiliseconds(o==null?void 0:o.expiryTimestamp)<Date.now()){i.setError(zp.pairing_expired);const{message:a}=zt("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(a)}}),zr(this,"isValidPing",async r=>{if(!tl(r)){const{message:s}=zt("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(s)}const{topic:i}=r;await this.isValidPairingTopic(i)}),zr(this,"isValidDisconnect",async r=>{if(!tl(r)){const{message:s}=zt("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(s)}const{topic:i}=r;await this.isValidPairingTopic(i)}),zr(this,"isValidPairingTopic",async r=>{if(!uo(r,!1)){const{message:i}=zt("MISSING_OR_INVALID",`pairing topic should be a string: ${r}`);throw new Error(i)}if(!this.pairings.keys.includes(r)){const{message:i}=zt("NO_MATCHING_KEY",`pairing topic doesn't exist: ${r}`);throw new Error(i)}if(Hm(this.pairings.get(r).expiry)){await this.deletePairing(r);const{message:i}=zt("EXPIRED",`pairing topic: ${r}`);throw new Error(i)}}),this.core=e,this.logger=Qa(t,this.name),this.pairings=new V1(this.core,this.logger,this.name,this.storagePrefix)}get context(){return bl(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Po.message,async e=>{const{topic:t,message:r,transportType:i}=e;if(this.pairings.keys.includes(t)&&i!==is.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{const s=await this.core.crypto.decode(t,r);v$(s)?(this.core.history.set(t,s),await this.onRelayEventRequest({topic:t,payload:s})):U8(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:t,payload:s}),this.core.history.delete(t,s.id)),await this.core.relayer.messages.ack(t,r)}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(Pu.expired,async e=>{const{topic:t}=Oee(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(by.expire,{topic:t}))})}};var QCe=Object.defineProperty,XCe=(n,e,t)=>e in n?QCe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ko=(n,e,t)=>XCe(n,typeof e!="symbol"?e+"":e,t);let JCe=class extends xpe{constructor(e,t){super(e,t),this.core=e,this.logger=t,Ko(this,"records",new Map),Ko(this,"events",new Qu.EventEmitter),Ko(this,"name",tSe),Ko(this,"version",nSe),Ko(this,"cac
91hed",[]),Ko(this,"initialized",!1),Ko(this,"storagePrefix",$f),Ko(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.records.set(r.id,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Ko(this,"set",(r,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:r,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:r,request:{method:i.method,params:i.params||null},chainId:s,expiry:wo(Ht.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(Od.created,o)}),Ko(this,"resolve",async r=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:r}),!this.records.has(r.id))return;const i=await this.getRecord(r.id);typeof i.response>"u"&&(i.response=$u(r)?{error:r.error}:{result:r.result},this.records.set(i.id,i),this.persist(),this.events.emit(Od.updated,i))}),Ko(this,"get",async(r,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:r,id:i}),await this.getRecord(i))),Ko(this,"delete",(r,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===r){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(Od.deleted,s)}}),this.persist()}),Ko(this,"exists",async(r,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===r:!1)),Ko(this,"on",(r,i)=>{this.events.on(r,i)}),Ko(this,"once",(r,i)=>{this.events.once(r,i)}),Ko(this,"off",(r,i)=>{this.events.off(r,i)}),Ko(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.logger=Qa(t,this.name)}get context(){return bl(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const r={topic:t.topic,request:Jm(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:r}=zt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(r)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Od.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=zt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Od.created,e=>{const t=Od.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(Od.updated,e=>{const t=Od.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(Od.deleted,e=>{const t=Od.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(W1.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{Ht.toMiliseconds(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(Od.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var e4e=Object.defineProperty,t4e=(n,e,t)=>e in n?e4e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ba=(n,e,t)=>t4e(n,typeof e!="symbol"?e+"":e,t);let n4e=class extends Tpe{constructor(e,t){super(e,t),this.core=e,this.logger=t,Ba(this,"expirations",new Map),Ba(this,"events",new Qu.EventEmitter),Ba(this,"name",rSe),Ba(this,"version",iSe),Ba(this,"cac
91hed",[]),Ba(this,"initialized",!1),Ba(this,"storagePrefix",$f),Ba(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.expirations.set(r.target,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Ba(this,"has",r=>{try{const i=this.formatTarget(r);return typeof this.getExpiration(i)<"u"}catch{return!1}}),Ba(this,"set",(r,i)=>{this.isInitialized();const s=this.formatTarget(r),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Pu.created,{target:s,expiration:o})}),Ba(this,"get",r=>{this.isInitialized();const i=this.formatTarget(r);return this.getExpiration(i)}),Ba(this,"del",r=>{if(this.isInitialized(),this.has(r)){const i=this.formatTarget(r),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Pu.deleted,{target:i,expiration:s})}}),Ba(this,"on",(r,i)=>{this.events.on(r,i)}),Ba(this,"once",(r,i)=>{this.events.once(r,i)}),Ba(this,"off",(r,i)=>{this.events.off(r,i)}),Ba(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.logger=Qa(t,this.name)}get context(){return bl(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return L2e(e);if(typeof e=="number")return $2e(e);const{message:t}=zt("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Pu.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=zt("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:r}=zt("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(r),new Error(r)}return t}checkExpiry(e,t){const{expiry:r}=t;Ht.toMiliseconds(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Pu.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(W1.pulse,()=>this.checkExpirations()),this.events.on(Pu.created,e=>{const t=Pu.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Pu.expired,e=>{const t=Pu.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Pu.deleted,e=>{const t=Pu.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}};var r4e=Object.defineProperty,i4e=(n,e,t)=>e in n?r4e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,so=(n,e,t)=>i4e(n,typeof e!="symbol"?e+"":e,t);let s4e=class extends Ipe{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,so(this,"name",sSe),so(this,"abortController"),so(this,"isDevEnv"),so(this,"verifyUrlV3",aSe),so(this,"storagePrefix",$f),so(this,"version",Tte),so(this,"publicKey"),so(this,"fetchPromise"),so(this,"init",async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Ht.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),so(this,"register",async i=>{if(!Zx()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:a}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;try{const u=cg.getDocument(),d=this.startAbortTimer(Ht.ONE_SECOND*5),f=await new Promise((m,w)=>{const y=()=>{window.removeEventListener("message",E),u.body.removeChild(b),w("attestation aborted")};this.abortController.signal.addEventListener("abort",y);const b=u.createElement("iframe");b.src=c,b.style.display="none",b.addEventListener("error",y,{signal:this.abortController.signal});const E=T=>
vendor: 71,658 bytes, line 91
91{if(T.data&&typeof T.data=="string")try{const N=JSON.parse(T.data);if(N.type==="verify_attestation"){if(GD(N.attestation).payload.id!==o)return;clearInterval(d),u.body.removeChild(b),this.abortController.signal.removeEventListener("abort",y),window.removeEventListener("message",E),m(N.attestation===null?"":N.attestation)}}catch(N){this.logger.warn(N)}};u.body.appendChild(b),window.addEventListener("message",E,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",f),f}catch(u){this.logger.warn(u)}return""}),so(this,"resolve",async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:o,encryptedId:a}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(GD(s).payload.id!==a)return;const u=await this.isValidJwtAttestation(s);if(u){if(!u.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return u}}if(!o)return;const c=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,c)}),so(this,"fetchAttestation",async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const o=this.startAbortTimer(Ht.ONE_SECOND*5),a=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0}),so(this,"getVerifyUrl",i=>{let s=i||xS;return cSe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${xS}`),s=xS),s}),so(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(Ht.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.json()}catch(i){this.logger.warn(i)}}),so(this,"persistPublicKey",async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i}),so(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),so(this,"isValidJwtAttestation",async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}}),so(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),so(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i}),so(this,"validateAttestation",(i,s)=>{const o=k3e(i,s.publicKey),a={hasExpired:Ht.toMiliseconds(o.exp)<Date.now(),payload:o};if(a.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:a.payload.origin,isScam:a.payload.isScam,isVerified:a.payload.isVerified}}),this.logger=Qa(t,this.name),this.abortController=new AbortController,this.isDevEnv=x$(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return bl(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Ht.toMiliseconds(e))}};var o4e=Object.defineProperty,a4e=(n,e,t)=>e in n?o4e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,jH=(n,e,t)=>a4e(n,typeof e!="symbol"?e+"":e,t);let c4e=class extends Npe{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,jH(this,"context",lSe),jH(this,"registerDeviceToken",async r=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=r,c=`${uSe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})}),this.logger=Qa(t,this.context)}};var l4e=Object.defineProperty,zH=Object.getOwnPropertySymbols,u4e=Object.prototype.hasOwnProperty,d4e=Object.prototype.propertyIsEnumerable,k7=(n,e,t)=>e in n?l4e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,CA=(n,e)=>{for(var t in e||(e={}))u4e.call(e,t)&&k7(n,t,e[t]);if(zH)for(var t of zH(e))d4e.call(e,t)&&k7(n,t,e[t]);return n},Io=(n,e,t)=>k7(n,typeof e!="symbol"?e+"":e,t);let h4e=class extends Rpe{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,Io(this,"context",hSe),Io(this,"storagePrefix",$f),Io(this,"storageVersion",dSe),Io(this,"events",new Map),Io(this,"shouldPersist",!1),Io(this,"init",async()=>{if(!x$())try{const i={eventId:MW(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Mee(this.core.relayer.protocol,this.core.relayer.version,S7)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}}),Io(this,"createEvent",i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,u=MW(),d=this.core.projectId||"",f=Date.now(),m=CA({eventId:u,timestamp:f,props:{event:s,type:o,properties:{topic:a,trace:c}},bundleId:d,domain:this.getAppDomain()},this.setMethods(u));return this.telemetryEnabled&&(this.events.set(u,m),this.shouldPersist=!0),m}),Io(this,"getEvent",i=>{const{eventId:s,topic:o}=i;if(s)return this.events.get(s);const a=Array.from(this.events.values()).find(c=>c.props.properties.topic===o);if(a)return CA(CA({},a),this.setMethods(a.eventId))}),Io(this,"deleteEvent",i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0}),Io(this,"setEventListeners",()=>{this.core.heartbeat.on(W1.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{Ht.fromMiliseconds(Date.now())-Ht.fromMiliseconds(i.timestamp)>fSe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})}),Io(this,"setMethods",i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)})),Io(this,"addTrace",(i,s)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(s),this.events.set(i,o),this.shouldPersist=!0)}),Io(this,"setError",(i,s)=>{const o=this.events.get(i);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(i,o),this.shouldPersist=!0)}),Io(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),Io(this,"restore",async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(s=>{this.events.set(s.eventId,CA(CA({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}}),Io(this,"submit",async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}}),Io(this,"sendEvent",async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${pSe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${S7}${s}`,{method:"POST",body:JSON.stringify(i)})}),Io(this,"getAppDomain",()=>Ree().url),this.logger=Qa(t,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}};var f4e=Object.defineProperty,FH=Object.getOwnPropertySymbols,p4e=Object.prototype.hasOwnProperty,g4e=Object.prototype.propertyIsEnumerable,O7=(n,e,t)=>e in n?f4e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,WH=(n,e)=>{for(var t in e||(e={}))p4e.call(e,t)&&O7(n,t,e[t]);if(FH)for(var t of FH(e))g4e.call(e,t)&&O7(n,t,e[t]);return n},Gi=(n,e,t)=>O7(n,typeof e!="symbol"?e+"":e,t);let m4e=class Fte extends wpe{constructor(e){var t;super(e),Gi(this,"protocol",Cte),Gi(this,"version",Tte),Gi(this,"name",A7),Gi(this,"relayUrl"),Gi(this,"projectId"),Gi(this,"customStoragePrefix"),Gi(this,"events",new Qu.EventEmitter),Gi(this,"logger"),Gi(this,"heartbeat"),Gi(this,"relayer"),Gi(this,"crypto"),Gi(this,"storage"),Gi(this,"history"),Gi(this,"expirer"),Gi(this,"pairing"),Gi(this,"verify"),Gi(this,"echoClient"),Gi(this,"linkModeSupportedApps"),Gi(this,"eventClient"),Gi(this,"initialized",!1),Gi(this,"logChunkController"),Gi(this,"on",(a,c)=>this.events.on(a,c)),Gi(this,"once",(a,c)=>this.events.once(a,c)),Gi(this,"off",(a,c)=>this.events.off(a,c)),Gi(this,"removeListener",(a,c)=>this.events.removeListener(a,c)),Gi(this,"dispatchEnvelope",({topic:a,message:c,sessionExists:u})=>{if(!a||!c)return;const d={topic:a,message:c,publishedAt:Date.now(),transportType:is.link_mode};this.relayer.onLinkMessageEvent(d,{sessionExists:u})});const r=this.getGlobalCore(e==null?void 0:e.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(a){console.warn("Failed to copy global core",a)}this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Nte,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=qx({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:BAe.logger,name:A7}),{logger:s,chunkLoggerController:o}=c$({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=o,(t=this.logChunkController)!=null&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,c;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((c=this.logChunkController)==null||c.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=Qa(s,this.name),this.heartbeat=new mfe,this.crypto=new W_e(this,this.logger,e==null?void 0:e.keychain),this.history=new JCe(this,this.logger),this.expirer=new n4e(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new Xfe(WH(WH({},LAe),e==null?void 0:e.storageOptions)),this.relayer=new mCe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new ZCe(this,this.logger),this.verify=new s4e(this,this.logger,this.storage),this.echoClient=new c4e(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new h4e(this,this.logger,e==null?void 0:e.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const t=new Fte(e);await t.initialize();const r=await t.crypto.getClientId();return await t.storage.setItem(ZAe,r),t}get context(){return bl(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(EH,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(EH)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;const t=`_walletConnectCore_${e}`,r=`${t}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[t]}catch(t){console.warn("Failed to get global WalletConnect core",t);return}}setGlobalCore(e){var t;try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${((t=e.opts)==null?void 0:t.customStoragePrefix)||""}`;globalThis[r]=e}catch(r){console.warn("Failed to set global WalletConnect core",r)}}isGlobalCoreDisabled(){try{return typeof Ji<"u"&&DAe.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}};const w4e=m4e,Wte="wc",Hte=2,Vte="client",D$=`${Wte}@${Hte}:${Vte}:`,pO={name:Vte,logger:"error"},HH="WALLETCONNECT_DEEPLINK_CHOICE",y4e="proposal",VH="Proposal expired",b4e="session",Gv=Ht.SEVEN_DAYS,v4e="engine",No={wc_sessionPropose:{req:{ttl:Ht.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Ht.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Ht.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Ht.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Ht.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Ht.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Ht.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Ht.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Ht.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Ht.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Ht.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Ht.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Ht.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Ht.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Ht.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Ht.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Ht.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Ht.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Ht.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Ht.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Ht.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Ht.FIVE_MINUTES,prompt:!1,tag:1119}}},gO={min:Ht.FIVE_MINUTES,max:Ht.SEVEN_DAYS},nf={idle:"IDLE",active:"ACTIVE"},x4e={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},E4e="request",A4e=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],S4e="wc",_4e="auth",C4e="authKeys",T4e="pairingTopics",I4e="requests",Q8=`${S4e}@${1.5}:${_4e}:`,m6=`${Q8}:PUB_KEY`;var N4e=Object.defineProperty,R4e=Object.defineProperties,M4e=Object.getOwnPropertyDescriptors,qH=Object.getOwnPropertySymbols,k4e=Object.prototype.hasOwnProperty,O4e=Object.prototype.propertyIsEnumerable,P7=(n,e,t)=>e in n?N4e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ns=(n,e)=>{for(var t in e||(e={}))k4e.call(e,t)&&P7(n,t,e[t]);if(qH)for(var t of qH(e))O4e.call(e,t)&&P7(n,t,e[t]);return n},Xc=(n,e)=>R4e(n,M4e(e)),Rt=(n,e,t)=>P7(n,typeof e!="symbol"?e+"":e,t);let P4e=class extends Ppe{constructor(e){super(e),Rt(this,"name",v4e),Rt(this,"events",new o$),Rt(this,"initialized",!1),Rt(this,"requestQueue",{state:nf.idle,queue:[]}),Rt(this,"sessionRequestQueue",{state:nf.idle,queue:[]}),Rt(this,"emittedSessionRequests",new K2e({limit:500})),Rt(this,"requestQueueDelay",Ht.ONE_SECOND),Rt(this,"expectedPairingMethodMap",new Map),Rt(this,"recentlyDeletedMap",new Map),Rt(this,"recentlyDeletedLimit",200),Rt(this,"relayMessageCache",[]),Rt(this,"pendingSessions",new Map),Rt(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(No)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Ht.toMiliseconds(this.requestQueueDelay)))}),Rt(this,"connect",async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const r=Xc(ns({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(r),r.optionalNamespaces=Y3e(r.requiredNamespaces,r.optionalNamespaces),r.requiredNamespaces={};const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,scopedProperties:c,relays:u}=r;let d=i,f,m=!1;try{if(d){const U=this.client.core.pairing.pairings.get(d);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),m=U.active}}catch(U){throw this.client.logger.error(`connect() -> pairing.get(${d}) failed`),U}if(!d||!m){const{topic:U,uri:K}=await this.client.core.pairing.create();d=U,f=K}if(!d){const{message:U}=zt("NO_MATCHING_KEY",`connect() pairing topic: ${d}`);throw new Error(U)}const w=await this.client.core.crypto.generateKeyPair(),y=No.wc_sessionPropose.req.ttl||Ht.FIVE_MINUTES,b=wo(y),E=Xc(ns(ns({requiredNamespaces:s,optionalNamespaces:o,relays:u??[{protocol:Ite}],proposer:{publicKey:w,metadata:this.client.metadata},expiryTimestamp:b,pairingTopic:d},a&&{sessionProperties:a}),c&&{scopedProperties:c}),{id:ff()}),T=yi("session_connect",E.id),{reject:N,resolve:I,done:H}=fy(y,VH),L=({id:U})=>{U===E.id&&(this.client.events.off("proposal_expire",L),this.pendingSessions.delete(E.id),this.events.emit(T,{error:{message:VH,code:0}}))};return this.client.events.on("proposal_expire",L),this.events.once(T,({error:U,session:K})=>{this.client.events.off("proposal_expire",L),U?N(U):K&&I(K)}),await this.sendRequest({topic:d,method:"wc_sessionPropose",params:E,throwOnFailedPublish:!0,clientRpcId:E.id}),await this.setProposal(E.id,E),{uri:f,approval:H}}),Rt(this,"pair",async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(t)}catch(r){throw this.client.logger.error("pair() failed"),r}}),Rt(this,"approve",async t=>{var r,i,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(r=t==null?void 0:t.id)==null?void 0:r.toString(),trace:[Pd.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(k){throw o.setError(ny.no_internet_connection),k}try{await this.isValidProposalId(t==null?void 0:t.id)}catch(k){throw this.client.logger.error(`approve() -> proposal.get(${t==null?void 0:t.id}) failed`),o.setError(ny.proposal_not_found),k}try{await this.isValidApprove(t)}catch(k){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(ny.session_approve_namespace_validation_failure),k}const{id:a,relayProtocol:c,namespaces:u,sessionProperties:d,scopedProperties:f,sessionConfig:m}=t,w=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:y,proposer:b,requiredNamespaces:E,optionalNamespaces:T}=w;let N=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:y});N||(N=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Pd.session_approve_started,properties:{topic:y,trace:[Pd.session_approve_started,Pd.session_namespaces_validation_success]}}));const I=await this.client.core.crypto.generateKeyPair(),H=b.publicKey,L=await this.client.core.crypto.generateSharedKey(I,H),U=ns(ns(ns({relay:{protocol:c??"irn"},namespaces:u,controller:{publicKey:I,metadata:this.client.metadata},expiry:wo(Gv)},d&&{sessionProperties:d}),f&&{scopedProperties:f}),m&&{sessionConfig:m}),K=is.relay;N.addTrace(Pd.subscribing_session_topic);try{await this.client.core.relayer.subscribe(L,{transportType:K})}catch(k){throw N.setError(ny.subscribe_session_topic_failure),k}N.addTrace(Pd.subscribe_session_topic_success);const Y=Xc(ns({},U),{topic:L,requiredNamespaces:E,optionalNamespaces:T,pairingTopic:y,acknowledged:!1,self:U.controller,peer:{publicKey:b.publicKey,metadata:b.metadata},controller:I,transportType:is.relay});await this.client.session.set(L,Y),N.addTrace(Pd.store_session);try{N.addTrace(Pd.publishing_session_settle),await this.sendRequest({topic:L,method:"wc_sessionSettle",params:U,throwOnFailedPublish:!0}).catch(k=>{throw N==null||N.setError(ny.session_settle_publish_failure),k}),N.addTrace(Pd.session_settle_publish_success),N.addTrace(Pd.publishing_session_approve),await this.sendResult({id:a,topic:y,result:{relay:{protocol:c??"irn"},responderPublicKey:I},throwOnFailedPublish:!0}).catch(k=>{throw N==null||N.setError(ny.session_approve_publish_failure),k}),N.addTrace(Pd.session_approve_publish_success)}catch(k){throw this.client.logger.error(k),this.client.session.delete(L,hs("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(L),k}return this.client.core.eventClient.deleteEvent({eventId:N.eventId}),await this.client.core.pairing.updateMetadata({topic:y,metadata:b.metadata}),await this.deleteProposal(a),await this.client.core.pairing.activate({topic:y}),await this.setExpiry(L,wo(Gv)),{topic:L,acknowledged:()=>Promise.resolve(this.client.session.get(L))}}),Rt(this,"reject",async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(t)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:r,reason:i}=t;let s;try{s=this.client.proposal.get(r).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),o}s&&await this.sendError({id:r,topic:s,error:i,rpcOpts:No.wc_sessionPropose.reject}),await this.deleteProposal(r)}),Rt(this,"update",async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(t)}catch(f){throw this.client.logger.error("update() -> isValidUpdate() failed"),f}const{topic:r,namespaces:i}=t,{done:s,resolve:o,reject:a}=fy(),c=ff(),u=_y().toString(),d=this.client.session.get(r).namespaces;return this.events.once(yi("session_update",c),({error:f})=>{f?a(f):o()}),await this.client.session.update(r,{namespaces:i}),await this.sendRequest({topic:r,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:u}).catch(f=>{this.client.logger.error(f),this.client.session.update(r,{namespaces:d}),a(f)}),{acknowledged:s}}),Rt(this,"extend",async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(t)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:r}=t,i=ff(),{done:s,resolve:o,reject:a}=fy();return this.events.once(yi("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(r,wo(Gv)),this.sendRequest({topic:r,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}}),Rt(this,"request",async t=>{this.isInitialized();try{await this.isValidRequest(t)}catch(E){throw this.client.logger.error("request() -> isValidRequest() failed"),E}const{chainId:r,request:i,topic:s,expiry:o=No.wc_sessionRequest.req.ttl}=t,a=this.client.session.get(s);(a==null?void 0:a.transportType)===is.relay&&await this.confirmOnlineStateOrThrow();const c=ff(),u=_y().toString(),{done:d,resolve:f,reject:m}=fy(o,"Request expired. Please try again.");this.events.once(yi("session_request",c),({error:E,result:T})=>{E?m(E):f(T)});const w="wc_sessionRequest",y=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(y)return await this.sendRequest({clientRpcId:c,relayRpcId:u,topic:s,method:w,params:{request:Xc(ns({},i),{expiryTimestamp:wo(o)}),chainId:r},expiry:o,throwOnFailedPublish:!0,appLink:y}).catch(E=>m(E)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:r,id:c}),await d();const b={request:Xc(ns({},i),{expiryTimestamp:wo(o)}),chainId:r};return await Promise.all([new Promise(async E=>{await this.sendRequest({clientRpcId:c,relayRpcId:u,topic:s,method:w,params:b,expiry:o,throwOnFailedPublish:!0,tvf:this.getTVFParams(c,b)}).catch(T=>m(T)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:r,id:c}),E()}),new Promise(async E=>{var T;if(!((T=a.sessionConfig)!=null&&T.disableDeepLink)){const N=await F2e(this.client.core.storage,HH);await U2e({id:c,topic:s,wcDeepLink:N})}E()}),d()]).then(E=>E[2])}),Rt(this,"respond",async t=>{this.isInitialized(),await this.isValidRespond(t);const{topic:r,response:i}=t,{id:s}=i,o=this.client.session.get(r);o.transportType===is.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);pf(i)?await this.sendResult({id:s,topic:r,result:i.result,throwOnFailedPublish:!0,appLink:a}):$u(i)&&await this.sendError({id:s,topic:r,error:i.error,appLink:a}),this.cleanupAfterResponse(t)}),Rt(this,"ping",async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(t)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:r}=t;if(this.client.session.keys.includes(r)){const i=ff(),s=_y().toString(),{done:o,resolve:a,reject:c}=fy();this.events.once(yi("session_ping",i),({error:u})=>{u?c(u):a()}),await Promise.all([this.sendRequest({topic:r,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),o()])}else this.client.core.pairing.pairings.keys.includes(r)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:r}))}),Rt(this,"emit",async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(t);const{topic:r,event:i,chainId:s}=t,o=_y().toString(),a=ff();await this.sendRequest({topic:r,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:a})}),Rt(this,"disconnect",async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(t);const{topic:r}=t;if(this.client.session.keys.includes(r))await this.sendRequest({topic:r,method:"wc_sessionDelete",params:hs("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:r,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(r))await this.client.core.pairing.disconnect({topic:r});else{const{message:i}=zt("MISMATCHED_TOPIC",`Session or pairing topic not found: ${r}`);throw new Error(i)}}),Rt(this,"find",t=>(this.isInitialized(),this.client.session.getAll().filter(r=>Q3e(r,t)))),Rt(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),Rt(this,"authenticate",async(t,r)=>{var i;this.isInitialized(),this.isValidAuthenticate(t);const s=r&&this.client.core.linkModeSupportedApps.includes(r)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=s?is.link_mode:is.relay;o===is.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:u,domain:d,nonce:f,type:m,exp:w,nbf:y,methods:b=[],expiry:E}=t,T=[...t.resources||[]],{topic:N,uri:I}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:N,uri:I}});const H=await this.client.core.crypto.generateKeyPair(),L=p6(H);if(await Promise.all([this.client.auth.authKeys.set(m6,{responseTopic:L,publicKey:H}),this.client.auth.pairingTopics.set(L,{topic:L,pairingTopic:N})]),await this.client.core.relayer.subscribe(L,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${N}`),b.length>0){const{namespace:F}=H2(a[0]);let z=iEe(F,"request",b);f6(T)&&(z=oEe(z,T.pop())),T.push(z)}const U=E&&E>No.wc_sessionAuthenticate.req.ttl?E:No.wc_sessionAuthenticate.req.ttl,K={authPayload:{type:m??"caip122",chains:a,statement:c,aud:u,domain:d,version:"1",nonce:f,iat:new Date().toISOString(),exp:w,nbf:y,resources:T},requester:{publicKey:H,metadata:this.client.metadata},expiryTimestamp:wo(U)},Y={eip155:{chains:a,methods:[...new Set(["personal_sign",...b])],events:["chainChanged","accountsChanged"]}},k={requiredNamespaces:{},optionalNamespaces:Y,relays:[{protocol:"irn"}],pairingTopic:N,proposer:{publicKey:H,metadata:this.client.metadata},expiryTimestamp:wo(No.wc_sessionPropose.req.ttl),id:ff()},{done:j,resolve:V,reject:W}=fy(U,"Request expired"),$=ff(),A=yi("session_connect",k.id),_=yi("session_request",$),R=async({error:F,session:z})=>{this.events.off(_,P),F?W(F):z&&V({session:z})},P=async F=>{var z,B,C;if(await this.deletePendingAuthRequest($,{message:"fulfilled",code:0}),F.error){const xe=hs("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return F.error.code===xe.code?void 0:(this.events.off(A,R),W(F.error.message))}await this.deleteProposal(k.id),this.events.off(A,R);const{cacaos:M,responder:Z}=F.result,J=[],ae=[];for(const xe of M){await FW({cacao:xe,projectId:this.client.core.projectId})||(this.client.logger.error(xe,"Signature verification failed"),W(hs("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:Se}=xe,Re=f6(Se.resources),et=[h7(Se.iss)],Me=oN(Se.iss);if(Re){const Fe=WW(Re),ht=HW(Re);J.push(...Fe),et.push(...ht)}for(const Fe of et)ae.push(`${Fe}:${Me}`)}const we=await this.client.core.crypto.generateSharedKey(H,Z.publicKey);let he;J.length>0&&(he={topic:we,acknowledged:!0,self:{publicKey:H,metadata:this.client.metadata},peer:Z,controller:Z.publicKey,expiry:wo(Gv),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:N,namespaces:pH([...new Set(J)],[...new Set(ae)]),transportType:o},await this.client.core.relayer.subscribe(we,{transportType:o}),await this.client.session.set(we,he),N&&await this.client.core.pairing.updateMetadata({topic:N,metadata:Z.metadata}),he=this.client.session.get(we)),(z=this.client.metadata.redirect)!=null&&z.linkMode&&(B=Z.metadata.redirect)!=null&&B.linkMode&&(C=Z.metadata.redirect)!=null&&C.universal&&r&&(this.client.core.addLinkModeSupportedApp(Z.metadata.redirect.universal),this.client.session.update(we,{transportType:is.link_mode})),V({auths:M,session:he})};this.events.once(A,R),this.events.once(_,P);let q;try{if(s){const F=Jm("wc_sessionAuthenticate",K,$);this.client.core.history.set(N,F);const z=await this.client.core.crypto.encode("",F,{type:WC,encoding:Gm});q=mI(r,N,z)}else await Promise.all([this.sendRequest({topic:N,method:"wc_sessionAuthenticate",params:K,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:$}),this.sendRequest({topic:N,method:"wc_sessionPropose",params:k,expiry:No.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:k.id})])}catch(F){throw this.events.off(A,R),this.events.off(_,P),F}return await this.setProposal(k.id,k),await this.setAuthRequest($,{request:Xc(ns({},K),{verifyContext:{}}),pairingTopic:N,transportType:o}),{uri:q??I,response:j}}),Rt(this,"approveSessionAuthenticate",async t=>{const{id:r,auths:i}=t,s=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[ry.authenticated_session_approve_started]}});try{this.isInitialized()}catch(E){throw s.setError(SA.no_internet_connection),E}const o=this.getPendingAuthRequest(r);if(!o)throw s.setError(SA.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${r}`);const a=o.transportType||is.relay;a===is.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),d=p6(c),f={type:ig,receiverPublicKey:c,senderPublicKey:u},m=[],w=[];for(const E of i){if(!await FW({cacao:E,projectId:this.client.core.projectId})){s.setError(SA.invalid_cacao);const L=hs("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:r,topic:d,error:L,encodeOpts:f}),new Error(L.message)}s.addTrace(ry.cacaos_verified);const{p:T}=E,N=f6(T.resources),I=[h7(T.iss)],H=oN(T.iss);if(N){const L=WW(N),U=HW(N);m.push(...L),I.push(...U)}for(const L of I)w.push(`${L}:${H}`)}const y=await this.client.core.crypto.generateSharedKey(u,c);s.addTrace(ry.create_authenticated_session_topic);let b;if((m==null?void 0:m.length)>0){b={topic:y,acknowledged:!0,self:{publicKey:u,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:wo(Gv),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:pH([...new Set(m)],[...new Set(w)]),transportType:a},s.addTrace(ry.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(y,{transportType:a})}catch(E){throw s.setError(SA.subscribe_authenticated_session_topic_failure),E}s.addTrace(ry.subscribe_authenticated_session_topic_success),await this.client.session.set(y,b),s.addTrace(ry.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(ry.publishing_authenticated_session_approve);try{await this.sendResult({topic:d,id:r,result:{cacaos:i,responder:{publicKey:u,metadata:this.client.metadata}},encodeOpts:f,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(E){throw s.setError(SA.authenticated_session_approve_publish_failure),E}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:b}}),Rt(this,"rejectSessionAuthenticate",async t=>{this.isInitialized();const{id:r,reason:i}=t,s=this.getPendingAuthRequest(r);if(!s)throw new Error(`Could not find pending auth request with id ${r}`);s.transportType===is.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=p6(o),u={type:ig,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:r,topic:c,error:i,encodeOpts:u,rpcOpts:No.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(r,{message:"rejected",code:0}),await this.deleteProposal(r)}),Rt(this,"formatAuthMessage",t=>{this.isInitialized();const{request:r,iss:i}=t;return Yee(r,i)}),Rt(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const t=this.relayMessageCache.shift();t&&await this.onRelayMessage(t)}catch(t){this.client.logger.error(t)}},50)}),Rt(this,"cleanupDuplicatePairings",async t=>{if(t.pairingTopic)try{const r=this.client.core.pairing.pairings.get(t.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var o,a;return((o=s.peerMetadata)==null?void 0:o.url)&&((a=s.peerMetadata)==null?void 0:a.url)===t.peer.metadata.url&&s.topic&&s.topic!==r.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(r){this.client.logger.error(r)}}),Rt(this,"deleteSession",async t=>{var r;const{topic:i,expirerHasDeleted:s=!1,emitEvent:o=!0,id:a=0}=t,{self:c}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,hs("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(HH).catch(u=>this.client.logger.warn(u)),this.getPendingSessionRequests().forEach(u=>{u.topic===i&&this.deletePendingSessionRequest(u.id,hs("USER_DISCONNECTED"))}),i===((r=this.sessionRequestQueue.queue[0])==null?void 0:r.topic)&&(this.sessionRequestQueue.state=nf.idle),o&&this.client.events.emit("session_delete",{id:a,topic:i})}),Rt(this,"deleteProposal",async(t,r)=>{if(r)try{const i=this.client.proposal.get(t),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(ny.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(t,hs("USER_DISCONNECTED")),r?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")}),Rt(this,"deletePendingSessionRequest",async(t,r,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,r),i?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==t),i&&(this.sessionRequestQueue.state=nf.idle,this.client.events.emit("session_request_expire",{id:t}))}),Rt(this,"deletePendingAuthRequest",async(t,r,i=!1)=>{await Promise.all([this.client.auth.requests.delete(t,r),i?Promise.resolve():this.client.core.expirer.del(t)])}),Rt(this,"setExpiry",async(t,r)=>{this.client.session.keys.includes(t)&&(this.client.core.expirer.set(t,r),await this.client.session.update(t,{expiry:r}))}),Rt(this,"setProposal",async(t,r)=>{this.client.core.expirer.set(t,wo(No.wc_sessionPropose.req.ttl)),await this.client.proposal.set(t,r)}),Rt(this,"setAuthRequest",async(t,r)=>{const{request:i,pairingTopic:s,transportType:o=is.relay}=r;this.client.core.expirer.set(t,i.expiryTimestamp),await this.client.auth.requests.set(t,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:t,pairingTopic:s,verifyContext:i.verifyContext,transportType:o})}),Rt(this,"setPendingSessionRequest",async t=>{const{id:r,topic:i,params:s,verifyContext:o}=t,a=s.request.expiryTimestamp||wo(No.wc_sessionRequest.req.ttl);this.client.core.expirer.set(r,a),await this.client.pendingRequest.set(r,{id:r,topic:i,params:s,verifyContext:o})}),Rt(this,"sendRequest",async t=>{const{topic:r,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:u,appLink:d,tvf:f}=t,m=Jm(i,s,c);let w;const y=!!d;try{const T=y?Gm:qd;w=await this.client.core.crypto.encode(r,m,{encoding:T})}catch(T){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${r} failed`),T}let b;if(A4e.includes(i)){const T=yf(JSON.stringify(m)),N=yf(w);b=await this.client.core.verify.register({id:N,decryptedId:T})}const E=No[i].req;if(E.attestation=b,o&&(E.ttl=o),a&&(E.id=a),this.client.core.history.set(r,m),y){const T=mI(d,r,w);await globalThis.Linking.openURL(T,this.client.name)}else{const T=No[i].req;o&&(T.ttl=o),a&&(T.id=a),T.tvf=Xc(ns({},f),{correlationId:m.id}),u?(T.internal=Xc(ns({},T.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,w,T)):this.client.core.relayer.publish(r,w,T).catch(N=>this.client.logger.error(N))}return m.id}),Rt(this,"sendResult",async t=>{const{id:r,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=t,u=L8(r,s);let d;const f=c&&typeof(globalThis==null?void 0:globalThis.Linking)<"u";try{const y=f?Gm:qd;d=await this.client.core.crypto.encode(i,u,Xc(ns({},a||{}),{encoding:y}))}catch(y){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),y}let m,w;try{m=await this.client.core.history.get(i,r);const y=m.request;try{w=this.getTVFParams(r,y.params,s)}catch(b){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${b==null?void 0:b.message}`)}}catch(y){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${r}) failed`),y}if(f){const y=mI(c,i,d);await globalThis.Linking.openURL(y,this.client.name)}else{const y=m.request.method,b=No[y].res;b.tvf=Xc(ns({},w),{correlationId:r}),o?(b.internal=Xc(ns({},b.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,d,b)):this.client.core.relayer.publish(i,d,b).catch(E=>this.client.logger.error(E))}await this.client.core.history.resolve(u)}),Rt(this,"sendError",async t=>{const{id:r,topic:i,error:s,encodeOpts:o,rpcOpts:a,appLink:c}=t,u=$8(r,s);let d;const f=c&&typeof(globalThis==null?void 0:globalThis.Linking)<"u";try{const w=f?Gm:qd;d=await this.client.core.crypto.encode(i,u,Xc(ns({},o||{}),{encoding:w}))}catch(w){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),w}let m;try{m=await this.client.core.history.get(i,r)}catch(w){throw this.client.logger.error(`sendError() -> history.get(${i}, ${r}) failed`),w}if(f){const w=mI(c,i,d);await globalThis.Linking.openURL(w,this.client.name)}else{const w=m.request.method,y=a||No[w].res;this.client.core.relayer.publish(i,d,y)}await this.client.core.history.resolve(u)}),Rt(this,"cleanup",async()=>{const t=[],r=[];this.client.session.getAll().forEach(i=>{let s=!1;Hm(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&t.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{Hm(i.expiryTimestamp)&&r.push(i.id)}),await Promise.all([...t.map(i=>this.deleteSession({topic:i})),...r.map(i=>this.deleteProposal(i))])}),Rt(this,"onProviderMessageEvent",async t=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(t):await this.onRelayMessage(t)}),Rt(this,"onRelayEventRequest",async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()}),Rt(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===nf.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=nf.active;const t=this.requestQueue.queue.shift();if(t)try{await this.processRequest(t)}catch(r){this.client.logger.warn(r)}}this.requestQueue.state=nf.idle}),Rt(this,"processRequest",async t=>{const{topic:r,payload:i,attestation:s,transportType:o,encryptedId:a}=t,c=i.method;if(!this.shouldIgnorePairingRequest({topic:r,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:r,payload:i,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(r,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(r,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(r,i);case"wc_sessionPing":return await this.onSessionPingRequest(r,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(r,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:r,payload:i,attestation:s,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(r,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:r,payload:i,attestation:s,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${c}`)}}),Rt(this,"onRelayEventResponse",async t=>{const{topic:r,payload:i,transportType:s}=t,o=(await this.client.core.history.get(r,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(r,i,s);case"wc_sessionSettle":return this.onSessionSettleResponse(r,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(r,i);case"wc_sessionExtend":return this.onSessionExtendResponse(r,i);case"wc_sessionPing":return this.onSessionPingResponse(r,i);case"wc_sessionRequest":return this.onSessionRequestResponse(r,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(r,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}}),Rt(this,"onRelayEventUnknownPayload",t=>{const{topic:r}=t,{message:i}=zt("MISSING_OR_INVALID",`Decoded payload on topic ${r} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)}),Rt(this,"shouldIgnorePairingRequest",t=>{const{topic:r,requestMethod:i}=t,s=this.expectedPairingMethodMap.get(r);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),Rt(this,"onSessionProposeRequest",async t=>{const{topic:r,payload:i,attestation:s,encryptedId:o}=t,{params:a,id:c}=i;try{const u=this.client.core.eventClient.getEvent({topic:r});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),u==null||u.setError(zp.proposal_listener_not_found)),this.isValidConnect(ns({},i.params));const d=a.expiryTimestamp||wo(No.wc_sessionPropose.req.ttl),f=ns({id:c,pairingTopic:r,expiryTimestamp:d,attestation:s,encryptedId:o},a);await this.setProposal(c,f);const m=await this.getVerifyContext({attestationId:s,hash:yf(JSON.stringify(i)),encryptedId:o,metadata:f.proposer.metadata});u==null||u.addTrace(uf.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:f,verifyContext:m})}catch(u){await this.sendError({id:c,topic:r,error:u,rpcOpts:No.wc_sessionPropose.autoReject}),this.client.logger.error(u)}}),Rt(this,"onSessionProposeResponse",async(t,r,i)=>{const{id:s}=r;if(pf(r)){const{result:o}=r;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const u=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:u});const d=await this.client.core.crypto.generateSharedKey(c,u);this.pendingSessions.set(s,{sessionTopic:d,pairingTopic:t,proposalId:s,publicKey:c});const f=await this.client.core.relayer.subscribe(d,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:t})}else if($u(r)){await this.deleteProposal(s);const o=yi("session_connect",s);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(o,{error:r.error})}}),Rt(this,"onSessionSettleRequest",async(t,r)=>{const{id:i,params:s}=r;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:u,sessionProperties:d,scopedProperties:f,sessionConfig:m}=r.params,w=[...this.pendingSessions.values()].find(E=>E.sessionTopic===t);if(!w)return this.client.logger.error(`Pending session not found for topic ${t}`);const y=this.client.proposal.get(w.proposalId),b=Xc(ns(ns(ns({topic:t,relay:o,expiry:c,namespaces:u,acknowledged:!0,pairingTopic:w.pairingTopic,requiredNamespaces:y.requiredNamespaces,optionalNamespaces:y.optionalNamespaces,controller:a.publicKey,self:{publicKey:w.publicKey,metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},d&&{sessionProperties:d}),f&&{scopedProperties:f}),m&&{sessionConfig:m}),{transportType:is.relay});await this.client.session.set(b.topic,b),await this.setExpiry(b.topic,b.expiry),await this.client.core.pairing.updateMetadata({topic:w.pairingTopic,metadata:b.peer.metadata}),this.client.events.emit("session_connect",{session:b}),this.events.emit(yi("session_connect",w.proposalId),{session:b}),this.pendingSessions.delete(w.proposalId),this.deleteProposal(w.proposalId,!1),this.cleanupDuplicatePairings(b),await this.sendResult({id:r.id,topic:t,result:!0})}catch(o){await this.sendError({id:i,topic:t,error:o}),this.client.logger.error(o)}}),Rt(this,"onSessionSettleResponse",async(t,r)=>{const{id:i}=r;pf(r)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(yi("session_approve",i),{})):$u(r)&&(await this.client.session.delete(t,hs("USER_DISCONNECTED")),this.events.emit(yi("session_approve",i),{error:r.error}))}),Rt(this,"onSessionUpdateRequest",async(t,r)=>{const{params:i,id:s}=r;try{const o=`${t}_session_update`,a=EA.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:t,error:hs("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(ns({topic:t},i));try{EA.set(o,s),await this.client.session.update(t,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:t,result:!0})}catch(c){throw EA.delete(o),c}this.client.events.emit("session_update",{id:s,topic:t,params:i})}catch(o){await this.sendError({id:s,topic:t,error:o}),this.client.logger.error(o)}}),Rt(this,"isRequestOutOfSync",(t,r)=>r.toString().slice(0,-3)<t.toString().slice(0,-3)),Rt(this,"onSessionUpdateResponse",(t,r)=>{const{id:i}=r,s=yi("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);pf(r)?this.events.emit(yi("session_update",i),{}):$u(r)&&this.events.emit(yi("session_update",i),{error:r.error})}),Rt(this,"onSessionExtendRequest",async(t,r)=>{const{id:i}=r;try{this.isValidExtend({topic:t}),await this.setExpiry(t,wo(Gv)),await this.sendResult({id:i,topic:t,result:!0}),this.client.events.emit("session_extend",{id:i,topic:t})}catch(s){await this.sendError({id:i,topic:t,error:s}),this.client.logger.error(s)}}),Rt(this,"onSessionExtendResponse",(t,r)=>{const{id:i}=r,s=yi("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);pf(r)?this.events.emit(yi("session_extend",i),{}):$u(r)&&this.events.emit(yi("session_extend",i),{error:r.error})}),Rt(this,"onSessionPingRequest",async(t,r)=>{const{id:i}=r;try{this.isValidPing({topic:t}),await this.sendResult({id:i,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:t})}catch(s){await this.sendError({id:i,topic:t,error:s}),this.client.logger.error(s)}}),Rt(this,"onSessionPingResponse",(t,r)=>{const{id:i}=r,s=yi("session_ping",i);setTimeout(()=>{if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners 2176`);pf(r)?this.events.emit(yi("session_ping",i),{}):$u(r)&&this.events.emit(yi("session_ping",i),{error:r.error})},500)}),Rt(this,"onSessionDeleteRequest",async(t,r)=>{const{id:i}=r;try{this.isValidDisconnect({topic:t,reason:r.params}),Promise.all([new Promise(s=>{this.client.core.relayer.once(Po.publish,async()=>{s(await this.deleteSession({topic:t,id:i}))})}),this.sendResult({id:i,topic:t,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:hs("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}}),Rt(this,"onSessionRequest",async t=>{var r,i,s;const{topic:o,payload:a,attestation:c,encryptedId:u,transportType:d}=t,{id:f,params:m}=a;try{await this.isValidRequest(ns({topic:o},m));const w=this.client.session.get(o),y=await this.getVerifyContext({attestationId:c,hash:yf(JSON.stringify(Jm("wc_sessionRequest",m,f))),encryptedId:u,metadata:w.peer.metadata,transportType:d}),b={id:f,topic:o,params:m,verifyContext:y};await this.setPendingSessionRequest(b),d===is.link_mode&&(r=w.peer.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp((i=w.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(b):(this.addSessionRequestToSessionRequestQueue(b),this.processSessionRequestQueue())}catch(w){await this.sendError({id:f,topic:o,error:w}),this.client.logger.error(w)}}),Rt(this,"onSessionRequestResponse",(t,r)=>{const{id:i}=r,s=yi("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);pf(r)?this.events.emit(yi("session_request",i),{result:r.result}):$u(r)&&this.events.emit(yi("session_request",i),{error:r.error})}),Rt(this,"onSessionEventRequest",async(t,r)=>{const{id:i,params:s}=r;try{const o=`${t}_session_event_${s.event.name}`,a=EA.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(ns({topic:t},s)),this.client.events.emit("session_event",{id:i,topic:t,params:s}),EA.set(o,i)}catch(o){await this.sendError({id:i,topic:t,error:o}),this.client.logger.error(o)}}),Rt(this,"onSessionAuthenticateResponse",(t,r)=>{const{id:i}=r;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:r}),pf(r)?this.events.emit(yi("session_request",i),{result:r.result}):$u(r)&&this.events.emit(yi("session_request",i),{error:r.error})}),Rt(this,"onSessionAuthenticateRequest",async t=>{var r;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:c}=t;try{const{requester:u,authPayload:d,expiryTimestamp:f}=s.params,m=await this.getVerifyContext({attestationId:o,hash:yf(JSON.stringify(s)),encryptedId:a,metadata:u.metadata,transportType:c}),w={requester:u,pairingTopic:i,id:s.id,authPayload:d,verifyContext:m,expiryTimestamp:f};await this.setAuthRequest(s.id,{request:w,pairingTopic:i,transportType:c}),c===is.link_mode&&(r=u.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp(u.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:s.params,id:s.id,verifyContext:m})}catch(u){this.client.logger.error(u);const d=s.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),m=this.getAppLinkIfEnabled(s.params.requester.metadata,c),w={type:ig,receiverPublicKey:d,senderPublicKey:f};await this.sendError({id:s.id,topic:i,error:u,encodeOpts:w,rpcOpts:No.wc_sessionAuthenticate.autoReject,appLink:m})}}),Rt(this,"addSessionRequestToSessionRequestQueue",t=>{this.sessionRequestQueue.queue.push(t)}),Rt(this,"cleanupAfterResponse",t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=nf.idle,this.processSessionRequestQueue()},Ht.toMiliseconds(this.requestQueueDelay))}),Rt(this,"cleanupPendingSentRequestsForTopic",({topic:t,error:r})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(s=>s.topic===t&&s.request.method==="wc_sessionRequest").forEach(s=>{const o=s.request.id,a=yi("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(yi("session_request",s.request.id),{error:r})})}),Rt(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===nf.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.emitSessionRequest(t)}catch(r){this.client.logger.error(r)}}),Rt(this,"emitSessionRequest",t=>{if(this.emittedSessionRequests.has(t.id)){this.client.logger.warn({id:t.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${t.id}`);return}this.sessionRequestQueue.state=nf.active,this.emittedSessionRequests.add(t.id),this.client.events.emit("session_request",t)}),Rt(this,"onPairingCreated",t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const r=this.client.proposal.getAll().find(i=>i.pairingTopic===t.topic);r&&this.onSessionProposeRequest({topic:t.topic,payload:Jm("wc_sessionPropose",Xc(ns({},r),{requiredNamespaces:r.requiredNamespaces,optionalNamespaces:r.optionalNamespaces,relays:r.relays,proposer:r.proposer,sessionProperties:r.sessionProperties,scopedProperties:r.scopedProperties}),r.id),attestation:r.attestation,encryptedId:r.encryptedId})}),Rt(this,"isValidConnect",async t=>{if(!tl(t)){const{message:u}=zt("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(u)}const{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,scopedProperties:a,relays:c}=t;if(sa(r)||await this.isValidPairingTopic(r),!lAe(c)){const{message:u}=zt("MISSING_OR_INVALID",`connect() relays: ${c}`);throw new Error(u)}if(!sa(i)&&Nf(i)!==0){const u="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(u):this.client.logger.warn(u),this.validateNamespaces(i,"requiredNamespaces")}if(!sa(s)&&Nf(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),sa(o)||this.validateSessionProps(o,"sessionProperties"),!sa(a)){this.validateSessionProps(a,"scopedProperties");const u=Object.keys(i||{}).concat(Object.keys(s||{}));if(!Object.keys(a).every(d=>u.includes(d.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(u)}`)}}),Rt(this,"validateNamespaces",(t,r)=>{const i=cAe(t,"connect()",r);if(i)throw new Error(i.message)}),Rt(this,"isValidApprove",async t=>{if(!tl(t))throw new Error(zt("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:r,namespaces:i,relayProtocol:s,sessionProperties:o,scopedProperties:a}=t;this.checkRecentlyDeleted(r),await this.isValidProposalId(r);const c=this.client.proposal.get(r),u=cO(i,"approve()");if(u)throw new Error(u.message);const d=wH(c.requiredNamespaces,i,"approve()");if(d)throw new Error(d.message);if(!uo(s,!0)){const{message:f}=zt("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(f)}if(sa(o)||this.validateSessionProps(o,"sessionProperties"),!sa(a)){this.validateSessionProps(a,"scopedProperties");const f=new Set(Object.keys(i));if(!Object.keys(a).every(m=>f.has(m.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(f).join(", ")}`)}}),Rt(this,"isValidReject",async t=>{if(!tl(t)){const{message:s}=zt("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(s)}const{id:r,reason:i}=t;if(this.checkRecentlyDeleted(r),await this.isValidProposalId(r),!dAe(i)){const{message:s}=zt("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}}),Rt(this,"isValidSessionSettleRequest",t=>{if(!tl(t)){const{message:u}=zt("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(u)}const{relay:r,controller:i,namespaces:s,expiry:o}=t;if(!_te(r)){const{message:u}=zt("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(u)}const a=nAe(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=cO(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(Hm(o)){const{message:u}=zt("EXPIRED","onSessionSettleRequest()");throw new Error(u)}}),Rt(this,"isValidUpdate",async t=>{if(!tl(t)){const{message:c}=zt("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(c)}const{topic:r,namespaces:i}=t;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const s=this.client.session.get(r),o=cO(i,"update()");if(o)throw new Error(o.message);const a=wH(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)}),Rt(this,"isValidExtend",async t=>{if(!tl(t)){const{message:i}=zt("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(i)}const{topic:r}=t;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r)}),Rt(this,"isValidRequest",async t=>{if(!tl(t)){const{message:c}=zt("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(c)}const{topic:r,request:i,chainId:s,expiry:o}=t;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const{namespaces:a}=this.client.session.get(r);if(!mH(a,s)){const{message:c}=zt("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!hAe(i)){const{message:c}=zt("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!gAe(a,s,i.method)){const{message:c}=zt("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!bAe(o,gO)){const{message:c}=zt("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${gO.min} and ${gO.max}`);throw new Error(c)}}),Rt(this,"isValidRespond",async t=>{var r;if(!tl(t)){const{message:o}=zt("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(o)}const{topic:i,response:s}=t;try{await this.isValidSessionTopic(i)}catch(o){throw(r=t==null?void 0:t.response)!=null&&r.id&&this.cleanupAfterResponse(t),o}if(!fAe(s)){const{message:o}=zt("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}}),Rt(this,"isValidPing",async t=>{if(!tl(t)){const{message:i}=zt("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(i)}const{topic:r}=t;await this.isValidSessionOrPairingTopic(r)}),Rt(this,"isValidEmit",async t=>{if(!tl(t)){const{message:a}=zt("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(a)}const{topic:r,event:i,chainId:s}=t;await this.isValidSessionTopic(r);const{namespaces:o}=this.client.session.get(r);if(!mH(o,s)){const{message:a}=zt("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!pAe(i)){const{message:a}=zt("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!mAe(o,s,i.name)){const{message:a}=zt("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}}),Rt(this,"isValidDisconnect",async t=>{if(!tl(t)){const{message:i}=zt("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(i)}const{topic:r}=t;await this.isValidSessionOrPairingTopic(r)}),Rt(this,"isValidAuthenticate",t=>{const{chains:r,uri:i,domain:s,nonce:o}=t;if(!Array.isArray(r)||r.length===0)throw new Error("chains is required and must be a non-empty array");if(!uo(i,!1))throw new Error("uri is required parameter");if(!uo(s,!1))throw new Error("domain is required parameter");if(!uo(o,!1))throw new Error("nonce is required parameter");if([...new Set(r.map(c=>H2(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=H2(r[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),Rt(this,"getVerifyContext",async t=>{const{attestationId:r,hash:i,encryptedId:s,metadata:o,transportType:a}=t,c={verified:{verifyUrl:o.verifyUrl||xS,validation:"UNKNOWN",origin:o.url||""}};try{if(a===is.link_mode){const d=this.getAppLinkIfEnabled(o,a);return c.verified.validation=d&&new URL(d).origin===new URL(o.url).origin?"VALID":"INVALID",c}const u=await this.client.core.verify.resolve({attestationId:r,hash:i,encryptedId:s,verifyUrl:o.verifyUrl});u&&(c.verified.origin=u.origin,c.verified.isScam=u.isScam,c.verified.validation=u.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(u){this.client.logger.warn(u)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c}),Rt(this,"validateSessionProps",(t,r)=>{Object.values(t).forEach((i,s)=>{if(i==null){const{message:o}=zt("MISSING_OR_INVALID",`${r} must contain an existing value for each key. Received: ${i} for key ${Object.keys(t)[s]}`);throw new Error(o)}})}),Rt(this,"getPendingAuthRequest",t=>{const r=this.client.auth.requests.get(t);return typeof r=="object"?r:void 0}),Rt(this,"addToRecentlyDeleted",(t,r)=>{if(this.recentlyDeletedMap.set(t,r),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(o)}}}),Rt(this,"checkRecentlyDeleted",t=>{const r=this.recentlyDeletedMap.get(t);if(r){const{message:i}=zt("MISSING_OR_INVALID",`Record was recently deleted - ${r}: ${t}`);throw new Error(i)}}),Rt(this,"isLinkModeEnabled",(t,r)=>{var i,s,o,a,c,u,d,f,m;return!t||r!==is.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.universal)!==void 0&&((u=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:u.universal)!==""&&((d=t==null?void 0:t.redirect)==null?void 0:d.universal)!==void 0&&((f=t==null?void 0:t.redirect)==null?void 0:f.universal)!==""&&((m=t==null?void 0:t.redirect)==null?void 0:m.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(t.redirect.universal)&&typeof(globalThis==null?void 0:globalThis.Linking)<"u"}),Rt(this,"getAppLinkIfEnabled",(t,r)=>{var i;return this.isLinkModeEnabled(t,r)?(i=t==null?void 0:t.redirect)==null?void 0:i.universal:void 0}),Rt(this,"handleLinkModeMessage",({url:t})=>{if(!t||!t.includes("wc_ev")||!t.includes("topic"))return;const r=RW(t,"topic")||"",i=decodeURIComponent(RW(t,"wc_ev")||""),s=this.client.session.keys.includes(r);s&&this.client.session.update(r,{transportType:is.link_mode}),this.client.core.dispatchEnvelope({topic:r,message:i,sessionExists:s})}),Rt(this,"registerLinkModeListeners",async()=>{var t;if(x$()||I0()&&(t=this.client.metadata.redirect)!=null&&t.linkMode){const r=globalThis==null?void 0:globalThis.Linking;if(typeof r<"u"){r.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await r.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}),Rt(this,"getTVFParams",(t,r,i)=>{var s,o,a;if(!((s=r.request)!=null&&s.method))return{};const c={correlationId:t,rpcMethods:[r.request.method],chainId:r.chainId};try{const u=this.extractTxHashesFromResult(r.request,i);c.txHashes=u,c.contractAddresses=this.isValidContractData(r.request.params)?[(a=(o=r.request.params)==null?void 0:o[0])==null?void 0:a.to]:[]}catch(u){this.client.logger.warn("Error getting TVF params",u)}return c}),Rt(this,"isValidContractData",t=>{var r;if(!t)return!1;try{const i=(t==null?void 0:t.data)||((r=t==null?void 0:t[0])==null?void 0:r.data);if(!i.startsWith("0x"))return!1;const s=i.slice(2);return/^[0-9a-fA-F]*$/.test(s)?s.length%2===0:!1}catch{}return!1}),Rt(this,"extractTxHashesFromResult",(t,r)=>{var i;try{if(!r)return[];const s=t.method,o=x4e[s];if(s==="sui_signTransaction")return[Fxe(r.transactionBytes)];if(s==="near_signTransaction")return[$W(r)];if(s==="near_signTransactions")return r.map(c=>$W(c));if(s==="xrpl_signTransactionFor"||s==="xrpl_signTransaction")return[(i=r.tx_json)==null?void 0:i.hash];if(s==="polkadot_signTransaction")return[PAe({transaction:t.params.transactionPayload,signature:r.signature})];if(s==="algo_signTxn")return sg(r)?r.map(c=>UW(c)):[UW(r)];if(s==="cosmos_signDirect")return[Hxe(r)];if(typeof r=="string")return[r];const a=r[o.key];if(sg(a))return s==="solana_signAllTransactions"?a.map(c=>zxe(c)):a;if(typeof a=="string")return[a]}catch(s){this.client.logger.warn("Error extracting tx hashes from result",s)}return[]})}async processPendingMessageEvents(){try{const e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(const[r,i]of Object.entries(t))for(const s of i)try{await this.onProviderMessageEvent({topic:r,message:s,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${r}, message: ${s}`)}}catch(e){this.client.logger.warn("processPendingMessageEvents failed",e)}}isInitialized(){if(!this.initialized){const{message:e}=zt("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Po.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:t,message:r,attestation:i,transportType:s}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(m6)?this.client.auth.authKeys.get(m6):{publicKey:void 0};try{const a=await this.client.core.crypto.decode(t,r,{receiverPublicKey:o,encoding:s===is.link_mode?Gm:qd});v$(a)?(this.client.core.history.set(t,a),await this.onRelayEventRequest({topic:t,payload:a,attestation:i,transportType:s,encryptedId:yf(r)})):U8(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:t,payload:a,transportType:s}),this.client.core.history.delete(t,a.id)):await this.onRelayEventUnknownPayload({topic:t,payload:a,transportType:s}),await this.client.core.relayer.messages.ack(t,r)}catch(a){this.client.logger.error(a)}}registerExpirerEvents(){this.client.core.expirer.on(Pu.expired,async e=>{const{topic:t,id:r}=Oee(e.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,zt("EXPIRED"),!0);if(r&&this.client.auth.requests.keys.includes(r))return await this.deletePendingAuthRequest(r,zt("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))})}registerPairingEvents(){this.client.core.pairing.events.on(by.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(by.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!uo(e,!1)){const{message:t}=zt("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=zt("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Hm(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=zt("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!uo(e,!1)){const{message:t}=zt("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=zt("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(Hm(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=zt("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=zt("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(uo(e,!1)){const{message:t}=zt("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=zt("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!uAe(e)){const{message:t}=zt("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=zt("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(Hm(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=zt("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}},D4e=class extends V1{constructor(e,t){super(e,t,y4e,D$),this.core=e,this.logger=t}},B4e=class extends V1{constructor(e,t){super(e,t,b4e,D$),this.core=e,this.logger=t}},L4e=class extends V1{constructor(e,t){super(e,t,E4e,D$,r=>r.id),this.core=e,this.logger=t}},$4e=class extends V1{constructor(e,t){super(e,t,C4e,Q8,()=>m6),this.core=e,this.logger=t}},U4e=class extends V1{constructor(e,t){super(e,t,T4e,Q8),this.core=e,this.logger=t}},j4e=class extends V1{constructor(e,t){super(e,t,I4e,Q8,r=>r.id),this.core=e,this.logger=t}};var z4e=Object.defineProperty,F4e=(n,e,t)=>e in n?z4e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,mO=(n,e,t)=>F4e(n,typeof e!="symbol"?e+"":e,t);let W4e=class{constructor(e,t){this.core=e,this.logger=t,mO(this,"authKeys"),mO(this,"pairingTopics"),mO(this,"requests"),this.authKeys=new $4e(this.core,this.logger),this.pairingTopics=new U4e(this.core,this.logger),this.requests=new j4e(this.core,this.logger)}
91async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}};var H4e=Object.defineProperty,V4e=(n,e,t)=>e in n?H4e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Fr=(n,e,t)=>V4e(n,typeof e!="symbol"?e+"":e,t);let q4e=class qte extends Ope{constructor(e){super(e),Fr(this,"protocol",Wte),Fr(this,"version",Hte),Fr(this,"name",pO.name),Fr(this,"metadata"),Fr(this,"core"),Fr(this,"logger"),Fr(this,"events",new Qu.EventEmitter),Fr(this,"engine"),Fr(this,"session"),Fr(this,"proposal"),Fr(this,"pendingRequest"),Fr(this,"auth"),Fr(this,"signConfig"),Fr(this,"on",(r,i)=>this.events.on(r,i)),Fr(this,"once",(r,i)=>this.events.once(r,i)),Fr(this,"off",(r,i)=>this.events.off(r,i)),Fr(this,"removeListener",(r,i)=>this.events.removeListener(r,i)),Fr(this,"removeAllListeners",r=>this.events.removeAllListeners(r)),Fr(this,"connect",async r=>{try{return await this.engine.connect(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"pair",async r=>{try{return await this.engine.pair(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"approve",async r=>{try{return await this.engine.approve(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"reject",async r=>{try{return await this.engine.reject(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"update",async r=>{try{return await this.engine.update(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"extend",async r=>{try{return await this.engine.extend(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"request",async r=>{try{return await this.engine.request(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"respond",async r=>{try{return await this.engine.respond(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"ping",async r=>{try{return await this.engine.ping(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"emit",async r=>{try{return await this.engine.emit(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"disconnect",async r=>{try{return await this.engine.disconnect(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"find",r=>{try{return this.engine.find(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(r){throw this.logger.error(r.message),r}}),Fr(this,"authenticate",async(r,i)=>{try{return await this.engine.authenticate(r,i)}catch(s){throw this.logger.error(s.message),s}}),Fr(this,"formatAuthMessage",r=>{try{return this.engine.formatAuthMessage(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"approveSessionAuthenticate",async r=>{try{return await this.engine.approveSessionAuthenticate(r)}catch(i){throw this.logger.error(i.message),i}}),Fr(this,"rejectSessionAuthenticate",async r=>{try{return await this.engine.rejectSessionAuthenticate(r)}catch(i){throw this.logger.error(i.message),i}}),this.name=(e==null?void 0:e.name)||pO.name,this.metadata=O2e(e==null?void 0:e.metadata),this.signConfig=e==null?void 0:e.signConfig;const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:DC(qx({level:(e==null?void 0:e.logger)||pO.logger}));this.core=(e==null?void 0:e.core)||new w4e(e),this.logger=Qa(t,this.name),this.session=new B4e(this.core,this.logger),this.proposal=new D4e(this.core,this.logger),this.pendingRequest=new L4e(this.core,this.logger),this.engine=new P4e(this),this.auth=new W4e(this.core,this.logger)}static async init(e){const t=new qte(e);return await t.initialize(),t}get context(){return bl(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};const KH="error",K4e="wss://relay.walletconnect.org",Y4e="wc",G4e="universal_provider",yI=`${Y4e}@2:${G4e}:`,Kte="https://rpc.walletconnect.org/v1/",b2="generic",Z4e=`${Kte}bundler`,Ju={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};function B$(n){return n==null||typeof n!="object"&&typeof n!="function"}function Yte(n){return Object.getOwnPropertySymbols(n).filter(e=>Object.prototype.propertyIsEnumerable.call(n,e))}
vendor: 13,983 bytes, line 91
91function Gte(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const Q4e="[object RegExp]",Zte="[object String]",Qte="[object Number]",Xte="[object Boolean]",Jte="[object Arguments]",X4e="[object Symbol]",J4e="[object Date]",e5e="[object Map]",t5e="[object Set]",n5e="[object Array]",r5e="[object ArrayBuffer]",i5e="[object Object]",s5e="[object DataView]",o5e="[object Uint8Array]",a5e="[object Uint8ClampedArray]",c5e="[object Uint16Array]",l5e="[object Uint32Array]",u5e="[object Int8Array]",d5e="[object Int16Array]",h5e="[object Int32Array]",f5e="[object Float32Array]",p5e="[object Float64Array]";function L$(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function g5e(n,e){return _2(n,void 0,n,new Map,e)}function _2(n,e,t,r=new Map,i=void 0){const s=i==null?void 0:i(n,e,t,r);if(s!=null)return s;if(B$(n))return n;if(r.has(n))return r.get(n);if(Array.isArray(n)){const o=new Array(n.length);r.set(n,o);for(let a=0;a<n.length;a++)o[a]=_2(n[a],a,t,r,i);return Object.hasOwn(n,"index")&&(o.index=n.index),Object.hasOwn(n,"input")&&(o.input=n.input),o}if(n instanceof Date)return new Date(n.getTime());if(n instanceof RegExp){const o=new RegExp(n.source,n.flags);return o.lastIndex=n.lastIndex,o}if(n instanceof Map){const o=new Map;r.set(n,o);for(const[a,c]of n)o.set(a,_2(c,a,t,r,i));return o}if(n instanceof Set){const o=new Set;r.set(n,o);for(const a of n)o.add(_2(a,void 0,t,r,i));return o}if(typeof pn<"u"&&pn.isBuffer(n))return n.subarray();if(L$(n)){const o=new(Object.getPrototypeOf(n)).constructor(n.length);r.set(n,o);for(let a=0;a<n.length;a++)o[a]=_2(n[a],a,t,r,i);return o}if(n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer)return n.slice(0);if(n instanceof DataView){const o=new DataView(n.buffer.slice(0),n.byteOffset,n.byteLength);return r.set(n,o),vy(o,n,t,r,i),o}if(typeof File<"u"&&n instanceof File){const o=new File([n],n.name,{type:n.type});return r.set(n,o),vy(o,n,t,r,i),o}if(n instanceof Blob){const o=new Blob([n],{type:n.type});return r.set(n,o),vy(o,n,t,r,i),o}if(n instanceof Error){const o=new n.constructor;return r.set(n,o),o.message=n.message,o.name=n.name,o.stack=n.stack,o.cause=n.cause,vy(o,n,t,r,i),o}if(typeof n=="object"&&m5e(n)){const o=Object.create(Object.getPrototypeOf(n));return r.set(n,o),vy(o,n,t,r,i),o}return n}function vy(n,e,t=n,r,i){const s=[...Object.keys(e),...Yte(e)];for(let o=0;o<s.length;o++){const a=s[o],c=Object.getOwnPropertyDescriptor(n,a);(c==null||c.writable)&&(n[a]=_2(e[a],a,t,r,i))}}function m5e(n){switch(Gte(n)){case Jte:case n5e:case r5e:case s5e:case Xte:case J4e:case f5e:case p5e:case u5e:case d5e:case h5e:case e5e:case Qte:case i5e:case Q4e:case t5e:case Zte:case X4e:case o5e:case a5e:case c5e:case l5e:return!0;default:return!1}}function w5e(n,e){return g5e(n,(t,r,i,s)=>{if(typeof n=="object")switch(Object.prototype.toString.call(n)){case Qte:case Zte:case Xte:{const o=new n.constructor(n==null?void 0:n.valueOf());return vy(o,n),o}case Jte:{const o={};return vy(o,n),o.length=n.length,o[Symbol.iterator]=n[Symbol.iterator],o}default:return}})}function YH(n){return w5e(n)}function GH(n){return n!==null&&typeof n=="object"&&Gte(n)==="[object Arguments]"}function ZH(n){return typeof n=="object"&&n!==null}function y5e(){}function b5e(n){return L$(n)}function v5e(n){var t;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const r=n[Symbol.toStringTag];return r==null||!((t=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&t.writable)?!1:n.toString()===`[object ${r}]`}let e=n;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e}function x5e(n){if(B$(n))return n;if(Array.isArray(n)||L$(n)||n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer)return n.slice(0);const e=Object.getPrototypeOf(n),t=e.constructor;if(n instanceof Date||n instanceof Map||n instanceof Set)return new t(n);if(n instanceof RegExp){const r=new t(n);return r.lastIndex=n.lastIndex,r}if(n instanceof DataView)return new t(n.buffer.slice(0));if(n instanceof Error){const r=new t(n.message);return r.stack=n.stack,r.name=n.name,r.cause=n.cause,r}if(typeof File<"u"&&n instanceof File)return new t([n],n.name,{type:n.type,lastModified:n.lastModified});if(typeof n=="object"){const r=Object.create(e);return Object.assign(r,n)}return n}function E5e(n,...e){const t=e.slice(0,-1),r=e[e.length-1];let i=n;for(let s=0;s<t.length;s++){const o=t[s];i=D7(i,o,r,new Map)}return i}function D7(n,e,t,r){if(B$(n)&&(n=Object(n)),e==null||typeof e!="object")return n;if(r.has(e))return x5e(r.get(e));if(r.set(e,n),Array.isArray(e)){e=e.slice();for(let s=0;s<e.length;s++)e[s]=e[s]??void 0}const i=[...Object.keys(e),...Yte(e)];for(let s=0;s<i.length;s++){const o=i[s];let a=e[o],c=n[o];if(GH(a)&&(a={...a}),GH(c)&&(c={...c}),typeof pn<"u"&&pn.isBuffer(a)&&(a=YH(a)),Array.isArray(a))if(typeof c=="object"&&c!=null){const d=[],f=Reflect.ownKeys(c);for(let m=0;m<f.length;m++){const w=f[m];d[w]=c[w]}c=d}else c=[];const u=t(c,a,o,n,e,r);u!=null?n[o]=u:Array.isArray(a)||ZH(c)&&ZH(a)?n[o]=D7(c,a,t,r):c==null&&v5e(a)?n[o]=D7({},a,t,r):c==null&&b5e(a)?n[o]=YH(a):(c===void 0||a!==void 0)&&(n[o]=a)}return n}function A5e(n,...e){return E5e(n,...e,y5e)}var S5e=Object.defineProperty,_5e=Object.defineProperties,C5e=Object.getOwnPropertyDescriptors,QH=Object.getOwnPropertySymbols,T5e=Object.prototype.hasOwnProperty,I5e=Object.prototype.propertyIsEnumerable,XH=(n,e,t)=>e in n?S5e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,bI=(n,e)=>{for(var t in e||(e={}))T5e.call(e,t)&&XH(n,t,e[t]);if(QH)for(var t of QH(e))I5e.call(e,t)&&XH(n,t,e[t]);return n},N5e=(n,e)=>_5e(n,C5e(e));function ru(n,e,t){var r;const i=H2(n);return((r=e.rpcMap)==null?void 0:r[i.reference])||`${Kte}?chainId=${i.namespace}:${i.reference}&projectId=${t}`}function q1(n){return n.includes(":")?n.split(":")[1]:n}function ene(n){return n.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function R5e(n,e){const t=Object.keys(e.namespaces).filter(i=>i.includes(n));if(!t.length)return[];const r=[];return t.forEach(i=>{const s=e.namespaces[i].accounts;r.push(...s)}),r}function JH(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>{var r,i;return((r=t==null?void 0:t.chains)==null?void 0:r.length)&&((i=t==null?void 0:t.chains)==null?void 0:i.length)>0}))}function vI(n={},e={}){const t=JH(eV(n)),r=JH(eV(e));return A5e(t,r)}function eV(n){var e,t,r,i,s;const o={};if(!Nf(n))return o;for(const[a,c]of Object.entries(n)){const u=G8(a)?[a]:c.chains,d=c.methods||[],f=c.events||[],m=c.rpcMap||{},w=S2(a);o[w]=N5e(bI(bI({},o[w]),c),{chains:If(u,(e=o[w])==null?void 0:e.chains),methods:If(d,(t=o[w])==null?void 0:t.methods),events:If(f,(r=o[w])==null?void 0:r.events)}),(Nf(m)||Nf(((i=o[w])==null?void 0:i.rpcMap)||{}))&&(o[w].rpcMap=bI(bI({},m),(s=o[w])==null?void 0:s.rpcMap))}return o}function tV(n){return n.includes(":")?n.split(":")[2]:n}function nV(n){const e={};for(const[t,r]of Object.entries(n)){const i=r.methods||[],s=r.events||[],o=r.accounts||[],a=G8(t)?[t]:r.chains?r.chains:ene(r.accounts);e[t]={chains:a,methods:i,events:s,accounts:o}}return e}function wO(n){return typeof n=="number"?n:n.includes("0x")?parseInt(n,16):(n=n.includes(":")?n.split(":")[1]:n,isNaN(Number(n))?n:Number(n))}const tne={},ci=n=>tne[n],yO=(n,e)=>{tne[n]=e};var M5e=Object.defineProperty,rV=Object.getOwnPropertySymbols,k5e=Object.prototype.hasOwnProperty,O5e=Object.prototype.propertyIsEnumerable,iV=(n,e,t)=>e in n?M5e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,sV=(n,e)=>{for(var t in e||(e={}))k5e.call(e,t)&&iV(n,t,e[t]);if(rV)for(var t of rV(e))O5e.call(e,t)&&iV(n,t,e[t]);return n};const oV="eip155",P5e=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],D5e=n=>n&&n.startsWith("0x")?BigInt(n).toString(10):n,bO=n=>n&&n.startsWith("0x")?n:`0x${BigInt(n).toString(16)}`,aV=n=>Object.keys(n).filter(e=>P5e.includes(e)).reduce((e,t)=>(e[t]=n[t],e),{}),B5e=(n,e,t)=>{const{sessionProperties:r={},scopedProperties:i={}}=n,s={};if(!Nf(i)&&!Nf(r))return;const o=aV(r);for(const a of t){const c=D5e(a);if(!c)continue;s[bO(c)]=o;const u=i==null?void 0:i[`${oV}:${c}`];if(u){const d=u==null?void 0:u[`${oV}:${c}:${e}`];s[bO(c)]=sV(sV({},s[bO(c)]),aV(d||u))}}for(const[a,c]of Object.entries(s))Object.keys(c).length===0&&delete s[a];return Object.keys(s).length>0?s:void 0};var L5e=Object.defineProperty,$5e=(n,e,t)=>e in n?L5e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Zv=(n,e,t)=>$5e(n,typeof e!="symbol"?e+"":e,t);let U5e=class{constructor(e){Zv(this,"name","polkadot"),Zv(this,"client"),Zv(this,"httpProviders"),Zv(this,"events"),Zv(this,"namespace"),Zv(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var r;const i=q1(t);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||ru(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Xu(new dh(r,ci("disableProviderPing")))}};var j5e=Object.defineProperty,z5e=Object.defineProperties,F5e=Object.getOwnPropertyDescriptors,cV=Object.getOwnPropertySymbols,W5e=Object.prototype.hasOwnProperty,H5e=Object.prototype.propertyIsEnumerable,B7=(n,e,t)=>e in n?j5e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,lV=(n,e)=>{for(var t in e||(e={}))W5e.call(e,t)&&B7(n,t,e[t]);if(cV)for(var t of cV(e))H5e.call(e,t)&&B7(n,t,e[t]);return n},uV=(n,e)=>z5e(n,F5e(e)),Qv=(n,e,t)=>B7(n,typeof e!="symbol"?e+"":e,t);class V5e{constructor(e){Qv(this,"name","eip155"),Qv(this,"client"),Qv(this,"chainId"),Qv(this,"namespace"),Qv(this,"httpProviders"),Qv(this,"events"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const r=t||ru(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Xu(new dh(r,ci("disableProviderPing")))}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var r;const i=parseInt(q1(t));e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,r;let i=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(r=this.namespace.chains)==null?void 0:r[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,r,i,s,o;const a=(r=(t=e.request)==null?void 0:t.params)==null?void 0:r[0],c=((s=(i=e.request)==null?void 0:i.params)==null?void 0:s[1])||[];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");
91const u=this.client.session.get(e.topic),d=((o=u==null?void 0:u.sessionProperties)==null?void 0:o.capabilities)||{},f=`${a}${c.join(",")}`,m=d==null?void 0:d[f];if(m)return m;let w;try{w=B5e(u,a,c)}catch(b){console.warn("Failed to extract capabilities from session",b)}if(w)return w;const y=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:uV(lV({},u.sessionProperties||{}),{capabilities:uV(lV({},d||{}),{[f]:y})})})}catch(b){console.warn("Failed to update session with capabilities",b)}return y}async getCallStatus(e){var t,r;const i=this.client.session.get(e.topic),s=(t=i.sessionProperties)==null?void 0:t.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(r=i.sessionProperties)==null?void 0:r.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var r;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Jm("eth_getUserOperationReceipt",[(r=t.request.params)==null?void 0:r[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,t){return`${Z4e}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}var q5e=Object.defineProperty,K5e=(n,e,t)=>e in n?q5e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Xv=(n,e,t)=>K5e(n,typeof e!="symbol"?e+"":e,t);class Y5e{constructor(e){Xv(this,"name","solana"),Xv(this,"client"),Xv(this,"httpProviders"),Xv(this,"events"),Xv(this,"namespace"),Xv(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var r;const i=q1(t);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||ru(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Xu(new dh(r,ci("disableProviderPing")))}}var G5e=Object.defineProperty,Z5e=(n,e,t)=>e in n?G5e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Jv=(n,e,t)=>Z5e(n,typeof e!="symbol"?e+"":e,t);class Q5e{constructor(e){Jv(this,"name","cosmos"),Jv(this,"client"),Jv(this,"httpProviders"),Jv(this,"events"),Jv(this,"namespace"),Jv(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var r;const i=q1(t);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||ru(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Xu(new dh(r,ci("disableProviderPing")))}}var X5e=Object.defineProperty,J5e=(n,e,t)=>e in n?X5e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,e2=(n,e,t)=>J5e(n,typeof e!="symbol"?e+"":e,t);class eTe{constructor(e){e2(this,"name","algorand"),e2(this,"client"),e2(this,"httpProviders"),e2(this,"events"),e2(this,"namespace"),e2(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const r=t||ru(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.chainId=e,this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var r;e[t]=this.createHttpProvider(t,(r=this.namespace.rpcMap)==null?void 0:r[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||ru(e,this.namespace,this.client.core.projectId);return typeof r>"u"?void 0:new Xu(new dh(r,ci("disableProviderPing")))}}var tTe=Object.defineProperty,nTe=(n,e,t)=>e in n?tTe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,t2=(n,e,t)=>nTe(n,typeof e!="symbol"?e+"":e,t);class rTe{constructor(e){t2(this,"name","cip34"),t2(this,"client"),t2(this,"httpProviders"),t2(this,"events"),t2(this,"namespace"),t2(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const r=this.getCardanoRPCUrl(t),i=q1(t);e[i]=this.createHttpProvider(i,r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||this.getCardanoRPCUrl(e);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Xu(new dh(r,ci("disableProviderPing")))}}var iTe=Object.defineProperty,sTe=(n,e,t)=>e in n?iTe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,n2=(n,e,t)=>sTe(n,typeof e!="symbol"?e+"":e,t);class oTe{constructor(e){n2(this,"name","elrond"),n2(this,"client"),n2(this,"httpProviders"),n2(this,"events"),n2
91(this,"namespace"),n2(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var r;const i=q1(t);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||ru(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Xu(new dh(r,ci("disableProviderPing")))}}var aTe=Object.defineProperty,cTe=(n,e,t)=>e in n?aTe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,r2=(n,e,t)=>cTe(n,typeof e!="symbol"?e+"":e,t);let lTe=class{constructor(e){r2(this,"name","multiversx"),r2(this,"client"),r2(this,"httpProviders"),r2(this,"events"),r2(this,"namespace"),r2(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var r;const i=q1(t);e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||ru(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Xu(new dh(r,ci("disableProviderPing")))}};var uTe=Object.defineProperty,dTe=(n,e,t)=>e in n?uTe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,i2=(n,e,t)=>dTe(n,typeof e!="symbol"?e+"":e,t);let hTe=class{constructor(e){i2(this,"name","near"),i2(this,"client"),i2(this,"httpProviders"),i2(this,"events"),i2(this,"namespace"),i2(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const r=t||ru(`${this.name}:${e}`,this.namespace);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var r;e[t]=this.createHttpProvider(t,(r=this.namespace.rpcMap)==null?void 0:r[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||ru(e,this.namespace);return typeof r>"u"?void 0:new Xu(new dh(r,ci("disableProviderPing")))}};var fTe=Object.defineProperty,pTe=(n,e,t)=>e in n?fTe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,s2=(n,e,t)=>pTe(n,typeof e!="symbol"?e+"":e,t);let gTe=class{constructor(e){s2(this,"name","tezos"),s2(this,"client"),s2(this,"httpProviders"),s2
91(this,"events"),s2(this,"namespace"),s2(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const r=t||ru(`${this.name}:${e}`,this.namespace);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{e[t]=this.createHttpProvider(t)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||ru(e,this.namespace);return typeof r>"u"?void 0:new Xu(new dh(r))}};var mTe=Object.defineProperty,wTe=(n,e,t)=>e in n?mTe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,o2=(n,e,t)=>wTe(n,typeof e!="symbol"?e+"":e,t);let yTe=class{constructor(e){o2(this,"name",b2),o2(this,"client"),o2(this,"httpProviders"),o2(this,"events"),o2(this,"namespace"),o2(this,"chainId"),this.namespace=e.namespace,this.events=ci("events"),this.client=ci("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ju.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){var e,t;const r={};return(t=(e=this.namespace)==null?void 0:e.accounts)==null||t.forEach(i=>{const s=H2(i);r[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),r}getHttpProvider(e){const t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){const r=t||ru(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new Xu(new dh(r,ci("disableProviderPing")))}};var bTe=Object.defineProperty,vTe=Object.defineProperties,xTe=Object.getOwnPropertyDescriptors,dV=Object.getOwnPropertySymbols,ETe=Object.prototype.hasOwnProperty,ATe=Object.prototype.propertyIsEnumerable,L7=(n,e,t)=>e in n?bTe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,xI=(n,e)=>{for(var t in e||(e={}))ETe.call(e,t)&&L7(n,t,e[t]);if(dV)for(var t of dV(e))ATe.call(e,t)&&L7(n,t,e[t]);return n},vO=(n,e)=>vTe(n,xTe(e)),Cu=(n,e,t)=>L7(n,typeof e!="symbol"?e+"":e,t);let STe=class nne{constructor(e){Cu(this,"client"),Cu(this,"namespaces"),Cu(this,"optionalNamespaces"),Cu(this,"sessionProperties"),Cu(this,"scopedProperties"),Cu(this,"events",new o$),Cu(this,"rpcProviders",{}),Cu(this,"session"),Cu(this,"providerOpts"),Cu(this,"logger"),Cu(this,"uri"),Cu(this,"disableProviderPing",!1),this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:DC(qx({level:(e==null?void 0:e.logger)||KH})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new nne(e);return await t.initialize(),t}async request(e,t,r){const[i,s]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:xI({}
vendor: 6,312 bytes, line 91
91,e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:r})}sendAsync(e,t,r,i){const s=new Date().getTime();this.request(e,r,i).then(o=>t(null,L8(s,o))).catch(o=>t(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:hs("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:i}=await this.client.authenticate(e,t);r&&(this.uri=r,this.events.emit("display_uri",r));const s=await i();if(this.session=s.session,this.session){const o=nV(this.session.namespaces);this.namespaces=vI(this.namespaces,o),await this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){const{uri:t,approval:r}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties});t&&(this.uri=t,this.events.emit("display_uri",t));const i=await r();this.session=i;const s=nV(i.namespaces);return this.namespaces=vI(this.namespaces,s),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[r,i]=this.validateChain(e),s=this.getProvider(r);s.name===b2?s.setDefaultChain(`${r}:${i}`,t):s.setDefaultChain(i,t)}catch(r){if(!/Please call connect/.test(r.message))throw r}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(sg(t)){for(const r of t)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,t;if(this.client=this.providerOpts.client||await q4e.init({core:this.providerOpts.core,logger:this.providerOpts.logger||KH,relayUrl:this.providerOpts.relayUrl||K4e,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(r){throw this.logger.error("Failed to get session",r),new Error(`The provided session: ${(t=(e=this.providerOpts)==null?void 0:e.session)==null?void 0:t.topic} doesn't exist in the Sign client`)}else{const r=this.client.session.getAll();this.session=r[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>S2(t)))];yO("client",this.client),yO("events",this.events),yO("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const r=R5e(t,this.session);if((r==null?void 0:r.length)===0)return;const i=ene(r),s=vI(this.namespaces,this.optionalNamespaces),o=vO(xI({},s[t]),{accounts:r,chains:i});switch(t){case"eip155":this.rpcProviders[t]=new V5e({namespace:o});break;case"algorand":this.rpcProviders[t]=new eTe({namespace:o});break;case"solana":this.rpcProviders[t]=new Y5e({namespace:o});break;case"cosmos":this.rpcProviders[t]=new Q5e({namespace:o});break;case"polkadot":this.rpcProviders[t]=new U5e({namespace:o});break;case"cip34":this.rpcProviders[t]=new rTe({namespace:o});break;case"elrond":this.rpcProviders[t]=new oTe({namespace:o});break;case"multiversx":this.rpcProviders[t]=new lTe({namespace:o});break;case"near":this.rpcProviders[t]=new hTe({namespace:o});break;case"tezos":this.rpcProviders[t]=new gTe({namespace:o});break;default:this.rpcProviders[b2]?this.rpcProviders[b2].updateNamespace(o):this.rpcProviders[b2]=new yTe({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var t;const{topic:r}=e;r===((t=this.session)==null?void 0:t.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var t;const{params:r,topic:i}=e;if(i!==((t=this.session)==null?void 0:t.topic))return;const{event:s}=r;if(s.name==="accountsChanged"){const o=s.data;o&&sg(o)&&this.events.emit("accountsChanged",o.map(tV))}else if(s.name==="chainChanged"){const o=r.chainId,a=r.event.data,c=S2(o),u=wO(o)!==wO(a)?`${c}:${wO(a)}`:o;this.onChainChanged(u)}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var r,i;if(e!==((r=this.session)==null?void 0:r.topic))return;const{namespaces:s}=t,o=(i=this.client)==null?void 0:i.session.get(e);this.session=vO(xI({},o),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{var t;
91e.topic===((t=this.session)==null?void 0:t.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",vO(xI({},hs("USER_DISCONNECTED")),{data:e.topic})))}),this.on(Ju.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[b2]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t={},optionalNamespaces:r={},sessionProperties:i,scopedProperties:s}=e;this.optionalNamespaces=vI(t,r),this.sessionProperties=i,this.scopedProperties=s}validateChain(e){const[t,r]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,r];if(t&&!Object.keys(this.namespaces||{}).map(o=>S2(o)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&r)return[t,r];const i=S2(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged(e,t=!1){if(!this.namespaces)return;const[r,i]=this.validateChain(e);if(!i)return;this.updateNamespaceChain(r,i),this.events.emit("chainChanged",i);const s=this.getProvider(r).getDefaultChain();t||this.getProvider(r).setDefaultChain(i),this.emitAccountsChangedOnChainChange({namespace:r,previousChainId:s,newChainId:e}),await this.persist("namespaces",this.namespaces)}emitAccountsChangedOnChainChange({namespace:e,previousChainId:t,newChainId:r}){var i,s;try{if(t===r)return;const o=(s=(i=this.session)==null?void 0:i.namespaces[e])==null?void 0:s.accounts;if(!o)return;const a=o.filter(c=>c.includes(`${r}:`)).map(tV);if(!sg(a))return;this.events.emit("accountsChanged",a)}catch(o){this.logger.warn("Failed to emit accountsChanged on chain change",o)}}updateNamespaceChain(e,t){if(!this.namespaces)return;const r=this.namespaces[e]?e:`${e}:${t}`,i={chains:[],methods:[],events:[],defaultChain:t};this.namespaces[r]?this.namespaces[r]&&(this.namespaces[r].defaultChain=t):this.namespaces[r]=i}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,t){var r;const i=((r=this.session)==null?void 0:r.topic)||"";await this.client.core.storage.setItem(`${yI}/${e}${i}`,t)}async getFromStore(e){var t;const r=((t=this.session)==null?void 0:t.topic)||"";return await this.client.core.storage.getItem(`${yI}/${e}${r}`)}async deleteFromStore(e){var t;const r=((t=this.session)==null?void 0:t.topic)||"";await this.client.core.storage.removeItem(`${yI}/${e}${r}`)}async cleanupStorage(){var e;try{if(((e=this.client)==null?void 0:e.session.length)>0)return;const t=await this.client.core.storage.getKeys();for(const r of t)r.startsWith(yI)&&await this.client.core.storage.removeItem(r)}catch(t){this.logger.warn("Failed to cleanup storage",t)}}};var hV={};const Ry={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof Ji<"u"&&typeof hV<"u"?hV.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},DEFAULT_CONNECT_METHOD_ORDER:["email","social","wallet"],ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150}},Uf={filterOutDuplicatesByRDNS(n){const e=Ue.state.enableEIP6963?Ge.state.connectors:[],t=wt.getRecentWallets(),r=e.map(a=>{var c;return(c=a.info)==null?void 0:c.rdns}).filter(Boolean),i=t.map(a=>a.rdns).filter(Boolean),s=r.concat(i);if(s.includes("io.metamask.mobile")&&tt.isMobile()){const a=s.indexOf("io.metamask.mobile");s[a]="io.metamask"}return n.filter(a=>!(a!=null&&a.rdns&&s.includes(String(a.rdns))||!(a!=null&&a.rdns)&&e.some(u=>u.name===a.name)))},filterOutDuplicatesByIds(n){const e=Ge.state.connectors.filter(a=>a.type==="ANNOUNCED"||a.type==="INJECTED"),t=wt.getRecentWallets(),r=e.map(a=>a.explorerId),i=t.map(a=>a.id),s=r.concat(i);return n.filter(a=>!s.includes(a==null?void 0:a.id))},filterOutDuplicateWallets(n){const e=this.filterOutDuplicatesByRDNS(n);return this.filterOutDuplicatesByIds(e)},markWalletsAsInstalled(n){const{connectors:e}=Ge.state,{featuredWalletIds:t}=Ue.state,r=e.filter(o=>o.type==="ANNOUNCED").reduce((o,a)=>{var c;return(c=a.info)!=null&&c.rdns&&(o[a.info.rdns]=!0),o},{});return n.map(o=>({...o,installed:!!o.rdns&&!!r[o.rdns??""]}
91)).sort((o,a)=>{const c=Number(a.installed)-Number(o.installed);if(c!==0)return c;if(t!=null&&t.length){const u=t.indexOf(o.id),d=t.indexOf(a.id);if(u!==-1&&d!==-1)return u-d;if(u!==-1)return-1;if(d!==-1)return 1}return 0})},getConnectOrderMethod(n,e){var c;const t=(n==null?void 0:n.connectMethodsOrder)||((c=Ue.state.features)==null?void 0:c.connectMethodsOrder),r=e||Ge.state.connectors;if(t)return t;const{injected:i,announced:s}=Xd.getConnectorsByType(r,Ft.state.recommended,Ft.state.featured),o=i.filter(Xd.showConnector),a=s.filter(Xd.showConnector);return o.length||a.length?["wallet","email","social"]:Ry.DEFAULT_CONNECT_METHOD_ORDER},isExcluded(n){const e=!!n.rdns&&Ft.state.excludedWallets.some(r=>r.rdns===n.rdns),t=!!n.name&&Ft.state.excludedWallets.some(r=>xi.isLowerCaseMatch(r.name,n.name));return e||t},markWalletsWithDisplayIndex(n){return n.map((e,t)=>({...e,display_index:t}))}},Xd={getConnectorsByType(n,e,t){const{customWallets:r}=Ue.state,i=wt.getRecentWallets(),s=Uf.filterOutDuplicateWallets(e),o=Uf.filterOutDuplicateWallets(t),a=n.filter(f=>f.type==="MULTI_CHAIN"),c=n.filter(f=>f.type==="ANNOUNCED"),u=n.filter(f=>f.type==="INJECTED"),d=n.filter(f=>f.type==="EXTERNAL");return{custom:r,recent:i,external:d,multiChain:a,announced:c,injected:u,recommended:s,featured:o}},showConnector(n){var i;const e=(i=n.info)==null?void 0:i.rdns,t=!!e&&Ft.state.excludedWallets.some(s=>!!s.rdns&&s.rdns===e),r=!!n.name&&Ft.state.excludedWallets.some(s=>xi.isLowerCaseMatch(s.name,n.name));return!(n.type==="INJECTED"&&(n.name==="Browser Wallet"&&(!tt.isMobile()||tt.isMobile()&&!e&&!nt.checkInstalled())||t||r)||(n.type==="ANNOUNCED"||n.type==="EXTERNAL")&&(t||r))},getIsConnectedWithWC(){return Array.from(ue.state.chains.values()).some(t=>Ge.getConnectorId(t.namespace)===Be.CONNECTOR_ID.WALLET_CONNECT)},getConnectorTypeOrder({recommended:n,featured:e,custom:t,recent:r,announced:i,injected:s,multiChain:o,external:a,overriddenConnectors:c=(u=>(u=Ue.state.features)==null?void 0:u.connectorTypeOrder)()??[]}){const m=[{type:"walletConnect",isEnabled:Ue.state.enableWalletConnect},{type:"recent",isEnabled:r.length>0},{type:"injected",isEnabled:[...s,...i,...o].length>0},{type:"featured",isEnabled:e.length>0},{type:"custom",isEnabled:t&&t.length>0},{type:"external",isEnabled:a.length>0},{type:"recommended",isEnabled:n.length>0}].filter(E=>E.isEnabled),w=new Set(m.map(E=>E.type)),y=c.filter(E=>w.has(E)).map(E=>({type:E,isEnabled:!0})),b=m.filter(({type:E})=>!y.some(({type:N})=>N===E));return Array.from(new Set([...y,...b].map(({type:E})=>E)))},getAuthName({email:n,socialUsername:e,socialProvider:t}){return e?t&&t==="discord"&&e.endsWith("0")?e.slice(0,-1):e:n.length>30?`${n.slice(0,-3)}...`:n},async fetchProviderData(n){var e,t;try{if(n.name==="Browser Wallet"&&!tt.isMobile())return{accounts:[],chainId:void 0};if(n.id===Be.CONNECTOR_ID.AUTH)return{accounts:[],chainId:void 0};const[r,i]=await Promise.all([(e=n.provider)==null?void 0:e.request({method:"eth_accounts"}),(t=n.provider)==null?void 0:t.request({method:"eth_chainId"}).then(s=>Number(s))]);return{accounts:r,chainId:i}}catch(r){return console.warn(`Failed to fetch provider data for ${n.name}`,r),{accounts:[],chainId:void 0}}}},dN={interpolate(n,e,t){if(n.length!==2||e.length!==2)throw new Error("inputRange and outputRange must be an array of length 2");const r=n[0]||0,i=n[1]||0,s=e[0]||0,o=e[1]||0;return t<r?s:t>i?o:(o-s)/(i-r)*(t-r)+s}};/** 92 * @license 93 * Copyright 2019 Google LLC 94 * SPDX-License-Identifier: BSD-3-Clause 95 */const w6=globalThis,$$=w6.ShadowRoot&&(w6.ShadyCSS===void 0||w6.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,U$=Symbol(),fV=new WeakMap;let rne=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==U$)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if($$&&e===void 0){const r=t!==void 0&&t.length===1;r&&(e=fV.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&fV.set(t,e))}return e}toString(){return this.cssText}};const Ou=n=>new rne(typeof n=="string"?n:n+"",void 0,U$),Mt=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((r,i,s)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[s+1],n[0]);return new rne(t,n,U$)},_Te=(n,e)=>{if($$)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const r=document.createElement("style"),i=w6.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,n.appendChild(r)}},pV=$$?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return Ou(t)})(n):n;/** 96 * @license 97 * Copyright 2017 Google LLC 98 * SPDX-License-Identifier: BSD-3-Clause 99 */const{is:CTe,defineProperty:TTe,getOwnPropertyDescriptor:ITe,getOwnPropertyNames:NTe,getOwnPropertySymbols:RTe,getPrototypeOf:MTe}=Object,s0=globalThis,gV=s0.trustedTypes,kTe=gV?gV.emptyScript:"",xO=s0.reactiveElementPolyfillSupport,AS=(n,e)=>n,hN={toAttribute(n,e){switch(e){case Boolean:n=n?kTe:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},j$=(n,e)=>!CTe(n,e),mV={attribute:!0,type:String,converter:hN,reflect:!1,useDefault:!1,hasChanged:j$};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),s0.litPropertyMetadata??(s0.litPropertyMetadata=new WeakMap);let v2=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}
vendor: 6,323 bytes, lines 99-105
99static createProperty(e,t=mV){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&TTe(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){const{get:i,set:s}=ITe(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:i,set(o){const a=i==null?void 0:i.call(this);s==null||s.call(this,o),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??mV}static _$Ei(){if(this.hasOwnProperty(AS("elementProperties")))return;const e=MTe(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(AS("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(AS("properties"))){const t=this.properties,r=[...NTe(t),...RTe(t)];for(const i of r)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[t,r]of this.elementProperties){const i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const i of r)t.unshift(pV(i))}else e!==void 0&&t.push(pV(e));return t}static _$Eu(e,t){const r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _Te(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var s;const r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){const o=(((s=r.converter)==null?void 0:s.toAttribute)!==void 0?r.converter:hN).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){var s,o;const r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const a=r.getPropertyOptions(i),c=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)==null?void 0:s.fromAttribute)!==void 0?a.converter:hN;this._$Em=i;const u=c.fromAttribute(t,a.type);this[i]=u??((o=this._$Ej)==null?void 0:o.get(i))??u,this._$Em=null}}requestUpdate(e,t,r){var i;if(e!==void 0){const s=this.constructor,o=this[e];if(r??(r=s.getPropertyOptions(e)),!((r.hasChanged??j$)(o,t)||r.useDefault&&r.reflect&&o===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(s._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:s},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,o]of i){const{wrapped:a}=o,c=this[s];a!==!0||this._$AL.has(s)||c===void 0||this.C(s,void 0,o,c)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(r=this._$EO)==null||r.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};v2.elementStyles=[],v2.shadowRootOptions={mode:"open"},v2[AS("elementProperties")]=new Map,v2[AS("finalized")]=new Map,xO==null||xO({ReactiveElement:v2}),(s0.reactiveElementVersions??(s0.reactiveElementVersions=[])).push("2.1.1");/** 100 * @license 101 * Copyright 2017 Google LLC 102 * SPDX-License-Identifier: BSD-3-Clause 103 */const SS=globalThis,fN=SS.trustedTypes,wV=fN?fN.createPolicy("lit-html",{createHTML:n=>n}):void 0,ine="$lit$",Zm=`lit$${Math.random().toFixed(9).slice(2)}$`,sne="?"+Zm,OTe=`<${sne}>`,p1=document,B_=()=>p1.createComment(""),L_=n=>n===null||typeof n!="object"&&typeof n!="function",z$=Array.isArray,PTe=n=>z$(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",EO=`[ 104\f\r]`,TA=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,yV=/-->/g,bV=/>/g,iy=RegExp(`>|${EO}(?:([^\\s"'>=/]+)(${EO}*=${EO}*(?:[^ 105\f\r"'\`<>=]|("|')|))|$)`,"g"),vV=/'/g,xV=/"/g,one=/^(?:script|style|textarea|title)$/i,ane=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}
vendor: 3,304 bytes, line 105
105),le=ane(1),Wi=ane(2),dg=Symbol.for("lit-noChange"),Gs=Symbol.for("lit-nothing"),EV=new WeakMap,My=p1.createTreeWalker(p1,129);function cne(n,e){if(!z$(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return wV!==void 0?wV.createHTML(e):e}const DTe=(n,e)=>{const t=n.length-1,r=[];let i,s=e===2?"<svg>":e===3?"<math>":"",o=TA;for(let a=0;a<t;a++){const c=n[a];let u,d,f=-1,m=0;for(;m<c.length&&(o.lastIndex=m,d=o.exec(c),d!==null);)m=o.lastIndex,o===TA?d[1]==="!--"?o=yV:d[1]!==void 0?o=bV:d[2]!==void 0?(one.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=iy):d[3]!==void 0&&(o=iy):o===iy?d[0]===">"?(o=i??TA,f=-1):d[1]===void 0?f=-2:(f=o.lastIndex-d[2].length,u=d[1],o=d[3]===void 0?iy:d[3]==='"'?xV:vV):o===xV||o===vV?o=iy:o===yV||o===bV?o=TA:(o=iy,i=void 0);const w=o===iy&&n[a+1].startsWith("/>")?" ":"";s+=o===TA?c+OTe:f>=0?(r.push(u),c.slice(0,f)+ine+c.slice(f)+Zm+w):c+Zm+(f===-2?a:w)}return[cne(n,s+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};let $7=class lne{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[u,d]=DTe(e,t);if(this.el=lne.createElement(u,r),My.currentNode=this.el.content,t===2||t===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=My.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const f of i.getAttributeNames())if(f.endsWith(ine)){const m=d[o++],w=i.getAttribute(f).split(Zm),y=/([.?@])?(.*)/.exec(m);c.push({type:1,index:s,name:y[2],strings:w,ctor:y[1]==="."?LTe:y[1]==="?"?$Te:y[1]==="@"?UTe:X8}),i.removeAttribute(f)}else f.startsWith(Zm)&&(c.push({type:6,index:s}),i.removeAttribute(f));if(one.test(i.tagName)){const f=i.textContent.split(Zm),m=f.length-1;if(m>0){i.textContent=fN?fN.emptyScript:"";for(let w=0;w<m;w++)i.append(f[w],B_()),My.nextNode(),c.push({type:2,index:++s});i.append(f[m],B_())}}}else if(i.nodeType===8)if(i.data===sne)c.push({type:2,index:s});else{let f=-1;for(;(f=i.data.indexOf(Zm,f+1))!==-1;)c.push({type:7,index:s}),f+=Zm.length-1}s++}}static createElement(e,t){const r=p1.createElement("template");return r.innerHTML=e,r}};function mx(n,e,t=n,r){var o,a;if(e===dg)return e;let i=r!==void 0?(o=t._$Co)==null?void 0:o[r]:t._$Cl;const s=L_(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),s===void 0?i=void 0:(i=new s(n),i._$AT(n,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=i:t._$Cl=i),i!==void 0&&(e=mx(n,i._$AS(n,e.values),i,r)),e}let BTe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,i=((e==null?void 0:e.creationScope)??p1).importNode(t,!0);My.currentNode=i;let s=My.nextNode(),o=0,a=0,c=r[0];for(;c!==void 0;){if(o===c.index){let u;c.type===2?u=new F$(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new jTe(s,this,e)),this._$AV.push(u),c=r[++a]}o!==(c==null?void 0:c.index)&&(s=My.nextNode(),o++)}return My.currentNode=p1,i}p(e){let t=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},F$=class une{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}
vendor: 2,712 bytes, line 105
105constructor(e,t,r,i){this.type=2,this._$AH=Gs,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=mx(this,e,t),L_(e)?e===Gs||e==null||e===""?(this._$AH!==Gs&&this._$AR(),this._$AH=Gs):e!==this._$AH&&e!==dg&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):PTe(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Gs&&L_(this._$AH)?this._$AA.nextSibling.data=e:this.T(p1.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=$7.createElement(cne(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(t);else{const o=new BTe(i,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=EV.get(e.strings);return t===void 0&&EV.set(e.strings,t=new $7(e)),t}k(e){z$(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,i=0;for(const s of e)i===t.length?t.push(r=new une(this.O(B_()),this.O(B_()),this,this.options)):r=t[i],r._$AI(s),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},X8=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,s){this.type=1,this._$AH=Gs,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Gs}_$AI(e,t=this,r,i){const s=this.strings;let o=!1;if(s===void 0)e=mx(this,e,t,0),o=!L_(e)||e!==this._$AH&&e!==dg,o&&(this._$AH=e);else{const a=e;let c,u;for(e=s[0],c=0;c<s.length-1;c++)u=mx(this,a[r+c],t,c),u===dg&&(u=this._$AH[c]),o||(o=!L_(u)||u!==this._$AH[c]),u===Gs?e=Gs:e!==Gs&&(e+=(u??"")+s[c+1]),this._$AH[c]=u}o&&!i&&this.j(e)}j(e){e===Gs?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},LTe=class extends X8{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Gs?void 0:e}},$Te=class extends X8{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Gs)}},UTe=class extends X8{constructor(e,t,r,i,s){super(e,t,r,i,s),this.type=5}
105_$AI(e,t=this){if((e=mx(this,e,t,0)??Gs)===dg)return;const r=this._$AH,i=e===Gs&&r!==Gs||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==Gs&&(r===Gs||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}};class jTe{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){mx(this,e)}}const AO=SS.litHtmlPolyfillSupport;AO==null||AO($7,F$),(SS.litHtmlVersions??(SS.litHtmlVersions=[])).push("3.3.1");const zTe=(n,e,t)=>{const r=(t==null?void 0:t.renderBefore)??e;let i=r._$litPart$;if(i===void 0){const s=(t==null?void 0:t.renderBefore)??null;r._$litPart$=i=new F$(e.insertBefore(B_(),s),s,void 0,t??{})}return i._$AI(n),i};/** 106 * @license 107 * Copyright 2017 Google LLC 108 * SPDX-License-Identifier: BSD-3-Clause 109 */const Qy=globalThis;let ut=class extends v2{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=zTe(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return dg}};var gX;ut._$litElement$=!0,ut.finalized=!0,(gX=Qy.litElementHydrateSupport)==null||gX.call(Qy,{LitElement:ut});const SO=Qy.litElementPolyfillSupport;SO==null||SO({LitElement:ut});(Qy.litElementVersions??(Qy.litElementVersions=[])).push("4.2.1");let _S,o0,a0;function Net(n,e){_S=document.createElement("style"),o0=document.createElement("style"),a0=document.createElement("style"),_S.textContent=V2(n).core.cssText,o0.textContent=V2(n).dark.cssText,a0.textContent=V2(n).light.cssText,document.head.appendChild(_S),document.head.appendChild(o0),document.head.appendChild(a0),dne(e)}function dne(n){o0&&a0&&(n==="light"?(o0.removeAttribute("media"),a0.media="enabled"):(a0.removeAttribute("media"),o0.media="enabled"))}function FTe(n){_S&&o0&&a0&&(_S.textContent=V2(n).core.cssText,o0.textContent=V2(n).dark.cssText,a0.textContent=V2(n).light.cssText)}function V2(n){return{core:Mt` 110 @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); 111 @keyframes w3m-shake { 112 0% { 113 transform: scale(1) rotate(0deg); 114 } 115 20% { 116 transform: scale(1) rotate(-1deg); 117 } 118 40% { 119 transform: scale(1) rotate(1.5deg); 120 } 121 60% { 122 transform: scale(1) rotate(-1.5deg); 123 } 124 80% { 125 transform: scale(1) rotate(1deg); 126 } 127 100% { 128 transform: scale(1) rotate(0deg); 129 } 130 } 131 @keyframes w3m-iframe-fade-out { 132 0% { 133 opacity: 1; 134 } 135 100% { 136 opacity: 0; 137 } 138 } 139 @keyframes w3m-iframe-zoom-in { 140 0% { 141 transform: translateY(50px); 142 opacity: 0; 143 } 144 100% { 145 transform: translateY(0px); 146 opacity: 1; 147 } 148 } 149 @keyframes w3m-iframe-zoom-in-mobile { 150 0% { 151 transform: scale(0.95); 152 opacity: 0; 153 } 154 100% { 155 transform: scale(1); 156 opacity: 1; 157 } 158 } 159 :root { 160 --w3m-modal-width: 360px; 161 --w3m-color-mix-strength: ${Ou(n!=null&&n["--w3m-color-mix-strength"]?`${n["--w3m-color-mix-strength"]}%`:"0%")}; 162 --w3m-font-family: ${Ou((n==null?void 0:n["--w3m-font-family"])||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")}; 163 --w3m-font-size-master: ${Ou((n==null?void 0:n["--w3m-font-size-master"])||"10px")}; 164 --w3m-border-radius-master: ${Ou((n==null?void 0:n["--w3m-border-radius-master"])||"4px")}; 165 --w3m-z-index: ${Ou((n==null?void 0:n["--w3m-z-index"])||
vendor: 15,824 bytes, lines 165-591
165999)}; 166 167 --wui-font-family: var(--w3m-font-family); 168 169 --wui-font-size-mini: calc(var(--w3m-font-size-master) * 0.8); 170 --wui-font-size-micro: var(--w3m-font-size-master); 171 --wui-font-size-tiny: calc(var(--w3m-font-size-master) * 1.2); 172 --wui-font-size-small: calc(var(--w3m-font-size-master) * 1.4); 173 --wui-font-size-paragraph: calc(var(--w3m-font-size-master) * 1.6); 174 --wui-font-size-medium: calc(var(--w3m-font-size-master) * 1.8); 175 --wui-font-size-large: calc(var(--w3m-font-size-master) * 2); 176 --wui-font-size-title-6: calc(var(--w3m-font-size-master) * 2.2); 177 --wui-font-size-medium-title: calc(var(--w3m-font-size-master) * 2.4); 178 --wui-font-size-2xl: calc(var(--w3m-font-size-master) * 4); 179 180 --wui-border-radius-5xs: var(--w3m-border-radius-master); 181 --wui-border-radius-4xs: calc(var(--w3m-border-radius-master) * 1.5); 182 --wui-border-radius-3xs: calc(var(--w3m-border-radius-master) * 2); 183 --wui-border-radius-xxs: calc(var(--w3m-border-radius-master) * 3); 184 --wui-border-radius-xs: calc(var(--w3m-border-radius-master) * 4); 185 --wui-border-radius-s: calc(var(--w3m-border-radius-master) * 5); 186 --wui-border-radius-m: calc(var(--w3m-border-radius-master) * 7); 187 --wui-border-radius-l: calc(var(--w3m-border-radius-master) * 9); 188 --wui-border-radius-3xl: calc(var(--w3m-border-radius-master) * 20); 189 190 --wui-font-weight-light: 400; 191 --wui-font-weight-regular: 500; 192 --wui-font-weight-medium: 600; 193 --wui-font-weight-bold: 700; 194 195 --wui-letter-spacing-2xl: -1.6px; 196 --wui-letter-spacing-medium-title: -0.96px; 197 --wui-letter-spacing-title-6: -0.88px; 198 --wui-letter-spacing-large: -0.8px; 199 --wui-letter-spacing-medium: -0.72px; 200 --wui-letter-spacing-paragraph: -0.64px; 201 --wui-letter-spacing-small: -0.56px; 202 --wui-letter-spacing-tiny: -0.48px; 203 --wui-letter-spacing-micro: -0.2px; 204 --wui-letter-spacing-mini: -0.16px; 205 206 --wui-spacing-0: 0px; 207 --wui-spacing-4xs: 2px; 208 --wui-spacing-3xs: 4px; 209 --wui-spacing-xxs: 6px; 210 --wui-spacing-2xs: 7px; 211 --wui-spacing-xs: 8px; 212 --wui-spacing-1xs: 10px; 213 --wui-spacing-s: 12px; 214 --wui-spacing-m: 14px; 215 --wui-spacing-l: 16px; 216 --wui-spacing-2l: 18px; 217 --wui-spacing-xl: 20px; 218 --wui-spacing-xxl: 24px; 219 --wui-spacing-2xl: 32px; 220 --wui-spacing-3xl: 40px; 221 --wui-spacing-4xl: 90px; 222 --wui-spacing-5xl: 95px; 223 224 --wui-icon-box-size-xxs: 14px; 225 --wui-icon-box-size-xs: 20px; 226 --wui-icon-box-size-sm: 24px; 227 --wui-icon-box-size-md: 32px; 228 --wui-icon-box-size-mdl: 36px; 229 --wui-icon-box-size-lg: 40px; 230 --wui-icon-box-size-2lg: 48px; 231 --wui-icon-box-size-xl: 64px; 232 233 --wui-icon-size-inherit: inherit; 234 --wui-icon-size-xxs: 10px; 235 --wui-icon-size-xs: 12px; 236 --wui-icon-size-sm: 14px; 237 --wui-icon-size-md: 16px; 238 --wui-icon-size-mdl: 18px; 239 --wui-icon-size-lg: 20px; 240 --wui-icon-size-xl: 24px; 241 --wui-icon-size-xxl: 28px; 242 243 --wui-wallet-image-size-inherit: inherit; 244 --wui-wallet-image-size-sm: 40px; 245 --wui-wallet-image-size-md: 56px; 246 --wui-wallet-image-size-lg: 80px; 247 248 --wui-visual-size-size-inherit: inherit; 249 --wui-visual-size-sm: 40px; 250 --wui-visual-size-md: 55px; 251 --wui-visual-size-lg: 80px; 252 253 --wui-box-size-md: 100px; 254 --wui-box-size-lg: 120px; 255 256 --wui-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1); 257 --wui-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1); 258 259 --wui-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1); 260 --wui-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1); 261 --wui-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1); 262 263 --wui-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1); 264 265 --wui-duration-lg: 200ms; 266 --wui-duration-md: 125ms; 267 --wui-duration-sm: 75ms; 268 269 --wui-path-network-sm: path( 270 'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z' 271 ); 272 273 --wui-path-network-md: path( 274 'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z' 275 ); 276 277 --wui-path-network-lg: path( 278 'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z' 279 ); 280 281 --wui-width-network-sm: 36px; 282 --wui-width-network-md: 48px; 283 --wui-width-network-lg: 86px; 284 285 --wui-height-network-sm: 40px; 286 --wui-height-network-md: 54px; 287 --wui-height-network-lg: 96px; 288 289 --wui-icon-size-network-xs: 12px; 290 --wui-icon-size-network-sm: 16px; 291 --wui-icon-size-network-md: 24px; 292 --wui-icon-size-network-lg: 42px; 293 294 --wui-color-inherit: inherit; 295 296 --wui-color-inverse-100: #fff; 297 --wui-color-inverse-000: #000; 298 299 --wui-cover: rgba(20, 20, 20, 0.8); 300 301 --wui-color-modal-bg: var(--wui-color-modal-bg-base); 302 303 --wui-color-accent-100: var(--wui-color-accent-base-100); 304 --wui-color-accent-090: var(--wui-color-accent-base-090); 305 --wui-color-accent-080: var(--wui-color-accent-base-080); 306 307 --wui-color-success-100: var(--wui-color-success-base-100); 308 --wui-color-success-125: var(--wui-color-success-base-125); 309 310 --wui-color-warning-100: var(--wui-color-warning-base-100); 311 312 --wui-color-error-100: var(--wui-color-error-base-100); 313 --wui-color-error-125: var(--wui-color-error-base-125); 314 315 --wui-color-blue-100: var(--wui-color-blue-base-100); 316 --wui-color-blue-90: var(--wui-color-blue-base-90); 317 318 --wui-icon-box-bg-error-100: var(--wui-icon-box-bg-error-base-100); 319 --wui-icon-box-bg-blue-100: var(--wui-icon-box-bg-blue-base-100); 320 --wui-icon-box-bg-success-100: var(--wui-icon-box-bg-success-base-100); 321 --wui-icon-box-bg-inverse-100: var(--wui-icon-box-bg-inverse-base-100); 322 323 --wui-all-wallets-bg-100: var(--wui-all-wallets-bg-100); 324 325 --wui-avatar-border: var(--wui-avatar-border-base); 326 327 --wui-thumbnail-border: var(--wui-thumbnail-border-base); 328 329 --wui-wallet-button-bg: var(--wui-wallet-button-bg-base); 330 331 --wui-box-shadow-blue: var(--wui-color-accent-glass-020); 332 } 333 334 @supports (background: color-mix(in srgb, white 50%, black)) { 335 :root { 336 --wui-color-modal-bg: color-mix( 337 in srgb, 338 var(--w3m-color-mix) var(--w3m-color-mix-strength), 339 var(--wui-color-modal-bg-base) 340 ); 341 342 --wui-box-shadow-blue: color-mix(in srgb, var(--wui-color-accent-100) 20%, transparent); 343 344 --wui-color-accent-100: color-mix( 345 in srgb, 346 var(--wui-color-accent-base-100) 100%, 347 transparent 348 ); 349 --wui-color-accent-090: color-mix( 350 in srgb, 351 var(--wui-color-accent-base-100) 90%, 352 transparent 353 ); 354 --wui-color-accent-080: color-mix( 355 in srgb, 356 var(--wui-color-accent-base-100) 80%, 357 transparent 358 ); 359 --wui-color-accent-glass-090: color-mix( 360 in srgb, 361 var(--wui-color-accent-base-100) 90%, 362 transparent 363 ); 364 --wui-color-accent-glass-080: color-mix( 365 in srgb, 366 var(--wui-color-accent-base-100) 80%, 367 transparent 368 ); 369 --wui-color-accent-glass-020: color-mix( 370 in srgb, 371 var(--wui-color-accent-base-100) 20%, 372 transparent 373 ); 374 --wui-color-accent-glass-015: color-mix( 375 in srgb, 376 var(--wui-color-accent-base-100) 15%, 377 transparent 378 ); 379 --wui-color-accent-glass-010: color-mix( 380 in srgb, 381 var(--wui-color-accent-base-100) 10%, 382 transparent 383 ); 384 --wui-color-accent-glass-005: color-mix( 385 in srgb, 386 var(--wui-color-accent-base-100) 5%, 387 transparent 388 ); 389 --wui-color-accent-002: color-mix( 390 in srgb, 391 var(--wui-color-accent-base-100) 2%, 392 transparent 393 ); 394 395 --wui-color-fg-100: color-mix( 396 in srgb, 397 var(--w3m-color-mix) var(--w3m-color-mix-strength), 398 var(--wui-color-fg-100) 399 ); 400 --wui-color-fg-125: color-mix( 401 in srgb, 402 var(--w3m-color-mix) var(--w3m-color-mix-strength), 403 var(--wui-color-fg-125) 404 ); 405 --wui-color-fg-150: color-mix( 406 in srgb, 407 var(--w3m-color-mix) var(--w3m-color-mix-strength), 408 var(--wui-color-fg-150) 409 ); 410 --wui-color-fg-175: color-mix( 411 in srgb, 412 var(--w3m-color-mix) var(--w3m-color-mix-strength), 413 var(--wui-color-fg-175) 414 ); 415 --wui-color-fg-200: color-mix( 416 in srgb, 417 var(--w3m-color-mix) var(--w3m-color-mix-strength), 418 var(--wui-color-fg-200) 419 ); 420 --wui-color-fg-225: color-mix( 421 in srgb, 422 var(--w3m-color-mix) var(--w3m-color-mix-strength), 423 var(--wui-color-fg-225) 424 ); 425 --wui-color-fg-250: color-mix( 426 in srgb, 427 var(--w3m-color-mix) var(--w3m-color-mix-strength), 428 var(--wui-color-fg-250) 429 ); 430 --wui-color-fg-275: color-mix( 431 in srgb, 432 var(--w3m-color-mix) var(--w3m-color-mix-strength), 433 var(--wui-color-fg-275) 434 ); 435 --wui-color-fg-300: color-mix( 436 in srgb, 437 var(--w3m-color-mix) var(--w3m-color-mix-strength), 438 var(--wui-color-fg-300) 439 ); 440 --wui-color-fg-325: color-mix( 441 in srgb, 442 var(--w3m-color-mix) var(--w3m-color-mix-strength), 443 var(--wui-color-fg-325) 444 ); 445 --wui-color-fg-350: color-mix( 446 in srgb, 447 var(--w3m-color-mix) var(--w3m-color-mix-strength), 448 var(--wui-color-fg-350) 449 ); 450 451 --wui-color-bg-100: color-mix( 452 in srgb, 453 var(--w3m-color-mix) var(--w3m-color-mix-strength), 454 var(--wui-color-bg-100) 455 ); 456 --wui-color-bg-125: color-mix( 457 in srgb, 458 var(--w3m-color-mix) var(--w3m-color-mix-strength), 459 var(--wui-color-bg-125) 460 ); 461 --wui-color-bg-150: color-mix( 462 in srgb, 463 var(--w3m-color-mix) var(--w3m-color-mix-strength), 464 var(--wui-color-bg-150) 465 ); 466 --wui-color-bg-175: color-mix( 467 in srgb, 468 var(--w3m-color-mix) var(--w3m-color-mix-strength), 469 var(--wui-color-bg-175) 470 ); 471 --wui-color-bg-200: color-mix( 472 in srgb, 473 var(--w3m-color-mix) var(--w3m-color-mix-strength), 474 var(--wui-color-bg-200) 475 ); 476 --wui-color-bg-225: color-mix( 477 in srgb, 478 var(--w3m-color-mix) var(--w3m-color-mix-strength), 479 var(--wui-color-bg-225) 480 ); 481 --wui-color-bg-250: color-mix( 482 in srgb, 483 var(--w3m-color-mix) var(--w3m-color-mix-strength), 484 var(--wui-color-bg-250) 485 ); 486 --wui-color-bg-275: color-mix( 487 in srgb, 488 var(--w3m-color-mix) var(--w3m-color-mix-strength), 489 var(--wui-color-bg-275) 490 ); 491 --wui-color-bg-300: color-mix( 492 in srgb, 493 var(--w3m-color-mix) var(--w3m-color-mix-strength), 494 var(--wui-color-bg-300) 495 ); 496 --wui-color-bg-325: color-mix( 497 in srgb, 498 var(--w3m-color-mix) var(--w3m-color-mix-strength), 499 var(--wui-color-bg-325) 500 ); 501 --wui-color-bg-350: color-mix( 502 in srgb, 503 var(--w3m-color-mix) var(--w3m-color-mix-strength), 504 var(--wui-color-bg-350) 505 ); 506 507 --wui-color-success-100: color-mix( 508 in srgb, 509 var(--w3m-color-mix) var(--w3m-color-mix-strength), 510 var(--wui-color-success-base-100) 511 ); 512 --wui-color-success-125: color-mix( 513 in srgb, 514 var(--w3m-color-mix) var(--w3m-color-mix-strength), 515 var(--wui-color-success-base-125) 516 ); 517 518 --wui-color-warning-100: color-mix( 519 in srgb, 520 var(--w3m-color-mix) var(--w3m-color-mix-strength), 521 var(--wui-color-warning-base-100) 522 ); 523 524 --wui-color-error-100: color-mix( 525 in srgb, 526 var(--w3m-color-mix) var(--w3m-color-mix-strength), 527 var(--wui-color-error-base-100) 528 ); 529 --wui-color-blue-100: color-mix( 530 in srgb, 531 var(--w3m-color-mix) var(--w3m-color-mix-strength), 532 var(--wui-color-blue-base-100) 533 ); 534 --wui-color-blue-90: color-mix( 535 in srgb, 536 var(--w3m-color-mix) var(--w3m-color-mix-strength), 537 var(--wui-color-blue-base-90) 538 ); 539 --wui-color-error-125: color-mix( 540 in srgb, 541 var(--w3m-color-mix) var(--w3m-color-mix-strength), 542 var(--wui-color-error-base-125) 543 ); 544 545 --wui-icon-box-bg-error-100: color-mix( 546 in srgb, 547 var(--w3m-color-mix) var(--w3m-color-mix-strength), 548 var(--wui-icon-box-bg-error-base-100) 549 ); 550 --wui-icon-box-bg-accent-100: color-mix( 551 in srgb, 552 var(--w3m-color-mix) var(--w3m-color-mix-strength), 553 var(--wui-icon-box-bg-blue-base-100) 554 ); 555 --wui-icon-box-bg-success-100: color-mix( 556 in srgb, 557 var(--w3m-color-mix) var(--w3m-color-mix-strength), 558 var(--wui-icon-box-bg-success-base-100) 559 ); 560 --wui-icon-box-bg-inverse-100: color-mix( 561 in srgb, 562 var(--w3m-color-mix) var(--w3m-color-mix-strength), 563 var(--wui-icon-box-bg-inverse-base-100) 564 ); 565 566 --wui-all-wallets-bg-100: color-mix( 567 in srgb, 568 var(--w3m-color-mix) var(--w3m-color-mix-strength), 569 var(--wui-all-wallets-bg-100) 570 ); 571 572 --wui-avatar-border: color-mix( 573 in srgb, 574 var(--w3m-color-mix) var(--w3m-color-mix-strength), 575 var(--wui-avatar-border-base) 576 ); 577 578 --wui-thumbnail-border: color-mix( 579 in srgb, 580 var(--w3m-color-mix) var(--w3m-color-mix-strength), 581 var(--wui-thumbnail-border-base) 582 ); 583 584 --wui-wallet-button-bg: color-mix( 585 in srgb, 586 var(--w3m-color-mix) var(--w3m-color-mix-strength), 587 var(--wui-wallet-button-bg-base) 588 ); 589 } 590 } 591 `,
591light:Mt` 592 :root { 593 --w3m-color-mix: ${Ou((n==null?void 0:n["--w3m-color-mix"])||"#fff")}; 594 --w3m-accent: ${Ou(Xp(n,"dark")["--w3m-accent"])}; 595 --w3m-default: #fff; 596 597 --wui-color-modal-bg-base: ${Ou(Xp(n,"dark")["--w3m-background"])}; 598 --wui-color-accent-base-100: var(--w3m-accent); 599 600 --wui-color-blueberry-100: hsla(230, 100%, 67%, 1); 601 --wui-color-blueberry-090: hsla(231, 76%, 61%, 1); 602 --wui-color-blueberry-080: hsla(230, 59%, 55%, 1); 603 --wui-color-blueberry-050: hsla(231, 100%, 70%, 0.1); 604 605 --wui-color-fg-100: #e4e7e7; 606 --wui-color-fg-125: #d0d5d5; 607 --wui-color-fg-150: #a8b1b1; 608 --wui-color-fg-175: #a8b0b0; 609 --wui-color-fg-200: #949e9e; 610 --wui-color-fg-225: #868f8f; 611 --wui-color-fg-250: #788080; 612 --wui-color-fg-275: #788181; 613 --wui-color-fg-300: #6e7777; 614 --wui-color-fg-325: #9a9a9a; 615 --wui-color-fg-350: #363636; 616 617 --wui-color-bg-100: #141414; 618 --wui-color-bg-125: #191a1a; 619 --wui-color-bg-150: #1e1f1f; 620 --wui-color-bg-175: #222525; 621 --wui-color-bg-200: #272a2a; 622 --wui-color-bg-225: #2c3030; 623 --wui-color-bg-250: #313535; 624 --wui-color-bg-275: #363b3b; 625 --wui-color-bg-300: #3b4040; 626 --wui-color-bg-325: #252525; 627 --wui-color-bg-350: #ffffff; 628 629 --wui-color-success-base-100: #26d962; 630 --wui-color-success-base-125: #30a46b; 631 632 --wui-color-warning-base-100: #f3a13f; 633 634 --wui-color-error-base-100: #f25a67; 635 --wui-color-error-base-125: #df4a34; 636 637 --wui-color-blue-base-100: rgba(102, 125, 255, 1); 638 --wui-color-blue-base-90: rgba(102, 125, 255, 0.9); 639 640 --wui-color-success-glass-001: rgba(38, 217, 98, 0.01); 641 --wui-color-success-glass-002: rgba(38, 217, 98, 0.02); 642 --wui-color-success-glass-005: rgba(38, 217, 98, 0.05); 643 --wui-color-success-glass-010: rgba(38, 217, 98, 0.1); 644 --wui-color-success-glass-015: rgba(38, 217, 98, 0.15); 645 --wui-color-success-glass-020: rgba(38, 217, 98, 0.2); 646 --wui-color-success-glass-025: rgba(38, 217, 98, 0.25); 647 --wui-color-success-glass-030: rgba(38, 217, 98, 0.3); 648 --wui-color-success-glass-060: rgba(38, 217, 98, 0.6); 649 --wui-color-success-glass-080: rgba(38, 217, 98, 0.8); 650 651 --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2); 652 653 --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2); 654 655 --wui-color-error-glass-001: rgba(242, 90, 103, 0.01); 656 --wui-color-error-glass-002: rgba(242, 90, 103, 0.02); 657 --wui-color-error-glass-005: rgba(242, 90, 103, 0.05); 658 --wui-color-error-glass-010: rgba(242, 90, 103, 0.1); 659 --wui-color-error-glass-015: rgba(242, 90, 103, 0.15); 660 --wui-color-error-glass-020: rgba(242, 90, 103, 0.2); 661 --wui-color-error-glass-025: rgba(242, 90, 103, 0.25); 662 --wui-color-error-glass-030: rgba(242, 90, 103, 0.3); 663 --wui-color-error-glass-060: rgba(242, 90, 103, 0.6); 664 --wui-color-error-glass-080: rgba(242, 90, 103, 0.8); 665 666 --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2); 667 668 --wui-color-gray-glass-001: rgba(255, 255, 255, 0.01); 669 --wui-color-gray-glass-002: rgba(255, 255, 255, 0.02); 670 --wui-color-gray-glass-005: rgba(255, 255, 255, 0.05); 671 --wui-color-gray-glass-010: rgba(255, 255, 255, 0.1); 672 --wui-color-gray-glass-015: rgba(255, 255, 255, 0.15); 673 --wui-color-gray-glass-020: rgba(255, 255, 255, 0.2); 674 --wui-color-gray-glass-025: rgba(255, 255, 255, 0.25); 675 --wui-color-gray-glass-030: rgba(255, 255, 255, 0.3); 676 --wui-color-gray-glass-060: rgba(255, 255, 255, 0.6); 677 --wui-color-gray-glass-080: rgba(255, 255, 255, 0.8); 678 --wui-color-gray-glass-090: rgba(255, 255, 255, 0.9); 679 680 --wui-color-dark-glass-100: rgba(42, 42, 42, 1); 681 682 --wui-icon-box-bg-error-base-100: #3c2426; 683 --wui-icon-box-bg-blue-base-100: #20303f; 684 --wui-icon-box-bg-success-base-100: #1f3a28; 685 --wui-icon-box-bg-inverse-base-100: #243240; 686 687 --wui-all-wallets-bg-100: #222b35; 688 689 --wui-avatar-border-base: #252525; 690
691 --wui-thumbnail-border-base: #252525; 692 693 --wui-wallet-button-bg-base: var(--wui-color-bg-125); 694 695 --w3m-card-embedded-shadow-color: rgb(17 17 18 / 25%); 696 } 697 `,dark:Mt` 698 :root { 699 --w3m-color-mix: ${Ou((n==null?void 0:n["--w3m-color-mix"])||"#000")}; 700 --w3m-accent: ${Ou(Xp(n,"light")["--w3m-accent"])}; 701 --w3m-default: #000; 702 703 --wui-color-modal-bg-base: ${Ou(Xp(n,"light")["--w3m-background"])}; 704 --wui-color-accent-base-100: var(--w3m-accent); 705 706 --wui-color-blueberry-100: hsla(231, 100%, 70%, 1); 707 --wui-color-blueberry-090: hsla(231, 97%, 72%, 1); 708 --wui-color-blueberry-080: hsla(231, 92%, 74%, 1); 709 710 --wui-color-fg-100: #141414; 711 --wui-color-fg-125: #2d3131; 712 --wui-color-fg-150: #474d4d; 713 --wui-color-fg-175: #636d6d; 714 --wui-color-fg-200: #798686; 715 --wui-color-fg-225: #828f8f; 716 --wui-color-fg-250: #8b9797; 717 --wui-color-fg-275: #95a0a0; 718 --wui-color-fg-300: #9ea9a9; 719 --wui-color-fg-325: #9a9a9a; 720 --wui-color-fg-350: #d0d0d0; 721 722 --wui-color-bg-100: #ffffff; 723 --wui-color-bg-125: #f5fafa; 724 --wui-color-bg-150: #f3f8f8; 725 --wui-color-bg-175: #eef4f4; 726 --wui-color-bg-200: #eaf1f1; 727 --wui-color-bg-225: #e5eded; 728 --wui-color-bg-250: #e1e9e9; 729 --wui-color-bg-275: #dce7e7; 730 --wui-color-bg-300: #d8e3e3; 731 --wui-color-bg-325: #f3f3f3; 732 --wui-color-bg-350: #202020; 733 734 --wui-color-success-base-100: #26b562; 735 --wui-color-success-base-125: #30a46b; 736 737 --wui-color-warning-base-100: #f3a13f; 738 739 --wui-color-error-base-100: #f05142; 740 --wui-color-error-base-125: #df4a34; 741 742 --wui-color-blue-base-100: rgba(102, 125, 255, 1); 743 --wui-color-blue-base-90: rgba(102, 125, 255, 0.9); 744 745 --wui-color-success-glass-001: rgba(38, 181, 98, 0.01); 746 --wui-color-success-glass-002: rgba(38, 181, 98, 0.02); 747 --wui-color-success-glass-005: rgba(38, 181, 98, 0.05); 748 --wui-color-success-glass-010: rgba(38, 181, 98, 0.1); 749 --wui-color-success-glass-015: rgba(38, 181, 98, 0.15); 750 --wui-color-success-glass-020: rgba(38, 181, 98, 0.2); 751 --wui-color-success-glass-025: rgba(38, 181, 98, 0.25); 752 --wui-color-success-glass-030: rgba(38, 181, 98, 0.3); 753 --wui-color-success-glass-060: rgba(38, 181, 98, 0.6); 754 --wui-color-success-glass-080: rgba(38, 181, 98, 0.8); 755 756 --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2); 757 758 --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2); 759 760 --wui-color-error-glass-001: rgba(240, 81, 66, 0.01); 761 --wui-color-error-glass-002: rgba(240, 81, 66, 0.02); 762 --wui-color-error-glass-005: rgba(240, 81, 66, 0.05); 763 --wui-color-error-glass-010: rgba(240, 81, 66, 0.1); 764 --wui-color-error-glass-015: rgba(240, 81, 66, 0.15); 765 --wui-color-error-glass-020: rgba(240, 81, 66, 0.2); 766 --wui-color-error-glass-025: rgba(240, 81, 66, 0.25); 767 --wui-color-error-glass-030: rgba(240, 81, 66, 0.3); 768 --wui-color-error-glass-060: rgba(240, 81, 66, 0.6); 769 --wui-color-error-glass-080: rgba(240, 81, 66, 0.8); 770 771 --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2); 772 773 --wui-icon-box-bg-error-base-100: #f4dfdd; 774 --wui-icon-box-bg-blue-base-100: #d9ecfb; 775 --wui-icon-box-bg-success-base-100: #daf0e4; 776 --wui-icon-box-bg-inverse-base-100: #dcecfc; 777 778 --wui-all-wallets-bg-100: #e8f1fa; 779 780 --wui-avatar-border-base: #f3f4f4; 781 782 --wui-thumbnail-border-base: #eaefef; 783 784 --wui-wallet-button-bg-base: var(--wui-color-bg-125); 785 786 --wui-color-gray-glass-001: rgba(0, 0, 0, 0.01); 787 --wui-color-gray-glass-002: rgba(0, 0, 0, 0.02); 788 --wui-color-gray-glass-005: rgba(0, 0, 0, 0.05); 789 --wui-color-gray-glass-010: rgba(0, 0, 0, 0.1); 790 --wui-color-gray-glass-015: rgba(0, 0, 0, 0.15); 791 --wui-color-gray-glass-020: rgba(0, 0, 0, 0.2); 792 --wui-color-gray-glass-025: rgba(0, 0, 0, 0.25); 793 --wui-color-gray-glass-030: rgba(0, 0, 0, 0.3); 794 --wui-color-gray-glass-060: rgba(0, 0, 0, 0.6); 795 --wui-color-gray-glass-080: rgba(0, 0, 0, 0.8); 796 --wui-color-gray-glass-090: rgba(0, 0, 0, 0.9); 797 798 --wui-color-dark-glass-100: rgba(233, 233, 233, 1); 799 800 --w3m-card-embedded-shadow-color: rgb(224 225 233 / 25%); 801 } 802 `}}const Dn=Mt` 803 *, 804 *::after, 805 *::before, 806 :host { 807 margin: 0; 808 padding: 0; 809 box-sizing: border-box; 810 font-style: normal; 811 text-rendering: optimizeSpeed; 812 -webkit-font-smoothing: antialiased; 813 -moz-osx-font-smoothing: grayscale; 814 -webkit-tap-highlight-color: transparent; 815 font-family: var(--wui-font-family); 816 backface-visibility: hidden; 817 } 818`,Jr=Mt` 819 button, 820 a { 821 cursor: pointer; 822 display: flex; 823 justify-content: center;
824 align-items: center; 825 position: relative; 826 transition: 827 color var(--wui-duration-lg) var(--wui-ease-out-power-1), 828 background-color var(--wui-duration-lg) var(--wui-ease-out-power-1), 829 border var(--wui-duration-lg) var(--wui-ease-out-power-1), 830 border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1), 831 box-shadow var(--wui-duration-lg) var(--wui-ease-out-power-1); 832 will-change: background-color, color, border, box-shadow, border-radius; 833 outline: none; 834 border: none; 835 column-gap: var(--wui-spacing-3xs); 836 background-color: transparent; 837 text-decoration: none; 838 } 839 840 wui-flex { 841 transition: border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1); 842 will-change: border-radius; 843 } 844 845 button:disabled > wui-wallet-image, 846 button:disabled > wui-all-wallets-image, 847 button:disabled > wui-network-image, 848 button:disabled > wui-image, 849 button:disabled > wui-transaction-visual, 850 button:disabled > wui-logo { 851 filter: grayscale(1); 852 } 853 854 @media (hover: hover) and (pointer: fine) { 855 button:hover:enabled { 856 background-color: var(--wui-color-gray-glass-005); 857 } 858 859 button:active:enabled { 860 background-color: var(--wui-color-gray-glass-010); 861 } 862 } 863 864 button:disabled > wui-icon-box { 865 opacity: 0.5; 866 } 867 868 input { 869 border: none; 870 outline: none; 871 appearance: none; 872 } 873`,J8=Mt` 874 .wui-color-inherit { 875 color: var(--wui-color-inherit); 876 } 877 878 .wui-color-accent-100 { 879 color: var(--wui-color-accent-100); 880 } 881 882 .wui-color-error-100 { 883 color: var(--wui-color-error-100); 884 } 885 886 .wui-color-blue-100 { 887 color: var(--wui-color-blue-100); 888 } 889 890 .wui-color-blue-90 { 891 color: var(--wui-color-blue-90); 892 } 893 894 .wui-color-error-125 { 895 color: var(--wui-color-error-125); 896 } 897 898 .wui-color-success-100 { 899 color: var(--wui-color-success-100); 900 } 901 902 .wui-color-success-125 { 903 color: var(--wui-color-success-125); 904 } 905 906 .wui-color-inverse-100 { 907 color: var(--wui-color-inverse-100); 908 } 909 910 .wui-color-inverse-000 { 911 color: var(--wui-color-inverse-000); 912 } 913 914 .wui-color-fg-100 { 915 color: var(--wui-color-fg-100); 916 } 917 918 .wui-color-fg-200 { 919 color: var(--wui-color-fg-200); 920 } 921 922 .wui-color-fg-300 { 923 color: var(--wui-color-fg-300); 924 } 925 926 .wui-color-fg-325 { 927 color: var(--wui-color-fg-325); 928 } 929 930 .wui-color-fg-350 { 931 color: var(--wui-color-fg-350); 932 } 933 934 .wui-bg-color-inherit { 935 background-color: var(--wui-color-inherit); 936 } 937 938 .wui-bg-color-blue-100 { 939 background-color: var(--wui-color-accent-100); 940 } 941 942 .wui-bg-color-error-100 { 943 background-color: var(--wui-color-error-100); 944 } 945 946 .wui-bg-color-error-125 { 947 background-color: var(--wui-color-error-125); 948 } 949 950 .wui-bg-color-success-100 { 951 background-color: var(--wui-color-success-100); 952 } 953 954 .wui-bg-color-success-125 { 955 background-color: var(--wui-color-success-100); 956 } 957 958 .wui-bg-color-inverse-100 { 959 background-color: var(--wui-color-inverse-100); 960 } 961 962 .wui-bg-color-inverse-000 { 963 background-color: var(--wui-color-inverse-000); 964 } 965 966 .wui-bg-color-fg-100 { 967 background-color: var(--wui-color-fg-100); 968 } 969 970 .wui-bg-color-fg-200 { 971 background-color: var(--wui-color-fg-200); 972 } 973 974 .wui-bg-color-fg-300 { 975 background-color: var(--wui-color-fg-300); 976 } 977 978 .wui-color-fg-325 { 979 background-color: var(--wui-color-fg-325); 980 } 981 982 .wui-color-fg-350 { 983 background-color: var(--wui-color-fg-350); 984 } 985`,zi={getSpacingStyles(n,e){if(Array.isArray(n))return n[e]?`var(--wui-spacing-${n[e]})`:void 0;if(typeof n=="string")return`var(--wui-spacing-${n})`},getFormattedDate(n){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(n)},getHostName(n){try{return new URL(n).hostname}catch{return""}},getTruncateString({string:n,charsStart:e,charsEnd:t,truncate:r}){return n.length<=e+t?n:r==="end"?`${n.substring(0,e)}...`:r==="start"?`...${n.substring(n.length-t)}`:`${n.substring(0,Math.floor(e))}...${n.substring(n.length-Math.floor(t))}`},generateAvatarColors(n){const t=n.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),r=this.hexToRgb(t),i=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),o=100-3*Number(i==null?void 0:i.replace("px","")),a=`${o}% ${o}% at 65% 40%`,c=[];for(let u=0;u<5;u+=1){const d=this.tintColor(r,.15*u);c.push(`rgb(${d[0]}, ${d[1]}, ${d[2]})`)}return` 986 --local-color-1: ${c[0]};
987 --local-color-2: ${c[1]}; 988 --local-color-3: ${c[2]}; 989 --local-color-4: ${c[3]}; 990 --local-color-5: ${c[4]}; 991 --local-radial-circle: ${a} 992 `},hexToRgb(n){const e=parseInt(n,16),t=e>>16&255,r=e>>8&255,i=e&255;return[t,r,i]},tintColor(n,e){const[t,r,i]=n,s=Math.round(t+(255-t)*e),o=Math.round(r+(255-r)*e),a=Math.round(i+(255-i)*e);return[s,o,a]},isNumber(n){return{number:/^[0-9]+$/u}.number.test(n)},getColorTheme(n){var e;return n||(typeof window<"u"&&window.matchMedia&&typeof window.matchMedia=="function"?(e=window.matchMedia("(prefers-color-scheme: dark)"))!=null&&e.matches?"dark":"light":"dark")},splitBalance(n){const e=n.split(".");return e.length===2?[e[0],e[1]]:["0","00"]},roundNumber(n,e,t){return n.toString().length>=e?Number(n).toFixed(t):n},formatNumberToLocalString(n,e=2){return n===void 0?"0.00":typeof n=="number"?n.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(n).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})}},WTe=3,HTe=["receive","deposit","borrow","claim"],VTe=["withdraw","repay","burn"],C2={getTransactionGroupTitle(n,e){const t=RD.getYear(),r=RD.getMonthNameByIndex(e);return n===t?r:`${r} ${n}`},getTransactionImages(n){const[e,t]=n,r=!!e&&(n==null?void 0:n.every(o=>!!o.nft_info)),i=(n==null?void 0:n.length)>1;return(n==null?void 0:n.length)===2&&!r?[this.getTransactionImage(t),this.getTransactionImage(e)]:i?n.map(o=>this.getTransactionImage(o)):[this.getTransactionImage(e)]},getTransactionImage(n){return{type:C2.getTransactionTransferTokenType(n),url:C2.getTransactionImageURL(n)}},getTransactionImageURL(n){var i,s,o,a,c;let e;const t=!!(n!=null&&n.nft_info),r=!!(n!=null&&n.fungible_info);return n&&t?e=(o=(s=(i=n==null?void 0:n.nft_info)==null?void 0:i.content)==null?void 0:s.preview)==null?void 0:o.url:n&&r&&(e=(c=(a=n==null?void 0:n.fungible_info)==null?void 0:a.icon)==null?void 0:c.url),e},getTransactionTransferTokenType(n){if(n!=null&&n.fungible_info)return"FUNGIBLE";if(n!=null&&n.nft_info)return"NFT"},getTransactionDescriptions(n){var f,m,w;const e=(f=n==null?void 0:n.metadata)==null?void 0:f.operationType,t=n==null?void 0:n.transfers,r=((m=n==null?void 0:n.transfers)==null?void 0:m.length)>0,i=((w=n==null?void 0:n.transfers)==null?void 0:w.length)>1,s=r&&(t==null?void 0:t.every(y=>!!(y!=null&&y.fungible_info))),[o,a]=t;let c=this.getTransferDescription(o),u=this.getTransferDescription(a);if(!r)return(e==="send"||e==="receive")&&s?(c=zi.getTruncateString({string:n==null?void 0:n.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),u=zi.getTruncateString({string:n==null?void 0:n.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[c,u]):[n.metadata.status];if(i)return t.map(y=>this.getTransferDescription(y)).reverse();let d="";return HTe.includes(e)?d="+":VTe.includes(e)&&(d="-"),c=d.concat(c),[c]},getTransferDescription(n){var t;let e="";return n&&(n!=null&&n.nft_info?e=((t=n==null?void 0:n.nft_info)==null?void 0:t.name)||"-":n!=null&&n.fungible_info&&(e=this.getFungibleTransferDescription(n)||"-")),e},getFungibleTransferDescription(n){var r;return n?[this.getQuantityFixedValue(n==null?void 0:n.quantity.numeric),(r=n==null?void 0:n.fungible_info)==null?void 0:r.symbol].join(" ").trim():null},getQuantityFixedValue(n){return n?parseFloat(n).toFixed(WTe):null}};function qTe(n,e){const{kind:t,elements:r}=e;return{kind:t,elements:r,finisher(i){customElements.get(n)||customElements.define(n,i)}}}function KTe(n,e){return customElements.get(n)||customElements.define(n,e),e}function ot(n){return function(t){return typeof t=="function"?KTe(n,t):qTe(n,t)}}const y6={hexStringToNumber(n){const e=n.startsWith("0x")?n.slice(2):n;return parseInt(e,16)},numberToHexString(n){return`0x${n.toString(16)}`},async getUserInfo(n){const[e,t]=await Promise.all([y6.getAddresses(n),y6.getChainId(n)]);return{chainId:t,addresses:e}},async getChainId(n){const e=await n.request({method:"eth_chainId"});return Number(e)},async getAddress(n){const[e]=await n.request({method:"eth_accounts"});return e},async getAddresses(n){return await n.request({method:"eth_accounts"})},async addEthereumChain(n,e){var r,i;const t=((r=e.rpcUrls.chainDefault)==null?void 0:r.http)||[];await n.request({method:"wallet_addEthereumChain",params:[{chainId:y6.numberToHexString(e.id),rpcUrls:[...t],chainName:e.n
992ame,nativeCurrency:{name:e.nativeCurrency.name,decimals:e.nativeCurrency.decimals,symbol:e.nativeCurrency.symbol},blockExplorerUrls:[(i=e.blockExplorers)==null?void 0:i.default.url],iconUrls:[Tf.NetworkImageIds[e.id]]}]})}},a2={ACCOUNT_INDEXES:{PAYMENT:0,ORDINAL:1}};function VC(n){return{formatters:void 0,fees:void 0,serializers:void 0,...n}}const $_=VC({id:"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",name:"Solana",network:"solana-mainnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!1,chainNamespace:"solana",caipNetworkId:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",deprecatedCaipNetworkId:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ"}),U7=VC({id:"EtWTRABZaYq6iMfeYKouRu166VU2xqa1",name:"Solana Devnet",network:"solana-devnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",deprecatedCaipNetworkId:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"}),YTe=VC({id:"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",name:"Solana Testnet",network:"solana-testnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"});VC({id:"000000000019d6689c085ae165831e93",caipNetworkId:"bip122:000000000019d6689c085ae165831e93",chainNamespace:"bip122",name:"Bitcoin",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}});VC({id:"000000000933ea01ad0ee984209779ba",caipNetworkId:"bip122:000000000933ea01ad0ee984209779ba",chainNamespace:"bip122",name:"Bitcoin Testnet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},testnet:!0});const GTe={solana:["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"],eip155:["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_showCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],bip122:["sendTransfer","signMessage","signPsbt","getAccountAddresses"]},Jd={getMethodsByChainNamespace(n){return GTe[n]||[]},createDefaultNamespace(n){return{methods:this.getMethodsByChainNamespace(n),events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}}},applyNamespaceOverrides(n,e){if(!e)return{...n};const t={...n},r=new Set;if(e.methods&&Object.keys(e.methods).forEach(i=>r.add(i)),e.chains&&Object.keys(e.chains).forEach(i=>r.add(i)),e.events&&Object.keys(e.events).forEach(i=>r.add(i)),e.rpcMap&&Object.keys(e.rpcMap).forEach(i=>{const[s]=i.split(":");s&&r.add(s)}),r.forEach(i=>{t[i]||(t[i]=this.createDefaultNamespace(i))}),e.methods&&Object.entries(e.methods).forEach(([i,s])=>{t[i]&&(t[i].methods=s)}),e.chains&&Object.entries(e.chains).forEach(([i,s])=>{t[i]&&(t[i].chains=s)}),e.events&&Object.entries(e.events).forEach(([i,s])=>{t[i]&&(t[i].events=s)}),e.rpcMap){const i=new Set;Object.entries(e.rpcMap).forEach(([s,o])=>{const[a,c]=s.split(":");!a||!c||!t[a]||(t[a].rpcMap||(t[a].rpcMap={}),i.has(a)||(t[a].rpcMap={},i.add(a)),t[a].rpcMap[c]=o)})}return t},createNamespaces(n,e){const t=n.reduce((r,i)=>{const{id:s,chainNamespace:o,rpcUrls:a}=i,c=a.default.http[0];r[o]||(r[o]=this.createDefaultNamespace(o));const u=`${o}:${s}`,d=r[o];switch(d.chains.push(u),u){case $_.caipNetworkId:d.chains.push($_.deprecatedCaipNetworkId);break;case U7.caipNetworkId:d.chains.push(U7.deprecatedCaipNetworkId);break}return d!=null&&d.rpcMap&&c&&(d.rpcMap[s]=c),r},{});return this.applyNamespaceOverrides(t,e)},resolveReownName:async n=>{var r;const e=await hS.resolveName(n);return((r=(Object.values(e==null?void 0:e.addresses)||[])[0])==null?void 0:r.address)||!1},getChainsFromNamespaces(n={}){return Object.values(n).flatMap(e=>{const t=e.chains||[],r=e.accounts.map(i=>{const[s,o]=i.split(":");return`${s}:${o}`});return Array.from(new Set([...t,...r]))})}
992,isSessionEventData(n){return typeof n=="object"&&n!==null&&"id"in n&&"topic"in n&&"params"in n&&typeof n.params=="object"&&n.params!==null&&"chainId"in n.params&&"event"in n.params&&typeof n.params.event=="object"&&n.params.event!==null},isOriginAllowed(n,e,t){for(const r of[...e,...t])if(r.includes("*")){const s=`^${r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&").replace(/\\\*/gu,".*")}$`;if(new RegExp(s,"u").test(n))return!0}else try{if(new URL(r).origin===n)return!0}catch{if(r===n)return!0}return!1},listenWcProvider({universalProvider:n,namespace:e,onConnect:t,onDisconnect:r,onAccountsChanged:i,onChainChanged:s,onDisplayUri:o}){t&&n.on("connect",()=>{const a=Jd.getWalletConnectAccounts(n,e);t(a)}),r&&n.on("disconnect",()=>{r()}),i&&n.on("session_event",a=>{if(Jd.isSessionEventData(a)){const{name:c,data:u}=a.params.event;if(c==="accountsChanged"&&Array.isArray(u)){const d=u.filter(f=>tt.isCaipAddress(f)).map(f=>Ha.parseCaipAddress(f)).filter(f=>f.chainNamespace===e);i(d)}}}),s&&n.on("chainChanged",a=>{s(a)}),o&&n.on("display_uri",a=>{o(a)})},getWalletConnectAccounts(n,e){var i,s,o,a;const t=new Set,r=(a=(o=(s=(i=n==null?void 0:n.session)==null?void 0:i.namespaces)==null?void 0:s[e])==null?void 0:o.accounts)==null?void 0:a.map(c=>Ha.parseCaipAddress(c)).filter(({address:c})=>t.has(c.toLowerCase())?!1:(t.add(c.toLowerCase()),!0));return r&&r.length>0?r:[]}};class ZTe{constructor(e){this.namespace=e.namespace}async syncConnections(e){switch(this.namespace){case Be.CHAIN.EVM:await this.syncEVMConnections(e);break;case Be.CHAIN.SOLANA:await this.syncSolanaConnections(e);break;case Be.CHAIN.BITCOIN:await this.syncBitcoinConnections(e);break;default:throw new Error(`Unsupported chain namespace: ${this.namespace}`)}}async syncEVMConnections({connectors:e,caipNetworks:t,universalProvider:r,getConnectionStatusInfo:i,onConnection:s,onListenProvider:o}){await Promise.all(e.filter(a=>{const{hasDisconnected:c,hasConnected:u}=i(a.id);return!c&&u}).map(async a=>{if(a.id===Be.CONNECTOR_ID.WALLET_CONNECT){const c=Jd.getWalletConnectAccounts(r,this.namespace),u=t.find(d=>{var f,m;return d.chainNamespace===this.namespace&&d.id.toString()===((m=(f=c[0])==null?void 0:f.chainId)==null?void 0:m.toString())});c.length>0&&s({connectorId:a.id,accounts:c.map(d=>({address:d.address})),caipNetwork:u})}else{const{accounts:c,chainId:u}=await Xd.fetchProviderData(a);if(c.length>0&&u){const d=t.find(f=>f.chainNamespace===this.namespace&&f.id.toString()===u.toString());s({connectorId:a.id,accounts:c.map(f=>({address:f})),caipNetwork:d}),a.provider&&a.id!==Be.CONNECTOR_ID.AUTH&&a.id!==Be.CONNECTOR_ID.WALLET_CONNECT&&o(a.id,a.provider)}}}))}async syncSolanaConnections({connectors:e,caipNetwork:t,universalProvider:r,getConnectionStatusInfo:i,onConnection:s,onListenProvider:o}){await Promise.all(e.filter(a=>{const{hasDisconnected:c,hasConnected:u}=i(a.id);return!c&&u}).map(async a=>{if(a.id===Be.CONNECTOR_ID.WALLET_CONNECT){const c=Jd.getWalletConnectAccounts(r,this.namespace);c.length>0&&s({connectorId:a.id,accounts:c.map(u=>({address:u.address})),caipNetwork:t})}else{const c=await a.connect({chainId:t==null?void 0:t.id});c&&(s({connectorId:a.id,accounts:[{address:c}],caipNetwork:t}),o(a.id,a.provider))}}))}async syncBitcoinConnections({connectors:e,caipNetwork:t,universalProvider:r,getConnectionStatusInfo:i,onConnection:s,onListenProvider:o}){await Promise.all(e.filter(a=>{const{hasDisconnected:c,hasConnected:u}=i(a.id);return!c&&u}).map(async a=>{var m,w,y,b,E,T;if(a.id===Be.CONNECTOR_ID.WALLET_CONNECT){const N=Jd.getWalletConnectAccounts(r,this.namespace);N.length>0&&s({connectorId:a.id,accounts:N.map(I=>({address:I.address})),caipNetwork:t});return}const c=await a.connect(),u=await a.getAccountAddresses();let d=u==null?void 0:u.map(N=>tt.createAccount(Be.CHAIN.BITCOIN,N.address,N.purpose||"payment",N.publicKey,N.path));if(d&&d.length>1&&(d=[{namespace:Be.CHAIN.BITCOIN,publicKey:((m=d[a2.ACCOUNT_INDEXES.PAYMENT])==null?void 0:m.publicKey)??"",path:((w=d[a2.ACCOUNT_INDEXES.PAYMENT])==null?void 0:w.path)??"",address:((y=d[a2.ACCOUNT_INDEXES.PAYMENT])==null?void 0:y.address)??"",type:"payment"},{namespace:Be.CHAIN.BITCOIN,publicKey:((b=d[a2.ACCOUNT_INDEXES.ORDINAL])==null?void 0:b.publicKey)??"",path:((E=d[a2.ACCOUNT_INDEXES.ORDINAL])==null?void 0:E.path)??"",address:((T=d[a2.ACCOUNT_INDEXES.ORDINAL])==null?void 0:T.address)??"",type:"ordinal"}
992]),!(a.chains.find(N=>N.id===(t==null?void 0:t.id))||a.chains[0]))throw new Error("The connector does not support any of the requested chains");c&&(o(a.id,a.provider),s({connectorId:a.id,accounts:d.map(N=>({address:N.address,type:N.type})),caipNetwork:t}))}))}getConnection({address:e,connectorId:t,connections:r,connectors:i}){if(t){const o=r.find(u=>xi.isLowerCaseMatch(u.connectorId,t));if(!o)return null;const a=i.find(u=>xi.isLowerCaseMatch(u.id,o.connectorId)),c=e?o.accounts.find(u=>xi.isLowerCaseMatch(u.address,e)):o.accounts[0];return{...o,account:c,connector:a}}const s=r.find(o=>o.accounts.length>0&&i.some(a=>xi.isLowerCaseMatch(a.id,o.connectorId)));if(s){const[o]=s.accounts,a=i.find(c=>xi.isLowerCaseMatch(c.id,s.connectorId));return{...s,account:o,connector:a}}return null}}const tS={ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3,ERROR_INVALID_CHAIN_ID:32603,DEFAULT_ALLOWED_ANCESTORS:["http://localhost:*","https://localhost:*","http://127.0.0.1:*","https://127.0.0.1:*","https://*.pages.dev","https://*.vercel.app","https://*.ngrok-free.app","https://secure-mobile.walletconnect.com","https://secure-mobile.walletconnect.org"]};class W${constructor({provider:e,namespace:t}){this.id=Be.CONNECTOR_ID.WALLET_CONNECT,this.name=Tf.ConnectorNamesMap[Be.CONNECTOR_ID.WALLET_CONNECT],this.type="WALLET_CONNECT",this.imageId=Tf.ConnectorImageIds[Be.CONNECTOR_ID.WALLET_CONNECT],this.getCaipNetworks=ue.getCaipNetworks.bind(ue),this.caipNetworks=this.getCaipNetworks(),this.provider=e,this.chain=t}get chains(){return this.getCaipNetworks()}async connectWalletConnect(){if(!await this.authenticate()){const t=this.getCaipNetworks(),r=Ue.state.universalProviderConfigOverride,i=Jd.createNamespaces(t,r);await this.provider.connect({optionalNamespaces:i})}return{clientId:await this.provider.client.core.crypto.getClientId(),session:this.provider.session}}async disconnect(){await this.provider.disconnect()}async authenticate(){const e=this.chains.map(t=>t.caipNetworkId);return al.universalProviderAuthenticate({universalProvider:this.provider,chains:e,methods:QTe})}}const QTe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],XTe=[Be.CONNECTOR_ID.AUTH,Be.CONNECTOR_ID.WALLET_CONNECT];class hne{constructor(e){this.availableConnectors=[],this.availableConnections=[],this.providerHandlers={},this.eventListeners=new Map,this.getCaipNetworks=t=>ue.getCaipNetworks(t),this.getConnectorId=t=>Ge.getConnectorId(t),e&&this.construct(e),e!=null&&e.namespace&&(this.connectionManager=new ZTe({namespace:e.namespace}))}construct(e){this.projectId=e.projectId,this.namespace=e.namespace,this.adapterType=e.adapterType}get connectors(){return this.availableConnectors}get connections(){return this.availableConnections}get networks(){return this.getCaipNetworks(this.namespace)}onAuthConnected({accounts:e,chainId:t}){const r=this.getCaipNetworks().filter(i=>i.chainNamespace===this.namespace).find(i=>i.id.toString()===(t==null?void 0:t.toString()));e&&r&&this.addConnection({connectorId:Be.CONNECTOR_ID.AUTH,accounts:e,caipNetwork:r})}setAuthProvider(e){e.onConnect(this.onAuthConnected.bind(this)),e.onSocialConnected(this.onAuthConnected.bind(this)),this.addConnector({id:Be.CONNECTOR_ID.AUTH,type:"AUTH",name:Be.CONNECTOR_NAMES.AUTH,provider:e,imageId:Tf.ConnectorImageIds[Be.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}addConnector(...e){const t=new Set;this.availableConnectors=[...e,...this.availableConnectors].filter(r=>t.has(r.id)?!1:(t.add(r.id),!0)),this.emit("connectors",this.availableConnectors)}addConnection(...e){const t=new Set;this.availableConnections=[...e,...this.availableConnections].filter(r=>t.has(r.connectorId.toLowerCase())?!1:(t.add(r.connectorId.toLowerCase()),!0)),this.emit
992("connections",this.availableConnections)}deleteConnection(e){this.availableConnections=this.availableConnections.filter(t=>!xi.isLowerCaseMatch(t.connectorId,e)),this.emit("connections",this.availableConnections)}clearConnections(e=!1){this.availableConnections=[],e&&this.emit("connections",this.availableConnections)}setStatus(e,t){_t.setStatus(e,t)}on(e,t){var r;this.eventListeners.has(e)||this.eventListeners.set(e,new Set),(r=this.eventListeners.get(e))==null||r.add(t)}off(e,t){const r=this.eventListeners.get(e);r&&r.delete(t)}removeAllEventListeners(){this.eventListeners.forEach(e=>{e.clear()})}emit(e,t){const r=this.eventListeners.get(e);r&&r.forEach(i=>i(t))}async connectWalletConnect(e){return{clientId:(await this.getWalletConnectConnector().connectWalletConnect()).clientId}}async switchNetwork(e){const{caipNetwork:t,providerType:r}=e;if(!e.provider)return;const i="provider"in e.provider?e.provider.provider:e.provider;if(r==="WALLET_CONNECT"){i.setDefaultChain(t.caipNetworkId);return}if(i&&r==="AUTH"){const s=i,o=Xs(t.chainNamespace);await s.switchNetwork({chainId:t.caipNetworkId});const a=await s.getUser({chainId:t.caipNetworkId,preferredAccountType:o});this.emit("switchNetwork",a)}}getWalletConnectConnector(){const e=this.connectors.find(t=>t instanceof W$);if(!e)throw new Error("WalletConnectConnector not found");return e}onConnect(e,t){if(e.length>0){const{address:r,chainId:i}=tt.getAccount(e[0]),s=this.getCaipNetworks().filter(a=>a.chainNamespace===this.namespace).find(a=>a.id.toString()===(i==null?void 0:i.toString())),o=this.connectors.find(a=>a.id===t);
992r&&(this.emit("accountChanged",{address:r,chainId:i,connector:o}),this.addConnection({connectorId:t,accounts:e.map(a=>{const{address:c}=tt.getAccount(a);return{address:c}}),caipNetwork:s}))}}onAccountsChanged(e,t,r=!0){var i,s;if(e.length>0){const{address:o}=tt.getAccount(e[0]),a=(i=this.connectionManager)==null?void 0:i.getConnection({connectorId:t,connections:this.connections,connectors:this.connectors});o&&xi.isLowerCaseMatch(this.getConnectorId(Be.CHAIN.EVM),t)&&this.emit("accountChanged",{address:o,chainId:(s=a==null?void 0:a.caipNetwork)==null?void 0:s.id,connector:a==null?void 0:a.connector}),this.addConnection({connectorId:t,accounts:e.map(c=>{const{address:u}=tt.getAccount(c);return{address:u}}),caipNetwork:a==null?void 0:a.caipNetwork})}else r&&this.onDisconnect(t)}onDisconnect(e){this.removeProviderListeners(e),this.deleteConnection(e),xi.isLowerCaseMatch(this.getConnectorId(Be.CHAIN.EVM),e)&&this.emitFirstAvailableConnection(),this.connections.length===0&&this.emit("disconnect")}onChainChanged(e,t){var o;const r=typeof e=="string"&&e.startsWith("0x")?y6.hexStringToNumber(e).toString():e.toString(),i=(o=this.connectionManager)==null?void 0:o.getConnection({connectorId:t,connections:this.connections,connectors:this.connectors}),s=this.getCaipNetworks().filter(a=>a.chainNamespace===this.namespace).find(a=>a.id.toString()===r);i&&this.addConnection({connectorId:t,accounts:i.accounts,caipNetwork:s}),xi.isLowerCaseMatch(this.getConnectorId(Be.CHAIN.EVM),t)&&this.emit("switchNetwork",{chainId:r})}listenProviderEvents(e,t){if(XTe.includes(e))return;const r=o=>this.onAccountsChanged(o,e),i=o=>this.onChainChanged(o,e),s=()=>this.onDisconnect(e);this.providerHandlers[e]||(t.on("disconnect",s),t.on("accountsChanged",r),t.on("chainChanged",i),this.providerHandlers[e]={provider:t,disconnect:s,accountsChanged:r,chainChanged:i})}removeProviderListeners(e){if(this.providerHandlers[e]){const{provider:t,disconnect:r,accountsChanged:i,chainChanged:s}=this.providerHandlers[e];t.removeListener("disconnect",r),t.removeListener("accountsChanged",i),t.removeListener("chainChanged",s),this.providerHandlers[e]=null}}emitFirstAvailableConnection(){var t,r;const e=(t=this.connectionManager)==null?void 0:t.getConnection({connections:this.connections,connectors:this.connectors});if(e){const[i]=e.accounts;this.emit("accountChanged",{address:i==null?void 0:i.address,chainId:(r=e.caipNetwork)==null?void 0:r.id,connector:e.connector})}}}class JTe extends hne{async setUniversalProvider(e){if(!this.namespace)throw new Error("UniversalAdapter:setUniversalProvider - namespace is required");return this.addConnector(new W$({provider:e,caipNetworks:this.getCaipNetworks(),namespace:this.namespace})),Promise.resolve()}async connect(e){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(e.chainId),provider:this.provider,address:""})}async disconnect(){try{await this.getWalletConnectConnector().disconnect(),this.emit("disconnect")}catch(e){console.warn("UniversalAdapter:disconnect - error",e)}return{connections:[]}}syncConnections(){return Promise.resolve()}async getAccounts({namespace:e}){var i,s,o,a;const t=this.provider,r=((a=(o=(s=(i=t==null?void 0:t.session)==null?void 0:i.namespaces)==null?void 0:s[e])==null?void 0:o.accounts)==null?void 0:a.map(c=>{const[,,u]=c.split(":");return u}).filter((c,u,d)=>d.indexOf(c)===u))||[];return Promise.resolve({accounts:r.map(c=>tt.createAccount(e,c,e==="bip122"?"payment":"eoa"))})}async syncConnectors(){return Promise.resolve()}async getBalance(e){var s,o,a,c,u;if(!(e.caipNetwork&&sr.BALANCE_SUPPORTED_CHAINS.includes((s=e.caipNetwork)==null?void 0:s.chainNamespace))||(o=e.caipNetwork)!=null&&o.testnet)return{balance:"0.00",symbol:((a=e.caipNetwork)==null?void 0:a.nativeCurrency.symbol)||""};if(_t.state.balanceLoading&&e.chainId===((c=ue.state.activeCaipNetwork)==null?void 0:c.id))return{balance:_t.state.balance||"0.00",symbol:_t.state.balanceSymbol||""};const i=(await _t.fetchTokenBalance()).find(d=>{var f,m;return d.chainId===`${(f=e.caipNetwork)==null?void 0:f.chainNamespace}:${e.chainId}`&&d.symbol===((m=e.caipNetwork)==null?void 0:m.nativeCurrency.symbol)});return{balance:(i==null?void 0:i.quantity.numeric)||"0.00",symbol:(i==null?void 0:i.symbol)||((u=e.caipNetwork)==null?void 0:u.nativeCurrency.symbol)||""}}async signMessage(e){var o,a,c;const{provider:t,message:r,address:i}=e;
992if(!t)throw new Error("UniversalAdapter:signMessage - provider is undefined");let s="";return((o=ue.state.activeCaipNetwork)==null?void 0:o.chainNamespace)===Be.CHAIN.SOLANA?s=(await t.request({method:"solana_signMessage",params:{message:Os.encode(new TextEncoder().encode(r)),pubkey:i}},(a=ue.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)).signature:s=await t.request({method:"personal_sign",params:[r,i]},(c=ue.state.activeCaipNetwork)==null?void 0:c.caipNetworkId),{signature:s}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async sendTransaction(){return Promise.resolve({hash:""})}walletGetAssets(e){return Promise.resolve({})}async writeContract(){return Promise.resolve({hash:""})}emitFirstAvailableConnection(){}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(e){var i,s,o,a,c,u;const{caipNetwork:t}=e,r=this.getWalletConnectConnector();if(t.chainNamespace===Be.CHAIN.EVM)try{await((i=r.provider)==null?void 0:i.request({method:"wallet_switchEthereumChain",params:[{chainId:zz(t.id)}]}))}catch(d){if(d.code===tS.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||d.code===tS.ERROR_INVALID_CHAIN_ID||d.code===tS.ERROR_CODE_DEFAULT||((o=(s=d==null?void 0:d.data)==null?void 0:s.originalError)==null?void 0:o.code)===tS.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)try{await((u=r.provider)==null?void 0:u.request({method:"wallet_addEthereumChain",params:[{chainId:zz(t.id),rpcUrls:[(a=t==null?void 0:t.rpcUrls.chainDefault)==null?void 0:a.http],chainName:t.name,nativeCurrency:t.nativeCurrency,blockExplorerUrls:[(c=t.blockExplorers)==null?void 0:c.default.url]}]}))}catch{throw new Error("Chain is not supported")}}r.provider.setDefaultChain(t.caipNetworkId)}getWalletConnectProvider(){const e=this.connectors.find(r=>r.type==="WALLET_CONNECT");return e==null?void 0:e.provider}}const eIe=["email","socials","swaps","onramp","activity","reownBranding","multiWallet","emailCapture"],EI={email:{apiFeatureName:"social_login",localFeatureName:"email",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:n=>{if(!(n!=null&&n.config))return!1;const e=n.config;return!!n.isEnabled&&e.includes("email")},processFallback:n=>n===void 0?sr.DEFAULT_REMOTE_FEATURES.email:!!n},socials:{apiFeatureName:"social_login",localFeatureName:"socials",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:n=>{if(!(n!=null&&n.config))return!1;const e=n.config;return n.isEnabled&&e.length>0?e.filter(t=>t!=="email"):!1},processFallback:n=>n===void 0?sr.DEFAULT_REMOTE_FEATURES.socials:typeof n=="boolean"?n?sr.DEFAULT_REMOTE_FEATURES.socials:!1:n},swaps:{apiFeatureName:"swap",localFeatureName:"swaps",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:n=>{if(!(n!=null&&n.config))return!1;const e=n.config;return n.isEnabled&&e.length>0?e:!1},processFallback:n=>n===void 0?sr.DEFAULT_REMOTE_FEATURES.swaps:typeof n=="boolean"?n?sr.DEFAULT_REMOTE_FEATURES.swaps:!1:n},onramp:{apiFeatureName:"onramp",localFeatureName:"onramp",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:n=>{if(!(n!=null&&n.config))return!1;const e=n.config;return n.isEnabled&&e.length>0?e:!1},processFallback:n=>n===void 0?sr.DEFAULT_REMOTE_FEATURES.onramp:typeof n=="boolean"?n?sr.DEFAULT_REMOTE_FEATURES.onramp:!1:n},activity:{apiFeatureName:"activity",localFeatureName:"history",returnType:!1,isLegacy:!0,isAvailableOnBasic:!1,processApi:n=>!!n.isEnabled,processFallback:n=>n===void 0?sr.DEFAULT_REMOTE_FEATURES.activity:!!n},reownBranding:{apiFeatureName:"reown_branding",localFeatureName:"reownBranding",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:n=>!!n.isEnabled,processFallback:n=>n===void 0?sr.DEFAULT_REMOTE_FEATURES.reownBranding:!!n},emailCapture:{apiFeatureName:"email_capture",localFeatureName:"emailCapture",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:n=>n.isEnabled&&(n.config??[]),processFallback:n=>!1},multiWallet:{apiFeatureName:"multi_wallet",localFeatureName:"multiWallet",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:n=>!!n.isEnabled,processFallback:()=>sr.DEFAULT_REMOTE_FEATURES.multiWallet}},tIe={localSettingsOverridden:new Set,getApiConfig(n,e){return e==null?void 0:e.find(t=>
992t.id===n)},addWarning(n,e){if(n!==void 0){const t=EI[e],r=t.isLegacy?`"features.${t.localFeatureName}" (now "${e}")`:`"features.${e}"`;this.localSettingsOverridden.add(r)}},processFeature(n,e,t,r,i){const s=EI[n],o=e[s.localFeatureName];if(i&&!s.isAvailableOnBasic)return!1;if(r){const a=this.getApiConfig(s.apiFeatureName,t);return(a==null?void 0:a.config)===null?this.processFallbackFeature(n,o):a!=null&&a.config?(o!==void 0&&this.addWarning(o,n),this.processApiFeature(n,a)):!1}return this.processFallbackFeature(n,o)},processApiFeature(n,e){return EI[n].processApi(e)},processFallbackFeature(n,e){return EI[n].processFallback(e)},async fetchRemoteFeatures(n){const e=n.basic??!1,t=n.features||{};this.localSettingsOverridden.clear();let r=null,i=!1;try{r=await Ft.fetchProjectConfig(),i=r!=null}catch(o){console.warn("[Reown Config] Failed to fetch remote project configuration. Using local/default values.",o)}const s=i&&!e?sr.DEFAULT_REMOTE_FEATURES:sr.DEFAULT_REMOTE_FEATURES_DISABLED;try{for(const o of eIe){const a=this.processFeature(o,t,r,i,e);Object.assign(s,{[o]:a})}}catch(o){return console.warn("[Reown Config] Failed to process the configuration from Cloud. Using default values.",o),sr.DEFAULT_REMOTE_FEATURES}if(i&&this.localSettingsOverridden.size>0){const o=`Your local configuration for ${Array.from(this.localSettingsOverridden).join(", ")} was ignored because a remote configuration was successfully fetched. Please manage these features via your project dashboard on dashboard.reown.com.`;Fs.open({debugMessage:Qo.ALERT_WARNINGS.LOCAL_CONFIGURATION_IGNORED.debugMessage(o)},"warning")}return s}};class nIe{constructor(e){this.chainNamespaces=[],this.remoteFeatures={},this.reportedAlertErrors={},this.getCaipNetwork=(t,r)=>{var i,s,o;if(t){const a=(i=ue.getCaipNetworks(t))==null?void 0:i.find(d=>d.id===r);if(a)return a;const c=(s=ue.getNetworkData(t))==null?void 0:s.caipNetwork;return c||((o=ue.getRequestedCaipNetworks(t).filter(d=>d.chainNamespace===t))==null?void 0:o[0])}return ue.state.activeCaipNetwork||this.defaultCaipNetwork},this.getCaipNetworkId=()=>{const t=this.getCaipNetwork();if(t)return t.id},this.getCaipNetworks=t=>ue.getCaipNetworks(t),this.getActiveChainNamespace=()=>ue.state.activeChain,this.setRequestedCaipNetworks=(t,r)=>{ue.setRequestedCaipNetworks(t,r)},this.getApprovedCaipNetworkIds=()=>ue.getAllApprovedCaipNetworkIds(),this.getCaipAddress=t=>{var r,i;return ue.state.activeChain===t||!t?ue.state.activeCaipAddress:(i=(r=ue.state.chains.get(t))==null?void 0:r.accountState)==null?void 0:i.caipAddress},this.setClientId=t=>{Vn.setClientId(t)},this.getProvider=t=>Ii.getProvider(t),this.getProviderType=t=>Ii.getProviderId(t),this.getPreferredAccountType=t=>Xs(t),this.setCaipAddress=(t,r)=>{_t.setCaipAddress(t,r)},this.setBalance=(t,r,i)=>{_t.setBalance(t,r,i)},this.setProfileName=(t,r)=>{_t.setProfileName(t,r)},this.setProfileImage=(t,r)=>{_t.setProfileImage(t,r)},this.setUser=(t,r)=>{_t.setUser(t,r)},this.resetAccount=t=>{_t.resetAccount(t)},this.setCaipNetwork=t=>{ue.setActiveCaipNetwork(t)},this.setCaipNetworkOfNamespace=(t,r)=>{ue.setChainNetworkData(r,{caipNetwork:t})},this.setStatus=(t,r)=>{_t.setStatus(t,r),Ge.isConnected()?wt.setConnectionStatus("connected"):wt.setConnectionStatus("disconnected")},this.getAddressByChainNamespace=t=>{var r,i;return(i=(r=ue.state.chains.get(t))==null?void 0:r.accountState)==null?void 0:i.address},this.setConnectors=t=>{const r=[...Ge.state.allConnectors,...t];Ge.setConnectors(r)},this.setConnections=(t,r)=>{wt.setConnections(t,r),nt.setConnections(t,r)},this.fetchIdentity=t=>Vn.fetchIdentity(t),this.getReownName=t=>hS.getNamesForAddress(t),this.getConnectors=()=>Ge.getConnectors(),this.getConnectorImage=t=>Hr.getConnectorImage(t),this.getConnections=t=>this.remoteFeatures.multiWallet?ju.getConnectionsData(t).connections:(Fs.open(Be.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.getRecentConnections=t=>this.remoteFeatures.multiWallet?ju.getConnectionsData(t).recentConnections:(Fs.open(Be.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.switchConnection=async t=>{if(!this.remoteFeatures.multiWallet){Fs.open(Be.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");return}await nt.switchConnection(t)},this.deleteConnection=t=>{if(!this.remoteFeatures.multiWallet){Fs.open(Be.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");return}
992wt.deleteAddressFromConnection(t),nt.syncStorageConnections()},this.setConnectedWalletInfo=(t,r)=>{const i=Ii.getProviderId(r),s=t?{...t,type:i}:void 0;_t.setConnectedWalletInfo(s,r)},this.getIsConnectedState=()=>!!ue.state.activeCaipAddress,this.addAddressLabel=(t,r,i)=>{_t.addAddressLabel(t,r,i)},this.removeAddressLabel=(t,r)=>{_t.removeAddressLabel(t,r)},this.getAddress=t=>{var r,i;return ue.state.activeChain===t||!t?_t.state.address:(i=(r=ue.state.chains.get(t))==null?void 0:r.accountState)==null?void 0:i.address},this.setApprovedCaipNetworksData=t=>ue.setApprovedCaipNetworksData(t),this.resetNetwork=t=>{ue.resetNetwork(t)},this.addConnector=t=>{Ge.addConnector(t)},this.resetWcConnection=()=>{nt.resetWcConnection()},this.setAddressExplorerUrl=(t,r)=>{_t.setAddressExplorerUrl(t,r)},this.setSmartAccountDeployed=(t,r)=>{_t.setSmartAccountDeployed(t,r)},this.setPreferredAccountType=(t,r)=>{ue.setAccountProp("preferredAccountType",t,r)},this.setEIP6963Enabled=t=>{Ue.setEIP6963Enabled(t)},this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.options=e,this.version=e.sdkVersion,this.caipNetworks=this.extendCaipNetworks(e),this.chainNamespaces=this.getChainNamespacesSet(e.adapters,this.caipNetworks),this.defaultCaipNetwork=this.extendDefaultCaipNetwork(e),this.chainAdapters=this.createAdapters(e.adapters),this.readyPromise=this.initialize(e)}getChainNamespacesSet(e,t){const r=e==null?void 0:e.map(s=>s.namespace).filter(s=>!!s);if(r!=null&&r.length)return[...new Set(r)];const i=t==null?void 0:t.map(s=>s.chainNamespace);return[...new Set(i)]}async initialize(e){var t,r,i;this.initializeProjectSettings(e),this.initControllers(e),await this.initChainAdapters(),this.sendInitializeEvent(e),Ue.state.enableReconnect?(await this.syncExistingConnection(),await this.syncAdapterConnections()):await this.unSyncExistingConnection(),this.remoteFeatures=await tIe.fetchRemoteFeatures(e),Ue.setRemoteFeatures(this.remoteFeatures),this.remoteFeatures.onramp&&UD.setOnrampProviders(this.remoteFeatures.onramp),((t=Ue.state.remoteFeatures)!=null&&t.email||Array.isArray((r=Ue.state.remoteFeatures)==null?void 0:r.socials)&&((i=Ue.state.remoteFeatures)==null?void 0:i.socials.length)>0)&&await this.checkAllowedOrigins()}async checkAllowedOrigins(){try{const e=await Ft.fetchAllowedOrigins();if(!e||!tt.isClient()){Fs.open(Qo.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}const t=window.location.origin;Jd.isOriginAllowed(t,e,tS.DEFAULT_ALLOWED_ANCESTORS)||Fs.open(Qo.ALERT_ERRORS.ORIGIN_NOT_ALLOWED,"error")}catch(e){if(!(e instanceof Error)){Fs.open(Qo.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}switch(e.message){case"RATE_LIMITED":Fs.open(Qo.ALERT_ERRORS.RATE_LIMITED_APP_CONFIGURATION,"error");break;case"SERVER_ERROR":{const t=e.cause instanceof Error?e.cause:e;Fs.open({displayMessage:Qo.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.displayMessage,debugMessage:Qo.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.debugMessage(t.message)},"error");break}default:Fs.open(Qo.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error")}}}sendInitializeEvent(e){var r;const{...t}=e;delete t.adapters,delete t.universalProvider,xn.sendEvent({type:"track",event:"INITIALIZE",properties:{...t,networks:e.networks.map(i=>i.id),siweConfig:{options:((r=e.siweConfig)==null?void 0:r.options)||{}}}})}initControllers(e){this.initializeOptionsController(e),this.initializeChainController(e),this.initializeThemeController(e),this.initializeConnectionController(e),this.initializeConnectorController()}initializeThemeController(e){e.themeMode&&na.setThemeMode(e.themeMode),e.themeVariables&&na.setThemeVariables(e.themeVariables)}initializeChainController(e){if(!this.connectionControllerClient||!this.networkControllerClient)throw new Error("ConnectionControllerClient and NetworkControllerClient must be set");ue.initialize(e.adapters??[],this.caipNetworks,{connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient});const t=this.getDefaultNetwork();t&&ue.setActiveCaipNetwork(t)}initializeConnectionController(e){nt.initialize(e.adapters??[]),nt.setWcBasic(e.basic??!1)}initializeConnectorController(){Ge.initialize(this.chainNamespaces)}initializeProjectSettings(e){Ue.setProjectId(e.projectId),Ue.setSdkVersion(e.sdkVersion)}initializeOptionsController(e){var i;Ue.setDebug(e.debug!==!1),Ue.setEnableWalletConnect(e.enableWalletConnect!==!1),Ue.setEnableWalletGuide(e.enableWalletGuide!==!1),Ue.setEnableWallets(e.enableWallets!==!1),Ue.setEIP6963Enabled(e.enableEIP6963!==!1),Ue.setEnableNetworkSwitch(e.enableNetworkSwitch!==!1),Ue.setEnableReconnect(e.enableReconnect!==!1),Ue.setEnableAuthLogger(e.enableAuthLogger!==!1),Ue.setCustomRpcUrls(e.customRpcUrls),Ue.setEnableEmbedded(e.enableEmbedded),Ue.setAllWallets(e.allWallets),Ue.setIncludeWalletIds(e.includeWalletIds),Ue.setExcludeWalletIds(e.excludeWalletIds),Ue.setFeaturedWalletIds(e.featuredWalletIds),Ue.setTokens(e.tokens),Ue.setTermsConditionsUrl(e.termsConditionsUrl),Ue.setPrivacyPolicyUrl(e.privacyPolicyUrl),Ue.setCustomWallets(e.customWallets),Ue.setFeatures(e.features),Ue.setAllowUnsupportedChain(e.allowUnsupportedChain),Ue.setUniversalProviderConfigOverride(e.universalProviderConfigOverride),Ue.setPreferUniversalLinks(e.experimental_preferUniversalLinks),Ue.setDefaultAccountTypes(e.defaultAccountTypes);const t=this.getDefaultMetaData();if(!e.metadata&&t&&(e.metadata=t),Ue.setMetadata(e.metadata),Ue.setDisableAppend(e.disableAppend),Ue.setEnableEmbedded(e.enableEmbedded),Ue.setSIWX(e.siwx),!e.projectId){Fs.open(Qo.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}if(((i=e.adapters)==null?void 0:i.find(s=>s.namespace===Be.CHAIN.EVM))&&e.siweConfig){if(e.siwx)throw new Error("Cannot set both `siweConfig` and `siwx` options");Ue.setSIWX(e.siweConfig.mapToSIWX())}}getDefaultMetaData(){var e,t,r,i;return tt.isClient()?{name:((t=(e=document.getElementsByTagName("title"))==null?void 0:e[0])==null?void 0:t.textContent)||"",description:((r=document.querySelector('meta[property="og:description"]'))==null?void 0:r.content)||"",url:window.location.origin,icons:[((i=document.querySelector('link[rel~="icon"]'))==null?void 0:i.href)||""]}:null}setUnsupportedNetwork(e){const t=this.getActiveChainNamespace();if(t){const r=yy.getUnsupportedNetwork(`${t}:${e}`);ue.setActiveCaipNetwork(r)}}getDefaultNetwork(){return yy.getCaipNetworkFromStorage(this.defaultCaipNetwork)}extendCaipNetwork(e,t){return yy.extendCaipNetwork(e,{customNetworkImageUrls:t.chainImages,projectId:t.projectId})}extendCaipNetworks(e){return yy.extendCaipNetworks(e.networks,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId})}extendDefaultCaipNetwork(e){const t=e.networks.find(i=>{var s;return i.id===((s=e.defaultNetwork)==null?void 0:s.id)});return t?yy.extendCaipNetwork(t,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId}):void 0}async disconnectNamespace(e,t){var r,i;try{this.setLoading(!0,e);let s={connections:[]};const o=this.getAdapter(e);return(((i=(r=ue.state.chains.get(e))==null?void 0:r.accountState)==null?void 0:i.caipAddress)||!Ue.state.enableReconnect)&&(o!=null&&o.disconnect)&&(s=await o.disconnect({id:t})),this.setLoading(!1,e),s}catch(s){throw this.setLoading(!1,e),new Error(`Failed to disconnect chains: ${s.message}`)}}createClients(){this.connectionControllerClient={connectWalletConnect:async()=>{var u;const e=ue.state.activeChain,t=this.getAdapter(e),r=(u=this.getCaipNetwork(e))==null?void 0:u.id,i=nt.getConnections(e),s=this.remoteFeatures.multiWallet,o=i.length>0;if(!t)throw new Error("Adapter not found");const a=await t.connectWalletConnect(r);(!o||!s)&&this.close(),this.setClientId((a==null?void 0:a.clientId)||null),wt.setConnectedNamespaces([...ue.state.chains.keys()]),await this.syncWalletConnectAccount(),await al.initializeIfEnabled()},connectExternal:async({id:e,address:t,info:r,type:i,provider:s,chain:o,caipNetwork:a,socialUri:c}
992)=>{var y,b,E,T,N,I;const u=ue.state.activeChain,d=o||u,f=this.getAdapter(d);if(o&&o!==u&&!a){const H=this.getCaipNetworks().find(L=>L.chainNamespace===o);H&&this.setCaipNetwork(H)}if(!d)throw new Error("connectExternal: namespace not found");if(!f)throw new Error("connectExternal: adapter not found");const m=this.getCaipNetwork(d),w=await f.connect({id:e,address:t,info:r,type:i,provider:s,socialUri:c,chainId:(a==null?void 0:a.id)||(m==null?void 0:m.id),rpcUrl:((E=(b=(y=a==null?void 0:a.rpcUrls)==null?void 0:y.default)==null?void 0:b.http)==null?void 0:E[0])||((I=(N=(T=m==null?void 0:m.rpcUrls)==null?void 0:T.default)==null?void 0:N.http)==null?void 0:I[0])});if(w)return wt.addConnectedNamespace(d),this.syncProvider({...w,chainNamespace:d}),this.setStatus("connected",d),this.syncConnectedWalletInfo(d),wt.removeDisconnectedConnectorId(e,d),{address:w.address}},reconnectExternal:async({id:e,info:t,type:r,provider:i})=>{var a;const s=ue.state.activeChain,o=this.getAdapter(s);if(!s)throw new Error("reconnectExternal: namespace not found");if(!o)throw new Error("reconnectExternal: adapter not found");o!=null&&o.reconnect&&(await(o==null?void 0:o.reconnect({id:e,info:t,type:r,provider:i,chainId:(a=this.getCaipNetwork())==null?void 0:a.id})),wt.addConnectedNamespace(s),this.syncConnectedWalletInfo(s))},disconnect:async e=>{var u;const{id:t,chainNamespace:r,initialDisconnect:i}=e||{},s=r||ue.state.activeChain,o=Ge.getConnectorId(s),a=t===Be.CONNECTOR_ID.AUTH||o===Be.CONNECTOR_ID.AUTH,c=t===Be.CONNECTOR_ID.WALLET_CONNECT||o===Be.CONNECTOR_ID.WALLET_CONNECT;try{const d=Array.from(ue.state.chains.keys());let f=r?[r]:d;(c||a)&&(f=d);const m=f.map(async b=>{const E=Ge.getConnectorId(b),T=await this.disconnectNamespace(b,t||E);T&&(a&&wt.deleteConnectedSocialProvider(),T.connections.forEach(N=>{wt.addDisconnectedConnectorId(N.connectorId,b)})),i&&this.onDisconnectNamespace({chainNamespace:b,closeModal:!1})}),w=await Promise.allSettled(m);ii.resetSend(),nt.resetWcConnection(),(u=al.getSIWX())!=null&&u.signOutOnDisconnect&&await al.clearSessions(),Ge.setFilterByNamespace(void 0),nt.syncStorageConnections();const y=w.filter(b=>b.status==="rejected");if(y.length>0)throw new Error(y.map(b=>b.reason.message).join(", "));xn.sendEvent({type:"track",event:"DISCONNECT_SUCCESS",properties:{namespace:r||"all"}})}catch(d){throw new Error(`Failed to disconnect chains: ${d.message}`)}},checkInstalled:e=>e?e.some(t=>{var r;return!!((r=window.ethereum)!=null&&r[String(t)])}):!!window.ethereum,signMessage:async e=>{const t=ue.state.activeChain,r=this.getAdapter(ue.state.activeChain);if(!t)throw new Error("signMessage: namespace not found");if(!r)throw new Error("signMessage: adapter not found");const i=await(r==null?void 0:r.signMessage({message:e,address:_t.state.address,provider:Ii.getProvider(t)}));return(i==null?void 0:i.signature)||""},sendTransaction:async e=>{const t=e.chainNamespace;if(!t)throw new Error("sendTransaction: namespace not found");if(sr.SEND_SUPPORTED_NAMESPACES.includes(t)){const r=this.getAdapter(t);if(!r)throw new Error("sendTransaction: adapter not found");const i=Ii.getProvider(t),s=await(r==null?void 0:r.sendTransaction({...e,caipNetwork:this.getCaipNetwork(),provider:i}));return(s==null?void 0:s.hash)||""}return""},estimateGas:async e=>{const t=e.chainNamespace;if(t===Be.CHAIN.EVM){const r=this.getAdapter(t);if(!r)throw new Error("estimateGas: adapter is required but got undefined");const i=Ii.getProvider(t),s=this.getCaipNetwork();if(!s)throw new Error("estimateGas: caipNetwork is required but got undefined");const o=await(r==null?void 0:r.estimateGas({...e,provider:i,caipNetwork:s}));return(o==null?void 0:o.gas)||0n}return 0n},getEnsAvatar:async()=>{var t;const e=ue.state.activeChain;if(!e)throw new Error("getEnsAvatar: namespace is required but got undefined");return await this.syncIdentity({address:_t.state.address,chainId:Number((t=this.getCaipNetwork())==null?void 0:t.id),chainNamespace:e}),_t.state.profileImage||!1},getEnsAddress:async e=>await Jd.resolveReownName(e),writeContract:async e=>{const t=ue.state.activeChain,r=this.getAdapter(t);if(!t)throw new Error("writeContract: namespace is required but got undefined");if(!r)throw new Error("writeContract: adapter is required but got undefined");const i=this.getCaipNetwork(),s=this.getCaipAddress(),o=Ii.getProvider(t);if(!i||!s)throw new Error("writeContract: caipNetwork or caipAddress is required but got undefined");const a=await(r==null?void 0:r.writeContract({...e,caipNetwork:i,provider:o,caipAddress:s}));return a==null?void 0:a.hash},parseUnits:(e,t)=>{const r=this.getAdapter(ue.state.activeChain);if(!r)throw new Error("parseUnits: adapter is required but got undefined");return(r==null?void 0:r.parseUnits({value:e,decimals:t}))??0n},formatUnits:(e,t)=>{const r=this.getAdapter(ue.state.activeChain);if(!r)throw new Error("formatUnits: adapter is required but got undefined");return(r==null?void 0:r.formatUnits({value:e,decimals:t}))??"0"},getCapabilities:async e=>{const t=this.getAdapter(ue.state.activeChain);if(!t)throw new Error("getCapabilities: adapter is required but got undefined");return await(t==null?void 0:t.getCapabilities(e))},grantPermissions:async e=>{const t=this.getAdapter(ue.state.activeChain);if(!t)throw new Error("grantPermissions: adapter is required but got undefined");return await(t==null?void 0:t.grantPermissions(e))},revokePermissions:async e=>{const t=this.getAdapter(ue.state.activeChain);if(!t)throw new Error("revokePermissions: adapter is required but got undefined");return t!=null&&t.revokePermissions?await t.revokePermissions(e):"0x"},walletGetAssets:async e=>{const t=this.getAdapter(ue.state.activeChain);if(!t)throw new Error("walletGetAssets: adapter is required but got undefined");return await(t==null?void 0:t.walletGetAssets(e))??{}},updateBalance:e=>{const t=this.getCaipNetwork(e);!t||!_t.state.address||this.updateNativeBalance(_t.state.address,t==null?void 0:t.id,e)}},this.networkControllerClient={switchCaipNetwork:async e=>await this.switchCaipNetwork(e),getApprovedCaipNetworksData:async()=>this.getApprovedCaipNetworksData()},nt.setClient(this.connectionControllerClient)}getApprovedCaipNetworksData(){var t,r,i,s,o;if(Ii.getProviderId(ue.state.activeChain)===ss.CONNECTOR_TYPE_WALLET_CONNECT){const a=(r=(t=this.universalProvider)==null?void 0:t.session)==null?void 0:r.namespaces;return{supportsAllNetworks:((o=(s=(i=this.universalProvider)==null?void 0:i.session)==null?void 0:s.peer)==null?void 0:o.metadata.name)==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(a)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}async switchCaipNetwork(e){if(!e)return;const t=e.chainNamespace;if(this.getAddressByChainNamespace(e.chainNamespace)){const i=Ii.getProvider(t),s=Ii.getProviderId(t);if(e.chainNamespace===ue.state.activeChain){const o=this.getAdapter(t);await(o==null?void 0:o.switchNetwork({caipNetwork:e,provider:i,providerType:s}))}else if(this.setCaipNetwork(e),s===ss.CONNECTOR_TYPE_WALLET_CONNECT)this.syncWalletConnectAccount();else{const o=this.getAddressByChainNamespace(t);o&&this.syncAccount({address:o,chainId:e.id,chainNamespace:t})}}else this.setCaipNetwork(e)}
992getChainsFromNamespaces(e={}){return Object.values(e).flatMap(t=>{const r=t.chains||[],i=t.accounts.map(s=>{const{chainId:o,chainNamespace:a}=Ha.parseCaipAddress(s);return`${a}:${o}`});return Array.from(new Set([...r,...i]))})}createAdapters(e){return this.createClients(),this.chainNamespaces.reduce((t,r)=>{var s;const i=e==null?void 0:e.find(o=>o.namespace===r);return i?(i.construct({namespace:r,projectId:(s=this.options)==null?void 0:s.projectId,networks:this.getCaipNetworks()}),t[r]=i):t[r]=new JTe({namespace:r,networks:this.getCaipNetworks()}),t},{})}async initChainAdapter(e){var t;this.onConnectors(e),this.listenAdapter(e),await((t=this.chainAdapters)==null?void 0:t[e].syncConnectors(this.options,this)),await this.createUniversalProviderForAdapter(e)}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async e=>{await this.initChainAdapter(e)}))}onConnectors(e){const t=this.getAdapter(e);t==null||t.on("connectors",this.setConnectors.bind(this))}listenAdapter(e){const t=this.getAdapter(e);if(!t)return;const r=wt.getConnectionStatus();Ue.state.enableReconnect===!1?this.setStatus("disconnected",e):r==="connected"?this.setStatus("connecting",e):r==="disconnected"?(wt.clearAddressCache(),this.setStatus(r,e)):this.setStatus(r,e),t.on("switchNetwork",({address:i,chainId:s})=>{var u,d;const o=this.getCaipNetworks().find(f=>f.id.toString()===s.toString()||f.caipNetworkId.toString()===s.toString()),a=ue.state.activeChain===e,c=(d=(u=ue.state.chains.get(e))==null?void 0:u.accountState)==null?void 0:d.address;if(o){const f=a&&i?i:c;f&&this.syncAccount({address:f,chainId:o.id,chainNamespace:e})}else this.setUnsupportedNetwork(s)}),t.on("disconnect",()=>{const i=this.remoteFeatures.multiWallet,s=Array.from(nt.state.connections.values()).flat();this.onDisconnectNamespace({chainNamespace:e,closeModal:!i||s.length===0})}),t.on("connections",i=>{this.setConnections(i,e)}),t.on("pendingTransactions",()=>{const i=_t.state.address,s=ue.state.activeCaipNetwork;!i||!(s!=null&&s.id)||this.updateNativeBalance(i,s.id,s.chainNamespace)}),t.on("accountChanged",({address:i,chainId:s,connector:o})=>{var c,u;
992const a=ue.state.activeChain===e;o!=null&&o.provider&&(this.syncProvider({id:o.id,type:o.type,provider:o.provider,chainNamespace:e}),this.syncConnectedWalletInfo(e)),a&&s?this.syncAccount({address:i,chainId:s,chainNamespace:e}):a&&((c=ue.state.activeCaipNetwork)!=null&&c.id)?this.syncAccount({address:i,chainId:(u=ue.state.activeCaipNetwork)==null?void 0:u.id,chainNamespace:e}):this.syncAccountInfo(i,s,e),wt.addConnectedNamespace(e)})}async createUniversalProviderForAdapter(e){var t,r,i;await this.getUniversalProvider(),this.universalProvider&&await((i=(r=(t=this.chainAdapters)==null?void 0:t[e])==null?void 0:r.setUniversalProvider)==null?void 0:i.call(r,this.universalProvider))}async syncExistingConnection(){await Promise.allSettled(this.chainNamespaces.map(e=>this.syncNamespaceConnection(e)))}async unSyncExistingConnection(){try{await Promise.allSettled(this.chainNamespaces.map(e=>nt.disconnect({namespace:e,initialDisconnect:!0})))}catch(e){console.error("Error disconnecting existing connections:",e)}}async syncNamespaceConnection(e){try{e===Be.CHAIN.EVM&&tt.isSafeApp()&&Ge.setConnectorId(Be.CONNECTOR_ID.SAFE,e);const t=Ge.getConnectorId(e);switch(this.setStatus("connecting",e),t){case Be.CONNECTOR_ID.WALLET_CONNECT:await this.syncWalletConnectAccount();break;case Be.CONNECTOR_ID.AUTH:break;default:await this.syncAdapterConnection(e)}}catch(t){console.warn("AppKit couldn't sync existing connection",t),this.setStatus("disconnected",e)}}onDisconnectNamespace(e){const{chainNamespace:t,closeModal:r}=e||{};ue.resetAccount(t),ue.resetNetwork(t),wt.removeConnectedNamespace(t);const i=Array.from(ue.state.chains.keys());(t?[t]:i).forEach(o=>wt.addDisconnectedConnectorId(Ge.getConnectorId(o)||"",o)),Ge.removeConnectorId(t),Ii.resetChain(t),this.setUser(void 0,t),this.setStatus("disconnected",t),this.setConnectedWalletInfo(void 0,t),r!==!1&&Yn.close()}async syncAdapterConnections(){await Promise.allSettled(this.chainNamespaces.map(e=>{var i;const t=this.getCaipAddress(e),r=this.getCaipNetwork(e);return(i=this.chainAdapters)==null?void 0:i[e].syncConnections({connectToFirstConnector:!t,caipNetwork:r,getConnectorStorageInfo(s){const a=wt.getConnections()[e]??[];return{hasDisconnected:wt.isConnectorDisconnected(s,e),hasConnected:a.some(c=>xi.isLowerCaseMatch(c.connectorId,s))}}})}))}async syncAdapterConnection(e){var a,c,u;const t=this.getAdapter(e),r=Ge.getConnectorId(e),i=this.getCaipNetwork(e),o=Ge.getConnectors(e).find(d=>d.id===r);try{if(!t||!o)throw new Error(`Adapter or connector not found for namespace ${e}`);if(!(i!=null&&i.id))throw new Error("CaipNetwork not found");const d=await(t==null?void 0:t.syncConnection({namespace:e,id:o.id,chainId:i.id,rpcUrl:(u=(c=(a=i==null?void 0:i.rpcUrls)==null?void 0:a.default)==null?void 0:c.http)==null?void 0:u[0]}));d?(this.syncProvider({...d,chainNamespace:e}),await this.syncAccount({...d,chainNamespace:e}),this.setStatus("connected",e)):this.setStatus("disconnected",e)}catch{this.onDisconnectNamespace({chainNamespace:e,closeModal:!1})}}async syncWalletConnectAccount(){var r,i;const e=Object.keys(((i=(r=this.universalProvider)==null?void 0:r.session)==null?void 0:i.namespaces)||{}),t=this.chainNamespaces.map(async s=>{var d,f,m,w,y;const o=this.getAdapter(s);if(!o)return;const a=((w=(m=(f=(d=this.universalProvider)==null?void 0:d.session)==null?void 0:f.namespaces)==null?void 0:m[s])==null?void 0:w.accounts)||[],c=(y=ue.state.activeCaipNetwork)==null?void 0:y.id,u=a.find(b=>{const{chainId:E}=Ha.parseCaipAddress(b);return E===(c==null?void 0:c.toString())})||a[0];if(u){const b=Ha.validateCaipAddress(u),{chainId:E,address:T}=Ha.parseCaipAddress(b);if(Ii.setProviderId(s,ss.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&ue.state.activeCaipNetwork&&o.namespace!==Be.CHAIN.EVM){const N=o.getWalletConnectProvider({caipNetworks:this.getCaipNetworks(),provider:this.universalProvider,activeCaipNetwork:ue.state.activeCaipNetwork});Ii.setProvider(s,N)}else Ii.setProvider(s,this.universalProvider);Ge.setConnectorId(Be.CONNECTOR_ID.WALLET_CONNECT,s),wt.addConnectedNamespace(s),await this.syncAccount({address:T,chainId:E,chainNamespace:s})}else e.includes(s)&&this.setStatus("disconnected",s);this.syncConnectedWalletInfo(s),await ue.setApprovedCaipNetworksData(s)});await Promise.all(t)}syncProvider({type:e,provider:t,id:r,chainNamespace:i}){Ii.setProviderId(i,e),Ii.setProvider(i,t),Ge.setConnectorId(r,i)}async syncAccount(e){var f,m;const t=e.chainNamespace===ue.state.activeChain,r=ue.getCaipNetworkByNamespace(e.chainNamespace,e.chainId),{address:i,chainId:s,chainNamespace:o}=e,{chainId:a}=wt.getActiveNetworkProps(),c=s||a,u=((f=ue.state.activeCaipNetwork)==null?void 0:f.name)===Be.UNSUPPORTED_NETWORK_NAME,d=ue.getNetworkProp("supportsAllNetworks",o);if(this.setStatus("connected",o),!(u&&!d)&&c){let w=this.getCaipNetworks().find(E=>E.id.toString()===c.toString()),y=this.getCaipNetworks().find(E=>E.chainNamespace===o);if(!d&&!w&&!y){const E=this.getApprovedCaipNetworkIds()||[],T=E.find(I=>{var H;return((H=Ha.parseCaipNetworkId(I))==null?void 0:H.chainId)===c.toString()}),N=E.find(I=>{var H;return((H=Ha.parseCaipNetworkId(I))==null?void 0:H.chainNamespace)===o});w=this.getCaipNetworks().find(I=>I.caipNetworkId===T),y=this.getCaipNetworks().find(I=>I.caipNetworkId===N||"deprecatedCaipNetworkId"in I&&I.deprecatedCaipNetworkId===N)}const b=w||y;(b==null?void 0:b.chainNamespace)===ue.state.activeChain?Ue.state.enableNetworkSwitch&&!Ue.state.allowUnsupportedChain&&((m=ue.state.activeCaipNetwork)==null?void 0:m.name)===Be.UNSUPPORTED_NETWORK_NAME?ue.showUnsupportedChainUI():this.setCaipNetwork(b):t||r&&this.setCaipNetworkOfNamespace(r,o),this.syncConnectedWalletInfo(o),xi.isLowerCaseMatch(i,_t.state.address)||this.syncAccountInfo(i,b==null?void 0:b.id,o),t?await this.syncBalance({address:i,chainId:b==null?void 0:b.id,chainNamespace:o}):await this.syncBalance({address:i,chainId:r==null?void 0:r.id,chainNamespace:o})}}async syncAccountInfo(e,t,r){const i=this.getCaipAddress(r),s=t||(i==null?void 0:i.split(":")[1]);if(!s)return;const o=`${r}:${s}:${e}`;this.setCaipAddress(o,r),await this.syncIdentity({address:e,chainId:s,chainNamespace:r})}async syncReownName(e,t){try{const r=await this.getReownName(e);
992if(r[0]){const i=r[0];this.setProfileName(i.name,t)}else this.setProfileName(null,t)}catch{this.setProfileName(null,t)}}syncConnectedWalletInfo(e){var i;const t=Ge.getConnectorId(e),r=Ii.getProviderId(e);if(r===ss.CONNECTOR_TYPE_ANNOUNCED||r===ss.CONNECTOR_TYPE_INJECTED){if(t){const o=this.getConnectors().find(a=>{var f,m;const c=a.id===t,u=((f=a.info)==null?void 0:f.rdns)===t,d=(m=a.connectors)==null?void 0:m.some(w=>{var y;return w.id===t||((y=w.info)==null?void 0:y.rdns)===t});return c||u||!!d});if(o){const{info:a,name:c,imageUrl:u}=o,d=u||this.getConnectorImage(o);this.setConnectedWalletInfo({name:c,icon:d,...a},e)}}}else if(r===ss.CONNECTOR_TYPE_WALLET_CONNECT){const s=Ii.getProvider(e);s!=null&&s.session&&this.setConnectedWalletInfo({...s.session.peer.metadata,name:s.session.peer.metadata.name,icon:(i=s.session.peer.metadata.icons)==null?void 0:i[0]},e)}else if(t&&(t===Be.CONNECTOR_ID.COINBASE_SDK||t===Be.CONNECTOR_ID.COINBASE)){const s=this.getConnectors().find(u=>u.id===t),o=(s==null?void 0:s.name)||"Coinbase Wallet",a=(s==null?void 0:s.imageUrl)||this.getConnectorImage(s),c=s==null?void 0:s.info;this.setConnectedWalletInfo({...c,name:o,icon:a},e)}}async syncBalance(e){!kX.getNetworksByNamespace(this.getCaipNetworks(),e.chainNamespace).find(r=>{var i;return r.id.toString()===((i=e.chainId)==null?void 0:i.toString())})||!e.chainId||await this.updateNativeBalance(e.address,e.chainId,e.chainNamespace)}async ready(){await this.readyPromise}async updateNativeBalance(e,t,r){const i=this.getAdapter(r),s=ue.getCaipNetworkByNamespace(r,t);if(i){const o=await i.getBalance({address:e,chainId:t,caipNetwork:s,tokens:this.options.tokens});return this.setBalance(o.balance,o.symbol,r),o}}async initializeUniversalAdapter(){var r,i,s,o,a,c,u,d,f,m;const e=P1e.createLogger((w,...y)=>{w&&this.handleAlertError(w),console.error(...y)}),t={projectId:(r=this.options)==null?void 0:r.projectId,metadata:{name:(i=this.options)!=null&&i.metadata?(s=this.options)==null?void 0:s.metadata.name:"",description:(o=this.options)!=null&&o.metadata?(a=this.options)==null?void 0:a.metadata.description:"",url:(c=this.options)!=null&&c.metadata?(u=this.options)==null?void 0:u.metadata.url:"",icons:(d=this.options)!=null&&d.metadata?(f=this.options)==null?void 0:f.metadata.icons:[""]},logger:e};Ue.setManualWCControl(!!((m=this.options)!=null&&m.manualWCControl)),this.universalProvider=this.options.universalProvider??await STe.init(t),Ue.state.enableReconnect===!1&&this.universalProvider.session&&await this.universalProvider.disconnect(),this.listenWalletConnect()}listenWalletConnect(){this.universalProvider&&this.chainNamespaces.forEach(e=>{Jd.listenWcProvider({universalProvider:this.universalProvider,namespace:e,onDisplayUri:t=>{nt.setUri(t)},onConnect:()=>{nt.finalizeWcConnection()},onDisconnect:()=>{ue.state.noAdapters&&this.resetAccount(e),nt.resetWcConnection()},onChainChanged:t=>{const r=ue.state.activeChain,i=r&&Ge.state.activeConnectorIds[r]===Be.CONNECTOR_ID.WALLET_CONNECT;if(r===e&&(ue.state.noAdapters||i)){const s=this.getCaipNetworks().find(a=>a.id.toString()===t.toString()||a.caipNetworkId.toString()===t.toString()),o=this.getCaipNetwork();if(!s){this.setUnsupportedNetwork(t);return}(o==null?void 0:o.id.toString())!==(s==null?void 0:s.id.toString())&&(o==null?void 0:o.chainNamespace)===(s==null?void 0:s.chainNamespace)&&this.setCaipNetwork(s)}},onAccountsChanged:t=>{const r=ue.state.activeChain,i=r&&Ge.state.activeConnectorIds[r]===Be.CONNECTOR_ID.WALLET_CONNECT;if(r===e&&(ue.state.noAdapters||i)&&t.length>0){const s=t[0];this.syncAccount({address:s.address,chainId:s.chainId,chainNamespace:s.chainNamespace})}}})})}createUniversalProvider(){var e;return!this.universalProviderInitPromise&&tt.isClient()&&((e=this.options)!=null&&e.projectId)&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}
992async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(e){xn.sendEvent({type:"error",event:"INTERNAL_SDK_ERROR",properties:{errorType:"UniversalProviderInitError",errorMessage:e instanceof Error?e.message:"Unknown",uncaught:!1}}),console.error("AppKit:getUniversalProvider - Cannot create provider",e)}return this.universalProvider}handleAlertError(e){const t=Object.entries(Qo.UniversalProviderErrors).find(([,{message:a}])=>e.message.includes(a)),[r,i]=t??[],{message:s,alertErrorKey:o}=i??{};if(r&&s&&!this.reportedAlertErrors[r]){const a=Qo.ALERT_ERRORS[o];a&&(Fs.open(a,"error"),this.reportedAlertErrors[r]=!0)}}getAdapter(e){var t;if(e)return(t=this.chainAdapters)==null?void 0:t[e]}createAdapter(e){var i;if(!e)return;const t=e.namespace;if(!t)return;this.createClients();const r=e;r.namespace=t,r.construct({namespace:t,projectId:(i=this.options)==null?void 0:i.projectId,networks:this.getCaipNetworks()}),this.chainNamespaces.includes(t)||this.chainNamespaces.push(t),this.chainAdapters&&(this.chainAdapters[t]=r)}async open(e){if(await this.injectModalUi(),e!=null&&e.uri&&nt.setUri(e.uri),e!=null&&e.arguments)switch(e==null?void 0:e.view){case"Swap":return Yn.open({...e,data:{swap:e.arguments}})}return Yn.open(e)}async close(){await this.injectModalUi(),Yn.close()}setLoading(e,t){Yn.setLoading(e,t)}async disconnect(e){await nt.disconnect({namespace:e})}getSIWX(){return Ue.state.siwx}getError(){return""}getChainId(){var e;return(e=ue.state.activeCaipNetwork)==null?void 0:e.id}async switchNetwork(e){const t=this.getCaipNetworks().find(r=>r.id===e.id);if(!t){Fs.open(Qo.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error");return}await ue.switchActiveNetwork(t)}getWalletProvider(){return ue.state.activeChain?Ii.state.providers[ue.state.activeChain]:null}getWalletProviderType(){return Ii.getProviderId(ue.state.activeChain)}subscribeProviders(e){return Ii.subscribeProviders(e)}getThemeMode(){return na.state.themeMode}getThemeVariables(){return na.state.themeVariables}setThemeMode(e){na.setThemeMode(e),dne(na.state.themeMode)}setTermsConditionsUrl(e){Ue.setTermsConditionsUrl(e)}setPrivacyPolicyUrl(e){Ue.setPrivacyPolicyUrl(e)}setThemeVariables(e){na.setThemeVariables(e),FTe(na.state.themeVariables)}subscribeTheme(e){return na.subscribe(e)}subscribeConnections(e){return this.remoteFeatures.multiWallet?nt.subscribe(e):(Fs.open(Be.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),()=>{})}getWalletInfo(e){var t,r;return e?(r=(t=ue.state.chains.get(e))==null?void 0:t.accountState)==null?void 0:r.connectedWalletInfo:_t.state.connectedWalletInfo}getAccount(e){const t=e||ue.state.activeChain,r=Ge.getAuthConnector(t),i=ue.getAccountData(t),s=wt.getConnectedConnectorId(ue.state.activeChain),o=nt.getConnections(t);if(!t)throw new Error("AppKit:getAccount - namespace is required");const a=o.flatMap(c=>c.accounts.map(({address:u,type:d})=>tt.createAccount(t,u,d||"eoa")));if(i)return{allAccounts:a,caipAddress:i.caipAddress,address:tt.getPlainAddress(i.caipAddress),isConnected:!!i.caipAddress,status:i.status,embeddedWalletInfo:r&&s===Be.CONNECTOR_ID.AUTH?{user:i.user?{...i.user,username:wt.getConnectedSocialUsername()}:void 0,authProvider:i.socialProvider||"email",accountType:Xs(t),isSmartAccountDeployed:!!i.smartAccountDeployed}:void 0}}subscribeAccount(e,t){const r=()=>{const i=this.getAccount(t);i&&e(i)};t?ue.subscribeChainProp("accountState",r,t):ue.subscribe(r),Ge.subscribe(r)}subscribeNetwork(e){return ue.subscribe(({activeCaipNetwork:t})=>{e({caipNetwork:t,chainId:t==null?void 0:t.id,caipNetworkId:t==null?void 0:t.caipNetworkId})})}subscribeWalletInfo(e,t){return t?_t.subscribeKey("connectedWalletInfo",e,t):_t.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){_t.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){ue.subscribeKey("activeCaipNetwork",e)}getState(){return Wd.state}getRemoteFeatures(){return Ue.state.remoteFeatures}subscribeState(e){return Wd.subscribe(e)}subscribeRemoteFeatures(e){return Ue.subscribeKey("remoteFeatures",e)}showErrorMessage(e){Ir.showError(e)}showSuccessMessage(e){Ir.showSuccess(e)}getEvent(){return{...xn.state}}subscribeEvents(e){return xn.subscribe(e)}replace(e){it.replace(e)}redirect(e){it.push(e)}popTransactionStack(e){it.popTransactionStack(e)}isOpen(){return Yn.state.open}isTransactionStackEmpty(){return it.state.transactionStack.length===0}static getInstance(){return this.instance}updateFeatures(e){Ue.setFeatures(e)}updateRemoteFeatures(e){Ue.setRemoteFeatures(e)}updateOptions(e){const r={...Ue.state||{},...e};Ue.setOptions(r)}setConnectMethodsOrder(e){Ue.setConnectMethodsOrder(e)}setWalletFeaturesOrder(e){Ue.setWalletFeaturesOrder(e)}setCollapseWallets(e){Ue.setCollapseWallets(e)}setSocialsOrder(e){Ue.setSocialsOrder(e)}getConnectMethodsOrder(){return Uf.getConnectOrderMethod(Ue.state.features,Ge.getConnectors())}addNetwork(e,t){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);const r=this.extendCaipNetwork(t,this.options);this.getCaipNetworks().find(i=>i.id===r.id)||ue.addNetwork(r)}removeNetwork(e,t){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);this.getCaipNetworks().find(i=>i.id===t)&&ue.removeNetwork(e,t)}}let AV=!1;class rIe extends nIe{async onAuthProviderConnected(e){e.message&&e.signature&&e.siwxMessage&&await al.addEmbeddedWalletSession({chainId:e.siwxMessage.chainId,accountAddress:e.address,notBefore:e.siwxMessage.notBefore,statement:e.siwxMessage.statement,resources:e.siwxMessage.resources,requestId:e.siwxMessage.requestId,issuedAt:e.siwxMessage.issuedAt,domain:e.siwxMessage.domain,uri:e.siwxMessage.uri,version:e.siwxMessage.version,nonce:e.siwxMessage.nonce},e.message,e.signature);const t=ue.state.activeChain;if(!t)throw new Error("AppKit:onAuthProviderConnected - namespace is required");const r=t===Be.CHAIN.EVM?`eip155:${e.chainId}:${e.address}`:`${e.chainId}:${e.address}`,i=Ue.state.defaultAccountTypes[t],s=Xs(t),o=e.preferredAccountType||s||i;xi.isLowerCaseMatch(e.address,_t.state.address)||this.syncIdentity({address:e.address,chainId:e.chainId,chainNamespace:t}),this.setCaipAddress(r,t);const{signature:a,siwxMessage:c,message:u,...d}=e;this.setUser({..._t.state.user||{},...d},t),this.setSmartAccountDeployed(!!e.smartAccountDeployed,t),this.setPreferredAccountType(o,t),this.setLoading(!1,t)}setupAuthConnectorListeners(e){e.onRpcRequest(t=>{Zl.checkIfRequestExists(t)?Zl.checkIfRequestIsSafe(t)||this.handleUnsafeRPCRequest():(this.open(),console.error(fi.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:t.method}),setTimeout(()=>{this.showErrorMessage(fi.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),e.rejectRpcRequests())}),e.onRpcError(()=>{this.isOpen()&&(this.isTransactionStackEmpty()?this.close():this.popTransactionStack("error"))}),e.onRpcSuccess((t,r)=>{const i=Zl.checkIfRequestIsSafe(r),s=_t.state.address,o=ue.state.activeCaipNetwork;
992i||(s&&(o!=null&&o.id)&&this.updateNativeBalance(s,o.id,o.chainNamespace),this.isTransactionStackEmpty()?this.close():this.popTransactionStack("success"))}),e.onNotConnected(()=>{const t=ue.state.activeChain;if(!t)throw new Error("AppKit:onNotConnected - namespace is required");Ge.getConnectorId(t)===Be.CONNECTOR_ID.AUTH&&(this.setCaipAddress(void 0,t),this.setLoading(!1,t))}),e.onConnect(this.onAuthProviderConnected.bind(this)),e.onSocialConnected(this.onAuthProviderConnected.bind(this)),e.onSetPreferredAccount(({address:t,type:r})=>{const i=ue.state.activeChain;if(!i)throw new Error("AppKit:onSetPreferredAccount - namespace is required");t&&this.setPreferredAccountType(r,i)})}async syncAuthConnectorTheme(e){if(!e)return;const t=na.getSnapshot(),r=Ue.getSnapshot();await Promise.all([e.syncDappData({metadata:r.metadata,sdkVersion:r.sdkVersion,projectId:r.projectId,sdkType:r.sdkType}),e.syncTheme({themeMode:t.themeMode,themeVariables:t.themeVariables,w3mThemeVariables:Xp(t.themeVariables,t.themeMode)})])}async syncAuthConnector(e,t){var u,d,f,m;const r=Be.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(t),i=t===ue.state.activeChain;if(!r)return;this.setLoading(!0,t);const s=e.getLoginEmailUsed();this.setLoading(s,t),s&&this.setStatus("connecting",t);const o=e.getEmail(),a=e.getUsername();this.setUser({...((u=_t.state)==null?void 0:u.user)||{},username:a,email:o},t),this.setupAuthConnectorListeners(e);const{isConnected:c}=await e.isConnected();if(await this.syncAuthConnectorTheme(e),t&&r&&i){const w=await e.getSmartAccountEnabledNetworks();ue.setSmartAccountEnabledNetworks((w==null?void 0:w.smartAccountEnabledNetworks)||[],t),c&&((d=this.connectionControllerClient)!=null&&d.connectExternal)?(await((m=this.connectionControllerClient)==null?void 0:m.connectExternal({id:Be.CONNECTOR_ID.AUTH,info:{name:Be.CONNECTOR_ID.AUTH},type:ss.CONNECTOR_TYPE_AUTH,provider:e,chainId:(f=ue.state.activeCaipNetwork)==null?void 0:f.id,chain:t})),this.setStatus("connected",t)):Ge.getConnectorId(t)===Be.CONNECTOR_ID.AUTH&&(this.setStatus("disconnected",t),wt.removeConnectedNamespace(t))}this.setLoading(!1,t)}async checkExistingTelegramSocialConnection(e){var t,r;try{if(!tt.isTelegram())return;const i=wt.getTelegramSocialProvider();if(!i||!tt.isClient())return;const o=new URL(window.location.href).searchParams.get("result_uri");if(!o)return;_t.setSocialProvider(i,e),await((t=this.authProvider)==null?void 0:t.init());const a=Ge.getAuthConnector();i&&a&&(this.setLoading(!0,e),await nt.connectExternal({id:a.id,type:a.type,socialUri:o},a.chain),wt.setConnectedSocialProvider(i),wt.removeTelegramSocialProvider(),xn.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:i,caipNetworkId:(r=ue.getActiveCaipNetwork())==null?void 0:r.caipNetworkId}}))}catch(i){this.setLoading(!1,e),console.error("checkExistingSTelegramocialConnection error",i)}try{const i=new URL(window.location.href);i.searchParams.delete("result_uri"),window.history.replaceState({},document.title,i.toString())}catch(i){console.error("tma social login failed",i)}}createAuthProvider(e){var u,d,f,m;if(!Be.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(e))return;const r=(u=this.remoteFeatures)==null?void 0:u.email,i=Array.isArray((d=this.remoteFeatures)==null?void 0:d.socials)&&this.remoteFeatures.socials.length>0,s=r||i,a=xi.getActiveNamespaceConnectedToAuth()||e;!this.authProvider&&((f=this.options)!=null&&f.projectId)&&s&&(this.authProvider=mS.getInstance({projectId:this.options.projectId,enableLogger:this.options.enableAuthLogger,chainId:(m=this.getCaipNetwork(a))==null?void 0:m.caipNetworkId,abortController:Qo.EmbeddedWalletAbortController,onTimeout:w=>{w==="iframe_load_failed"?Fs.open(Qo.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):w==="iframe_request_timeout"?Fs.open(Qo.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):w==="unverified_domain"&&Fs.open(Qo.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:w=>kD(w),getCaipNetworks:w=>ue.getCaipNetworks(w)}),Wd.subscribeOpen(w=>{var y;!w&&this.isTransactionStackEmpty()&&((y=this.authProvider)==null||y.rejectRpcRequests())}));const c=e===ue.state.activeChain&&Ue.state.enableReconnect;Ue.state.enableReconnect===!1?this.syncAuthConnectorTheme(this.authProvider):this.authProvider&&c&&(this.syncAuthConnector(this.authProvider,e),this.checkExistingTelegramSocialConnection(e))}createAuthProviderForAdapter(e){var t,r,i;this.createAuthProvider(e),this.authProvider&&((i=(r=(t=this.chainAdapters)==null?void 0:t[e])==null?void 0:r.setAuthProvider)==null||i.call(r,this.authProvider))}initControllers(e){super.initControllers(e),this.options.excludeWalletIds&&Ft.initializeExcludedWallets({ids:this.options.excludeWalletIds})}async switchCaipNetwork(e){var o,a;if(!e)return;const t=ue.state.activeChain,r=e.chainNamespace,i=this.getAddressByChainNamespace(r);if(r===t&&i){const c=this.getAdapter(r),u=Ii.getProvider(r),d=Ii.getProviderId(r);await(c==null?void 0:c.switchNetwork({caipNetwork:e,provider:u,providerType:d})),this.setCaipNetwork(e)}else{const u=Ii.getProviderId(t)===ss.CONNECTOR_TYPE_AUTH,d=Ii.getProviderId(r),f=d===ss.CONNECTOR_TYPE_AUTH,m=Be.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(r);if(!r)throw new Error("AppKit:switchCaipNetwork - networkNamespace is required");if((u&&d===void 0||f)&&m)try{if(ue.state.activeChain=e.chainNamespace,i){const w=this.getAdapter(r);await(w==null?void 0:w.switchNetwork({caipNetwork:e,provider:this.authProvider,providerType:d}))}else await((a=(o=this.connectionControllerClient)==null?void 0:o.connectExternal)==null?void 0:a.call(o,{id:Be.CONNECTOR_ID.AUTH,provider:this.authProvider,chain:r,chainId:e.id,type:ss.CONNECTOR_TYPE_AUTH,caipNetwork:e}));this.setCaipNetwork(e)}catch{const y=this.getAdapter(r);await(y==null?void 0:y.switchNetwork({caipNetwork:e,provider:this.authProvider,providerType:d}))}else if(d===ss.CONNECTOR_TYPE_WALLET_CONNECT){if(!ue.state.noAdapters){const w=this.getAdapter(r),y=Ii.getProvider(r),b=Ii.getProviderId(r);await(w==null?void 0:w.switchNetwork({caipNetwork:e,provider:y,providerType:b}))}this.setCaipNetwork(e),this.syncWalletConnectAccount()}else this.setCaipNetwork(e),i&&this.syncAccount({address:i,chainId:e.id,chainNamespace:r})}}async initialize(e){var t;await super.initialize(e),(t=this.chainNamespaces)==null||t.forEach(r=>{this.createAuthProviderForAdapter(r)}
992),await this.injectModalUi(),Wd.set({initialized:!0})}async syncIdentity({address:e,chainId:t,chainNamespace:r}){var o;const i=`${r}:${t}`,s=(o=this.caipNetworks)==null?void 0:o.find(a=>a.caipNetworkId===i);if(r!==Be.CHAIN.EVM||s!=null&&s.testnet){this.setProfileName(null,r),this.setProfileImage(null,r);return}try{const{name:a,avatar:c}=await this.fetchIdentity({address:e,caipNetworkId:i});this.setProfileName(a,r),this.setProfileImage(c,r)}catch{await this.syncReownName(e,r),t!==1&&this.setProfileImage(null,r)}}syncConnectedWalletInfo(e){const t=Ii.getProviderId(e);if(t===ss.CONNECTOR_TYPE_AUTH){const r=this.authProvider;if(r){const i=wt.getConnectedSocialProvider()??"email",s=r.getEmail()??r.getUsername();this.setConnectedWalletInfo({name:t,identifier:s,social:i},e)}}else super.syncConnectedWalletInfo(e)}async injectModalUi(){if(tt.isClient()&&!AV)try{const e={...sr.DEFAULT_FEATURES,...this.options.features},t=this.remoteFeatures;if(await this.loadModalComponents(e,t),tt.isClient()&&!document.querySelector("w3m-modal")){const i=document.createElement("w3m-modal");!Ue.state.disableAppend&&!Ue.state.enableEmbedded&&document.body.insertAdjacentElement("beforeend",i)}AV=!0}catch(e){console.error("Error injecting modal UI:",e)}}async loadModalComponents(e,t){if(!tt.isClient())return;const r=[];(t.email||t.socials&&t.socials.length>0)&&r.push(It(()=>import("./embedded-wallet-utQpmxu-.js"),[])),t.email&&r.push(It(()=>import("./email-C_TVSKW8.js"),[])),t.socials&&r.push(It(()=>import("./socials-DE6abImw.js"),[])),t.swaps&&t.swaps.length>0&&r.push(It(()=>import("./swaps-DXoOOAs0.js"),__vite__mapDeps([0,1]))),e.send&&r.push(It(()=>import("./send-DOZxm0pc.js"),__vite__mapDeps([2,1]))),e.receive&&r.push(It(()=>import("./receive-DtN_84n8.js"),[])),t.onramp&&t.onramp.length>0&&r.push(It(()=>import("./onramp-a61tqhgC.js"),[])),t.activity&&r.push(It(()=>import("./transactions-D0Ei2i9p.js"),[])),e.pay&&r.push(It(()=>import("./index-DmntDOKe.js"),[])),t.emailCapture&&r.push(It(()=>import("./ui-B17x4kg1.js"),__vite__mapDeps([3,4]))),await Promise.all([...r,It(()=>Promise.resolve().then(()=>fUe),void 0),It(()=>import("./w3m-modal-C0rl4EDy.js"),[])])}}const iIe="1.7.17";function sIe(n){return new rIe({...n,sdkVersion:tt.generateSdkVersion(n.adapters??[],"html",iIe)})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const H$=BigInt(0),j7=BigInt(1);function g1(n,e){if(typeof e!="boolean")throw new Error(n+" boolean expected, got "+e)}function AI(n){const e=n.toString(16);return e.length&1?"0"+e:e}function fne(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return n===""?H$:BigInt("0x"+n)}function eR(n){return fne(Jl(n))}function U_(n){return nu(n),fne(Jl(Uint8Array.from(n).reverse()))}function V$(n,e){return s1(n.toString(16).padStart(e*2,"0"))}function tR(n,e){return V$(n,e).reverse()}function Vs(n,e,t){let r;if(typeof e=="string")try{r=s1(e)}catch(s){throw new Error(n+" must be hex string or Uint8Array, cause: "+s)}else if(z1(e))r=Uint8Array.from(e);else throw new Error(n+" must be hex string or Uint8Array");const i=r.length;if(typeof t=="number"&&i!==t)throw new Error(n+" of length "+t+" expected, got "+i);return r}const _O=n=>typeof n=="bigint"&&H$<=n;function oIe(n,e,t){return _O(n)&&_O(e)&&_O(t)&&e<=n&&n<t}function T2(n,e,t,r){if(!oIe(e,t,r))throw new Error("expected valid "+n+": "+t+" <= n < "+r+", got "+e)}function aIe(n){let e;for(e=0;n>H$;n>>=j7,e+=1);return e}const nR=n=>(j7<<BigInt(n))-j7;function cIe(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");const r=w=>new Uint8Array(w),i=w=>Uint8Array.of(w);let s=r(n),o=r(n),a=0;const c=()=>{s.fill(1),o.fill(0),a=0},u=(...w)=>t(o,s,...w),d=(w=r(0))=>{o=u(i(0),w),s=u(),w.length!==0&&(o=u(i(1),w),s=u())},f=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const y=[];for(;w<e;){s=u();const b=s.slice();y.push(b),w+=s.length}return vo(...y)};return(w,y)=>{c(),d(w);let b;for(;!(b=y(f()));)d();return c(),b}}function qC(n,e,t={}){if(!n||typeof n!="object")throw new Error("expected valid options object");function r(i,s,o){const a=n[i];if(o&&a===void 0)return;const c=typeof a;if(c!==s||a===null)throw new Error(`param "${i}
992" is invalid: expected ${s}, got ${c}`)}Object.entries(e).forEach(([i,s])=>r(i,s,!1)),Object.entries(t).forEach(([i,s])=>r(i,s,!0))}function pN(n){const e=new WeakMap;return(t,...r)=>{const i=e.get(t);if(i!==void 0)return i;const s=n(t,...r);return e.set(t,s),s}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ul=BigInt(0),la=BigInt(1),ky=BigInt(2),lIe=BigInt(3),pne=BigInt(4),gne=BigInt(5),mne=BigInt(8);function Ks(n,e){const t=n%e;return t>=ul?t:e+t}function Ns(n,e,t){let r=n;for(;e-- >ul;)r*=r,r%=t;return r}function SV(n,e){if(n===ul)throw new Error("invert: expected non-zero number");if(e<=ul)throw new Error("invert: expected positive modulus, got "+e);let t=Ks(n,e),r=e,i=ul,s=la;for(;t!==ul;){const a=r/t,c=r%t,u=i-s*a;r=t,t=c,i=s,s=u}if(r!==la)throw new Error("invert: does not exist");return Ks(i,e)}function wne(n,e){const t=(n.ORDER+la)/pne,r=n.pow(e,t);if(!n.eql(n.sqr(r),e))throw new Error("Cannot find square root");return r}function uIe(n,e){const t=(n.ORDER-gne)/mne,r=n.mul(e,ky),i=n.pow(r,t),s=n.mul(e,i),o=n.mul(n.mul(s,ky),i),a=n.mul(s,n.sub(o,n.ONE));if(!n.eql(n.sqr(a),e))throw new Error("Cannot find square root");return a}function dIe(n){if(n<BigInt(3))throw new Error("sqrt is not defined for small field");let e=n-la,t=0;for(;e%ky===ul;)e/=ky,t++;let r=ky;const i=eE(n);for(;_V(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(t===1)return wne;let s=i.pow(r,e);const o=(e+la)/ky;return function(c,u){if(c.is0(u))return u;if(_V(c,u)!==1)throw new Error("Cannot find square root");let d=t,f=c.mul(c.ONE,s),m=c.pow(u,e),w=c.pow(u,o);for(;!c.eql(m,c.ONE);){if(c.is0(m))return c.ZERO;let y=1,b=c.sqr(m);for(;!c.eql(b,c.ONE);)if(y++,b=c.sqr(b),y===d)throw new Error("Cannot find square root");const E=la<<BigInt(d-y-1),T=c.pow(f,E);d=y,f=c.sqr(T),m=c.mul(m,f),w=c.mul(w,T)}return w}}function hIe(n){return n%pne===lIe?wne:n%mne===gne?uIe:dIe(n)}const fIe=(n,e)=>(Ks(n,e)&la)===la,pIe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function gIe(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},t=pIe.reduce((r,i)=>(r[i]="function",r),e);return qC(n,t),n}function mIe(n,e,t){if(t<ul)throw new Error("invalid exponent, negatives unsupported");if(t===ul)return n.ONE;if(t===la)return e;let r=n.ONE,i=e;for(;t>ul;)t&la&&(r=n.mul(r,i)),i=n.sqr(i),t>>=la;return r}function yne(n,e,t=!1){const r=new Array(e.length).fill(t?n.ZERO:void 0),i=e.reduce((o,a,c)=>n.is0(a)?o:(r[c]=o,n.mul(o,a)),n.ONE),s=n.inv(i);return e.reduceRight((o,a,c)=>n.is0(a)?o:(r[c]=n.mul(o,r[c]),n.mul(o,a)),s),r}function _V(n,e){const t=(n.ORDER-la)/ky,r=n.pow(e,t),i=n.eql(r,n.ONE),s=n.eql(r,n.ZERO),o=n.eql(r,n.neg(n.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function wIe(n,e){e!==void 0&&ax(e);const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function eE(n,e,t=!1,r={}){if(n<=ul)throw new Error("invalid field: expected ORDER > 0, got "+n);let i,s;if(typeof e=="object"&&e!=null){if(r.sqrt||t)throw new Error("cannot specify opts in two arguments");const d=e;d.BITS&&(i=d.BITS),d.sqrt&&(s=d.sqrt),typeof d.isLE=="boolean"&&(t=d.isLE)}else typeof e=="number"&&(i=e),r.sqrt&&(s=r.sqrt);const{nBitLength:o,nByteLength:a}=wIe(n,i);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const u=Object.freeze({ORDER:n,isLE:t,BITS:o,BYTES:a,MASK:nR(o),ZERO:ul,ONE:la,create:d=>Ks(d,n),isValid:d=>{if(typeof d!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof d);return ul<=d&&d<n},is0:d=>d===ul,isValidNot0:d=>!u.is0(d)&&u.isValid(d),isOdd:d=>(d&la)===la,neg:d=>Ks(-d,n),eql:(d,f)=>d===f,sqr:d=>Ks(d*d,n),add:(d,f)=>Ks(d+f,n),sub:(d,f)=>Ks(d-f,n),mul:(d,f)=>Ks(d*f,n),pow:(d,f)=>mIe(u,d,f),div:(d,f)=>Ks(d*SV(f,n),n),sqrN:d=>d*d,addN:(d,f)=>d+f,subN:(d,f)=>d-f,mulN:(d,f)=>d*f,inv:d=>SV(d,n),sqrt:s||(d=>(c||(c=hIe(n)),c(u,d))),toBytes:d=>t?tR(d,a):V$(d,a),fromBytes:d=>{if(d.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+d.length);return t?U_(d):eR(d)},invertBatch:d=>yne(u,d),cmov:(d,f,m)=>m?f:d});return Object.freeze(u)}function bne(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function vne(n){const e=bne(n);return e+Math.ceil(e/2)}function yIe(n,e,t=!1){const r=n.length,i=bne(e),s=vne(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=t?U_(n):eR(n),a=Ks(o,e-la)+la;return t?tR(a,i):V$(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wx=BigInt(0),Oy=BigInt(1);function CS(n,e){const t=e.negate();return n?t:e}function xne(n,e,t){const r=e==="pz"?o=>o.pz:o=>o.ez,i=yne(n.Fp,t.map(r));return t.map((o,a)=>o.toAffine(i[a])).map(n.fromAffine)}function Ene(n,e){if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+n)}function CO(n,e){Ene(n,e);const t=Math.ceil(e/n)+1,r=2**(n-1),i=2**n,s=nR(n),o=BigInt(n);return{windows:t,windowSize:r,mask:s,maxNumber:i,shiftBy:o}}function CV(n,e,t){const{windowSize:r,mask:i,maxNumber:s,shiftBy:o}=t;let a=Number(n&i),c=n>>o;a>r&&(a-=s,c+=Oy);const u=e*r,d=u+Math.abs(a)-1,f=a===0,m=a<0,w=e%2!==0;return{nextN:c,offset:d,isZero:f,isNeg:m,isNegF:w,offsetF:u}}function bIe(n,e){if(!Array.isArray(n))throw new Error("array expected");
vendor: 4,531 bytes, line 992
992n.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function vIe(n,e){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const TO=new WeakMap,Ane=new WeakMap;function IO(n){return Ane.get(n)||1}function TV(n){if(n!==wx)throw new Error("invalid wNAF")}function Sne(n,e){return{constTimeNegate:CS,hasPrecomputes(t){return IO(t)!==1},unsafeLadder(t,r,i=n.ZERO){let s=t;for(;r>wx;)r&Oy&&(i=i.add(s)),s=s.double(),r>>=Oy;return i},precomputeWindow(t,r){const{windows:i,windowSize:s}=CO(r,e),o=[];let a=t,c=a;for(let u=0;u<i;u++){c=a,o.push(c);for(let d=1;d<s;d++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(t,r,i){let s=n.ZERO,o=n.BASE;const a=CO(t,e);for(let c=0;c<a.windows;c++){const{nextN:u,offset:d,isZero:f,isNeg:m,isNegF:w,offsetF:y}=CV(i,c,a);i=u,f?o=o.add(CS(w,r[y])):s=s.add(CS(m,r[d]))}return TV(i),{p:s,f:o}},wNAFUnsafe(t,r,i,s=n.ZERO){const o=CO(t,e);for(let a=0;a<o.windows&&i!==wx;a++){const{nextN:c,offset:u,isZero:d,isNeg:f}=CV(i,a,o);if(i=c,!d){const m=r[u];s=s.add(f?m.negate():m)}}return TV(i),s},getPrecomputes(t,r,i){let s=TO.get(r);return s||(s=this.precomputeWindow(r,t),t!==1&&(typeof i=="function"&&(s=i(s)),TO.set(r,s))),s},wNAFCached(t,r,i){const s=IO(t);return this.wNAF(s,this.getPrecomputes(s,t,i),r)},wNAFCachedUnsafe(t,r,i,s){const o=IO(t);return o===1?this.unsafeLadder(t,r,s):this.wNAFUnsafe(o,this.getPrecomputes(o,t,i),r,s)},setWindowSize(t,r){Ene(r,e),Ane.set(t,r),TO.delete(t)}}}function xIe(n,e,t,r){let i=e,s=n.ZERO,o=n.ZERO;for(;t>wx||r>wx;)t&Oy&&(s=s.add(i)),r&Oy&&(o=o.add(i)),i=i.double(),t>>=Oy,r>>=Oy;return{p1:s,p2:o}}function _ne(n,e,t,r){bIe(t,n),vIe(r,e);const i=t.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=n.ZERO,a=aIe(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=nR(c),d=new Array(Number(u)+1).fill(o),f=Math.floor((e.BITS-1)/c)*c;let m=o;for(let w=f;w>=0;w-=c){d.fill(o);for(let b=0;b<s;b++){const E=r[b],T=Number(E>>BigInt(w)&u);d[T]=d[T].add(t[b])}let y=o;for(let b=d.length-1,E=o;b>0;b--)E=E.add(d[b]),y=y.add(E);if(m=m.add(y),w!==0)for(let b=0;b<c;b++)m=m.double()}return m}function IV(n,e){if(e){if(e.ORDER!==n)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return gIe(e),e}else return eE(n)}function Cne(n,e,t={}){if(!e||typeof e!="object")throw new Error(`expected valid ${n} CURVE object`);for(const a of["p","n","h"]){const c=e[a];if(!(typeof c=="bigint"&&c>wx))throw new Error(`CURVE.${a} must be positive bigint`)}const r=IV(e.p,t.Fp),i=IV(e.n,t.Fn),o=["Gx","Gy","a",n==="weierstrass"?"b":"d"];for(const a of o)if(!r.isValid(e[a]))throw new Error(`CURVE.${a} must be valid field element of CURVE.Fp`);return{Fp:r,Fn:i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const df=BigInt(0),hc=BigInt(1),NO=BigInt(2),EIe=BigInt(8),AIe={zip215:!0};function SIe(n,e,t,r){const i=n.sqr(t),s=n.sqr(r),o=n.add(n.mul(e.a,i),s),a=n.add(n.ONE,n.mul(e.d,n.mul(i,s)));return n.eql(o,a)}function _Ie(n,e={}){const{Fp:t,Fn:r}=Cne("edwards",n,e),{h:i,n:s}=n;qC(e,{},{uvRatio:"function"});const o=NO<<BigInt(r.BYTES*8)-hc,a=b=>t.create(b),c=e.uvRatio||((b,E)=>{try{return{isValid:!0,value:t.sqrt(t.div(b,E))}}catch{return{isValid:!1,value:df}}});if(!SIe(t,n,n.Gx,n.Gy))throw new Error("bad curve params: generator point");function u(b,E,T=!1){const N=T?hc:df;return T2("coordinate "+b,E,N,o),E}function d(b){if(!(b instanceof w))throw new Error("ExtendedPoint expected")}const f=pN((b,E)=>{const{ex:T,ey:N,ez:I}=b,H=b.is0();E==null&&(E=H?EIe:t.inv(I));const L=a(T*E),U=a(N*E),K=a(I*E);if(H)return{x:df,y:hc};if(K!==hc)throw new Error("invZ was invalid");return{x:L,y:U}}),m=pN(b=>{const{a:E,d:T}=n;if(b.is0())throw new Error("bad point: ZERO");const{ex:N,ey:I,ez:H,et:L}=b,U=a(N*N),K=a(I*I),Y=a(H*H),k=a(Y*Y),j=a(U*E),V=a(Y*a(j+K)),W=a(k+a(T*a(U*K)));if(V!==W)throw new Error("bad point: equation left != right (1)");const $=a(N*I),A=a(H*L);if($!==A)throw new Error("bad point: equation left != right (2)");return!0});class w{constructor(E,T,N,I){this.ex=u("x",E),this.ey=u("y",T),this.ez=u("z",N,!0),this.et=u("t",I),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(E){if(E instanceof w)throw new Error("extended point not allowed");const{x:T,y:N}=E||{};return u("x",T),u("y",N),new w(T,N,hc,a(T*N))}static normalizeZ(E){return xne(w,"ez",E)}static msm(E,T){return _ne(w,r,E,T)}
992_setWindowSize(E){this.precompute(E)}precompute(E=8,T=!0){return y.setWindowSize(this,E),T||this.multiply(NO),this}assertValidity(){m(this)}equals(E){d(E);const{ex:T,ey:N,ez:I}=this,{ex:H,ey:L,ez:U}=E,K=a(T*U),Y=a(H*I),k=a(N*U),j=a(L*I);return K===Y&&k===j}is0(){return this.equals(w.ZERO)}negate(){return new w(a(-this.ex),this.ey,this.ez,a(-this.et))}double(){const{a:E}=n,{ex:T,ey:N,ez:I}=this,H=a(T*T),L=a(N*N),U=a(NO*a(I*I)),K=a(E*H),Y=T+N,k=a(a(Y*Y)-H-L),j=K+L,V=j-U,W=K-L,$=a(k*V),A=a(j*W),_=a(k*W),R=a(V*j);return new w($,A,R,_)}add(E){d(E);const{a:T,d:N}=n,{ex:I,ey:H,ez:L,et:U}=this,{ex:K,ey:Y,ez:k,et:j}=E,V=a(I*K),W=a(H*Y),$=a(U*N*j),A=a(L*k),_=a((I+H)*(K+Y)-V-W),R=A-$,P=A+$,q=a(W-T*V),F=a(_*R),z=a(P*q),B=a(_*q),C=a(R*P);return new w(F,z,C,B)}subtract(E){return this.add(E.negate())}multiply(E){const T=E;T2("scalar",T,hc,s);const{p:N,f:I}=y.wNAFCached(this,T,w.normalizeZ);return w.normalizeZ([N,I])[0]}multiplyUnsafe(E,T=w.ZERO){const N=E;return T2("scalar",N,df,s),N===df?w.ZERO:this.is0()||N===hc?this:y.wNAFCachedUnsafe(this,N,w.normalizeZ,T)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}isTorsionFree(){return y.wNAFCachedUnsafe(this,s).is0()}toAffine(E){return f(this,E)}clearCofactor(){return i===hc?this:this.multiplyUnsafe(i)}static fromBytes(E,T=!1){return nu(E),this.fromHex(E,T)}static fromHex(E,T=!1){const{d:N,a:I}=n,H=t.BYTES;E=Vs("pointHex",E,H),g1("zip215",T);const L=E.slice(),U=E[H-1];L[H-1]=U&-129;const K=U_(L),Y=T?o:t.ORDER;T2("pointHex.y",K,df,Y);const k=a(K*K),j=a(k-hc),V=a(N*k-I);let{isValid:W,value:$}=c(j,V);if(!W)throw new Error("Point.fromHex: invalid y coordinate");const A=($&hc)===hc,_=(U&128)!==0;if(!T&&$===df&&_)throw new Error("Point.fromHex: x=0 and x_0=1");return _!==A&&($=a(-$)),w.fromAffine({x:$,y:K})}static fromPrivateScalar(E){return w.BASE.multiply(E)}toBytes(){const{x:E,y:T}=this.toAffine(),N=tR(T,t.BYTES);return N[N.length-1]|=E&hc?128:0,N}toRawBytes(){return this.toBytes()}toHex(){return Jl(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}w.BASE=new w(n.Gx,n.Gy,hc,a(n.Gx*n.Gy)),w.ZERO=new w(df,hc,hc,df),w.Fp=t,w.Fn=r;const y=Sne(w,r.BYTES*8);return w}function CIe(n,e){qC(e,{hash:"function"},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:t,hash:r}=e,{BASE:i,Fp:s,Fn:o}=n,a=o.ORDER,c=e.randomBytes||MC,u=e.adjustScalarBytes||(L=>L),d=e.domain||((L,U,K)=>{if(g1("phflag",K),U.length||K)throw new Error("Contexts/pre-hash are not supported");return L});function f(L){return o.create(L)}function m(L){return f(U_(L))}function w(L){const U=s.BYTES;L=Vs("private key",L,U);const K=Vs("hashed private key",r(L),2*U),Y=u(K.slice(0,U)),k=K.slice(U,2*U),j=m(Y);return{head:Y,prefix:k,scalar:j}}function y(L){const{head:U,prefix:K,scalar:Y}=w(L),k=i.multiply(Y),j=k.toBytes();return{head:U,prefix:K,scalar:Y,point:k,pointBytes:j}}function b(L){return y(L).pointBytes}function E(L=Uint8Array.of(),...U){const K=vo(...U);return m(r(d(K,Vs("context",L),!!t)))}function T(L,U,K={}){L=Vs("message",L),t&&(L=t(L));const{prefix:Y,scalar:k,pointBytes:j}=y(U),V=E(K.context,Y,L),W=i.multiply(V).toBytes(),$=E(K.context,W,j,L),A=f(V+$*k);T2("signature.s",A,df,a);const _=s.BYTES,R=vo(W,tR(A,_));return Vs("result",R,_*2)}const N=AIe;function I(L,U,K,Y=N){const{context:k,zip215:j}=Y,V=s.BYTES;L=Vs("signature",L,2*V),U=Vs("message",U),K=Vs("publicKey",K,V),j!==void 0&&g1("zip215",j),t&&(U=t(U));const W=U_(L.slice(V,2*V));let $,A,_;try{$=n.fromHex(K,j),A=n.fromHex(L.slice(0,V),j),_=i.multiplyUnsafe(W)}catch{return!1}if(!j&&$.isSmallOrder())return!1;const R=E(k,A.toBytes(),$.toBytes(),U);return A.add($.multiplyUnsafe(R)).subtract(_).clearCofactor().is0()}return i.precompute(8),{getPublicKey:b,sign:T,verify:I,utils:{getExtendedPublicKey:y,randomPrivateKey:()=>c(s.BYTES),precompute(L=8,U=n.BASE){return U.precompute(L,!1)}},Point:n}}function TIe(n){const e={a:n.a,d:n.d,p:n.Fp.ORDER,n:n.n,h:n.h,Gx:n.Gx,Gy:n.Gy},t=n.Fp,r=eE(e.n,n.nBitLength,!0),i={Fp:t,Fn:r,uvRatio:n.uvRatio},s={hash:n.hash,randomBytes:n.randomBytes,adjustScalarBytes:n.adjustScalarBytes,domain:n.domain,prehash:n.prehash,mapToCurve:n.mapToCurve};return{CURVE:e,curveOpts:i,eddsaOpts:s}}function IIe(n,e){return Object.assign({},e,{ExtendedPoint:e.Point,CURVE:n})}function NIe(n){const{CURVE:e,curveOpts:t,eddsaOpts:r}=TIe(n),i=_Ie(e,t),s=CIe(i,r);return IIe(n,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0);const RIe=BigInt(1),NV=BigInt(2);BigInt(3);const MIe=BigInt(5),kIe=BigInt(8),rR={p:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:kIe,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function OIe(n){const e=BigInt(10),t=BigInt(20),r=BigInt(40),i=BigInt(80),s=rR.p,a=n*n%s*n%s,c=Ns(a,NV,s)*a%s,u=Ns(c,RIe,s)*n%s,d=Ns(u,MIe,s)*u%s,f=Ns(d,e,s)*d%s,m=Ns(f,t,s)*f%s,w=Ns(m,r,s)*m%s,y=Ns(w,i,s)*w%s,b=Ns(y,i,s)*w%s,E=Ns(b,e,s)*d%s;return{pow_p_5_8:Ns(E,NV,s)*n%s,b2:a}}function PIe(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}const RV=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function DIe(n,e){const t=rR.p,r=Ks(e*e*e,t),i=Ks(r*r*e,t),s=OIe(n*i).pow_p_5_8;let o=Ks(n*r*s,t);const a=Ks(e*o*o,t),c=o,u=Ks(o*RV,t),d=a===n,f=a===Ks(-n,t),m=a===Ks(-n*RV,t);return d&&(o=c),(f||m)&&(o=u),fIe(o,t)&&(o=Ks(-o,t)),{isValid:d||f,value:o}}const BIe=eE(rR.p,void 0,!0),LIe={...rR,Fp:BIe,hash:rJ,adjustScalarBytes:PIe,uvRatio:DIe},KC=NIe(LIe);var b6={exports:{}},RO={},MV;function q$(){return MV||(MV=1,function(n){Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e={},t={};t.byteLength=d,t.toByteArray=m,t.fromByteArray=b;for(var r=[],i=[],s=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 25,762 bytes, lines 992-997
992+/",a=0,c=o.length;a<c;++a)r[a]=o[a],i[o.charCodeAt(a)]=a;i[45]=62,i[95]=63;function u(N){var I=N.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var H=N.indexOf("=");H===-1&&(H=I);var L=H===I?0:4-H%4;return[H,L]}function d(N){var I=u(N),H=I[0],L=I[1];return(H+L)*3/4-L}function f(N,I,H){return(I+H)*3/4-H}function m(N){var I,H=u(N),L=H[0],U=H[1],K=new s(f(N,L,U)),Y=0,k=U>0?L-4:L,j;for(j=0;j<k;j+=4)I=i[N.charCodeAt(j)]<<18|i[N.charCodeAt(j+1)]<<12|i[N.charCodeAt(j+2)]<<6|i[N.charCodeAt(j+3)],K[Y++]=I>>16&255,K[Y++]=I>>8&255,K[Y++]=I&255;return U===2&&(I=i[N.charCodeAt(j)]<<2|i[N.charCodeAt(j+1)]>>4,K[Y++]=I&255),U===1&&(I=i[N.charCodeAt(j)]<<10|i[N.charCodeAt(j+1)]<<4|i[N.charCodeAt(j+2)]>>2,K[Y++]=I>>8&255,K[Y++]=I&255),K}function w(N){return r[N>>18&63]+r[N>>12&63]+r[N>>6&63]+r[N&63]}function y(N,I,H){for(var L,U=[],K=I;K<H;K+=3)L=(N[K]<<16&16711680)+(N[K+1]<<8&65280)+(N[K+2]&255),U.push(w(L));return U.join("")}function b(N){for(var I,H=N.length,L=H%3,U=[],K=16383,Y=0,k=H-L;Y<k;Y+=K)U.push(y(N,Y,Y+K>k?k:Y+K));return L===1?(I=N[H-1],U.push(r[I>>2]+r[I<<4&63]+"==")):L===2&&(I=(N[H-2]<<8)+N[H-1],U.push(r[I>>10]+r[I>>4&63]+r[I<<2&63]+"=")),U.join("")}var E={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */E.read=function(N,I,H,L,U){var K,Y,k=U*8-L-1,j=(1<<k)-1,V=j>>1,W=-7,$=H?U-1:0,A=H?-1:1,_=N[I+$];for($+=A,K=_&(1<<-W)-1,_>>=-W,W+=k;W>0;K=K*256+N[I+$],$+=A,W-=8);for(Y=K&(1<<-W)-1,K>>=-W,W+=L;W>0;Y=Y*256+N[I+$],$+=A,W-=8);if(K===0)K=1-V;else{if(K===j)return Y?NaN:(_?-1:1)*(1/0);Y=Y+Math.pow(2,L),K=K-V}return(_?-1:1)*Y*Math.pow(2,K-L)},E.write=function(N,I,H,L,U,K){var Y,k,j,V=K*8-U-1,W=(1<<V)-1,$=W>>1,A=U===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=L?0:K-1,R=L?1:-1,P=I<0||I===0&&1/I<0?1:0;for(I=Math.abs(I),isNaN(I)||I===1/0?(k=isNaN(I)?1:0,Y=W):(Y=Math.floor(Math.log(I)/Math.LN2),I*(j=Math.pow(2,-Y))<1&&(Y--,j*=2),Y+$>=1?I+=A/j:I+=A*Math.pow(2,1-$),I*j>=2&&(Y++,j/=2),Y+$>=W?(k=0,Y=W):Y+$>=1?(k=(I*j-1)*Math.pow(2,U),Y=Y+$):(k=I*Math.pow(2,$-1)*Math.pow(2,U),Y=0));U>=8;N[H+_]=k&255,_+=R,k/=256,U-=8);for(Y=Y<<U|k,V+=U;V>0;N[H+_]=Y&255,_+=R,Y/=256,V-=8);N[H+_-R]|=P*128};/*! 993 * The buffer module from node.js, for the browser. 994 * 995 * @author Feross Aboukhadijeh <https://feross.org> 996 * @license MIT 997 */(function(N){const I=t,H=E,L=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;N.Buffer=W,N.SlowBuffer=M,N.INSPECT_MAX_BYTES=50;const U=2147483647;N.kMaxLength=U;const{Uint8Array:K,ArrayBuffer:Y,SharedArrayBuffer:k}=globalThis;W.TYPED_ARRAY_SUPPORT=j(),!W.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function j(){try{const de=new K(1),te={foo:function(){return 42}};return Object.setPrototypeOf(te,K.prototype),Object.setPrototypeOf(de,te),de.foo()===42}catch{return!1}}Object.defineProperty(W.prototype,"parent",{enumerable:!0,get:function(){if(W.isBuffer(this))return this.buffer}}),Object.defineProperty(W.prototype,"offset",{enumerable:!0,get:function(){if(W.isBuffer(this))return this.byteOffset}});function V(de){if(de>U)throw new RangeError('The value "'+de+'" is invalid for option "size"');const te=new K(de);return Object.setPrototypeOf(te,W.prototype),te}function W(de,te,re){if(typeof de=="number"){if(typeof te=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return R(de)}return $(de,te,re)}W.poolSize=8192;function $(de,te,re){if(typeof de=="string")return P(de,te);if(Y.isView(de))return F(de);if(de==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof de);if(vn(de,Y)||de&&vn(de.buffer,Y)||typeof k<"u"&&(vn(de,k)||de&&vn(de.buffer,k)))return z(de,te,re);if(typeof de=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ye=de.valueOf&&de.valueOf();if(ye!=null&&ye!==de)return W.from(ye,te,re);const Ce=B(de);if(Ce)return Ce;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof de[Symbol.toPrimitive]=="function")return W.from(de[Symbol.toPrimitive]("string"),te,re);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof de)}W.from=function(de,te,re){return $(de,te,re)},Object.setPrototypeOf(W.prototype,K.prototype),Object.setPrototypeOf(W,K);function A(de){if(typeof de!="number")throw new TypeError('"size" argument must be of type number');if(de<0)throw new RangeError('The value "'+de+'" is invalid for option "size"')}function _(de,te,re){return A(de),de<=0?V(de):te!==void 0?typeof re=="string"?V(de).fill(te,re):V(de).fill(te):V(de)}W.alloc=function(de,te,re){return _(de,te,re)};function R(de){return A(de),V(de<0?0:C(de)|0)}W.allocUnsafe=function(de){return R(de)},W.allocUnsafeSlow=function(de){return R(de)};function P(de,te){if((typeof te!="string"||te==="")&&(te="utf8"),!W.isEncoding(te))throw new TypeError("Unknown encoding: "+te);const re=Z(de,te)|0;let ye=V(re);const Ce=ye.write(de,te);return Ce!==re&&(ye=ye.slice(0,Ce)),ye}function q(de){const te=de.length<0?0:C(de.length)|0,re=V(te);for(let ye=0;ye<te;ye+=1)re[ye]=de[ye]&255;return re}function F(de){if(vn(de,K)){const te=new K(de);return z(te.buffer,te.byteOffset,te.byteLength)}return q(de)}function z(de,te,re){if(te<0||de.byteLength<te)throw new RangeError('"offset" is outside of buffer bounds');if(de.byteLength<te+(re||0))throw new RangeError('"length" is outside of buffer bounds');let ye;return te===void 0&&re===void 0?ye=new K(de):re===void 0?ye=new K(de,te):ye=new K(de,te,re),Object.setPrototypeOf(ye,W.prototype),ye}function B(de){if(W.isBuffer(de)){const te=C(de.length)|0,re=V(te);return re.length===0||de.copy(re,0,0,te),re}if(de.length!==void 0)return typeof de.length!="number"||Xn(de.length)?V(0):q(de);if(de.type==="Buffer"&&Array.isArray(de.data))return q(de.data)}function C(de){if(de>=U)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+U.toString(16)+" bytes");return de|0}function M(de){return+de!=de&&(de=0),W.alloc(+de)}W.isBuffer=function(te){return te!=null&&te._isBuffer===!0&&te!==W.prototype},W.compare=function(te,re){if(vn(te,K)&&(te=W.from(te,te.offset,te.byteLength)),vn(re,K)&&(re=W.from(re,re.offset,re.byteLength)),!W.isBuffer(te)||!W.isBuffer(re))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(te===re)return 0;let ye=te.length,Ce=re.length;for(let ke=0,Ye=Math.min(ye,Ce);ke<Ye;++ke)if(te[ke]!==re[ke]){ye=te[ke],Ce=re[ke];break}return ye<Ce?-1:Ce<ye?1:0},W.isEncoding=function(te){switch(String(te).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},W.concat=function(te,re){if(!Array.isArray(te))throw new TypeError('"list" argument must be an Array of Buffers');if(te.length===0)return W.alloc(0);let ye;if(re===void 0)for(re=0,ye=0;ye<te.length;++ye)re+=te[ye].length;const Ce=W.allocUnsafe(re);let ke=0;for(ye=0;ye<te.length;++ye){let Ye=te[ye];if(vn(Ye,K))ke+Ye.length>Ce.length?(W.isBuffer(Ye)||(Ye=W.from(Ye)),Ye.copy(Ce,ke)):K.prototype.set.call(Ce,Ye,ke);else if(W.isBuffer(Ye))Ye.copy(Ce,ke);else throw new TypeError('"list" argument must be an Array of Buffers');ke+=Ye.length}return Ce};function Z(de,te){if(W.isBuffer(de))return de.length;if(Y.isView(de)||vn(de,Y))return de.byteLength;if(typeof de!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof de);const re=de.length,ye=arguments.length>2&&arguments[2]===!0;if(!ye&&re===0)return 0;let Ce=!1;for(;;)switch(te){case"ascii":case"latin1":case"binary":return re;case"utf8":case"utf-8":return jt(de).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re*2;case"hex":return re>>>1;case"base64":return Ut(de).length;default:if(Ce)return ye?-1:jt(de).length;te=(""+te).toLowerCase(),Ce=!0}}W.byteLength=Z;function J(de,te,re){let ye=!1;if((te===void 0||te<0)&&(te=0),te>this.length||((re===void 0||re>this.length)&&(re=this.length),re<=0)||(re>>>=0,te>>>=0,re<=te))return"";for(de||(de="utf8");;)switch(de){case"hex":return Yt(this,te,re);case"utf8":case"utf-8":return ht(this,te,re);case"ascii":return Wt(this,te,re);case"latin1":case"binary":return yn(this,te,re);case"base64":return Fe(this,te,re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Jt(this,te,re);default:if(ye)throw new TypeError("Unknown encoding: "+de);de=(de+"").toLowerCase(),ye=!0}}W.prototype._isBuffer=!0;function ae(de,te,re){const ye=de[te];de[te]=de[re],de[re]=ye}W.prototype.swap16=function(){const te=this.length;if(te%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let re=0;re<te;re+=2)ae(this,re,re+1);return this},W.prototype.swap32=function(){const te=this.length;if(te%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let re=0;re<te;re+=4)ae(this,re,re+3),ae(this,re+1,re+2);return this},W.prototype.swap64=function(){const te=this.length;if(te%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let re=0;re<te;re+=8)ae(this,re,re+7),ae(this,re+1,re+6),ae(this,re+2,re+5),ae(this,re+3,re+4);return this},W.prototype.toString=function(){const te=this.length;return te===0?"":arguments.length===0?ht(this,0,te):J.apply(this,arguments)},W.prototype.toLocaleString=W.prototype.toString,W.prototype.equals=function(te){if(!W.isBuffer(te))throw new TypeError("Argument must be a Buffer");return this===te?!0:W.compare(this,te)===0},W.prototype.inspect=function(){let te="";const re=N.INSPECT_MAX_BYTES;return te=this.toString("hex",0,re).replace(/(.{2})/g,"$1 ").trim(),this.length>re&&(te+=" ... "),"<Buffer "+te+">"},L&&(W.prototype[L]=W.prototype.inspect),W.prototype.compare=function(te,re,ye,Ce,ke){if(vn(te,K)&&(te=W.from(te,te.offset,te.byteLength)),!W.isBuffer(te))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof te);if(re===void 0&&(re=0),ye===void 0&&(ye=te?te.length:0),Ce===void 0&&(Ce=0),ke===void 0&&(ke=this.length),re<0||ye>te.length||Ce<0||ke>this.length)throw new RangeError("out of range index");if(Ce>=ke&&re>=ye)return 0;if(Ce>=ke)return-1;if(re>=ye)return 1;if(re>>>=0,ye>>>=0,Ce>>>=0,ke>>>=0,this===te)return 0;let Ye=ke-Ce,Bn=ye-re;const Rn=Math.min(Ye,Bn),mn=this.slice(Ce,ke),or=te.slice(re,ye);for(let gn=0;gn<Rn;++gn)if(mn[gn]!==or[gn]){Ye=mn[gn],Bn=or[gn];break}return Ye<Bn?-1:Bn<Ye?1:0};function we(de,te,re,ye,Ce){if(de.length===0)return-1;if(typeof re=="string"?(ye=re,re=0):re>2147483647?re=2147483647:re<-2147483648&&(re=-2147483648),re=+re,Xn(re)&&(re=Ce?0:de.length-1),re<0&&(re=de.length+re),re>=de.length){if(Ce)return-1;re=de.length-1}else if(re<0)if(Ce)re=0;else return-1;if(typeof te=="string"&&(te=W.from(te,ye)),W.isBuffer(te))return te.length===0?-1:he(de,te,re,ye,Ce);if(typeof te=="number")return te=te&255,typeof K.prototype.indexOf=="function"?Ce?K.prototype.indexOf.call(de,te,re):K.prototype.lastIndexOf.call(de,te,re):he(de,[te],re,ye,Ce);throw new TypeError("val must be string, number or Buffer")}function he(de,te,re,ye,Ce){let ke=1,Ye=de.length,Bn=te.length;if(ye!==void 0&&(ye=String(ye).toLowerCase(),ye==="ucs2"||ye==="ucs-2"||ye==="utf16le"||ye==="utf-16le")){if(de.length<2||te.length<2)return-1;ke=2,Ye/=2,Bn/=2,re/=2}function Rn(or,gn){return ke===1?or[gn]:or.readUInt16BE(gn*ke)}let mn;if(Ce){let or=-1;for(mn=re;mn<Ye;mn++)if(Rn(de,mn)===Rn(te,or===-1?0:mn-or)){if(or===-1&&(or=mn),mn-or+1===Bn)return or*ke}else or!==-1&&(mn-=mn-or),or=-1}else for(re+Bn>Ye&&(re=Ye-Bn),mn=re;mn>=0;mn--){let or=!0;for(let gn=0;gn<Bn;gn++)if(Rn(de,mn+gn)!==Rn(te,gn)){or=!1;break}if(or)return mn}return-1}W.prototype.includes=function(te,re,ye){return this.indexOf(te,re,ye)!==-1},W.prototype.indexOf=function(te,re,ye){return we(this,te,re,ye,!0)},W.prototype.lastIndexOf=function(te,re,ye){return we(this,te,re,ye,!1)};function xe(de,te,re,ye){re=Number(re)||0;const Ce=de.length-re;ye?(ye=Number(ye),ye>Ce&&(ye=Ce)):ye=Ce;const ke=te.length;ye>ke/2&&(ye=ke/2);let Ye;for(Ye=0;Ye<ye;++Ye){const Bn=parseInt(te.substr(Ye*2,2),16);if(Xn(Bn))return Ye;de[re+Ye]=Bn}return Ye}function Se(de,te,re,ye){return _n(jt(te,de.length-re),de,re,ye)}function Re(de,te,re,ye){return _n(kt(te),de,re,ye)}function et(de,te,re,ye){return _n(Ut(te),de,re,ye)}function Me(de,te,re,ye){return _n(dn(te,de.length-re),de,re,ye)}W.prototype.write=function(te,re,ye,Ce){if(re===void 0)Ce="utf8",ye=this.length,re=0;else if(ye===void 0&&typeof re=="string")Ce=re,ye=this.length,re=0;else if(isFinite(re))re=re>>>0,isFinite(ye)?(ye=ye>>>0,Ce===void 0&&(Ce="utf8")):(Ce=ye,ye=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ke=this.length-re;if((ye===void 0||ye>ke)&&(ye=ke),te.length>0&&(ye<0||re<0)||re>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ce||(Ce="utf8");let Ye=!1;for(;;)switch(Ce){case"hex":return xe(this,te,re,ye);case"utf8":case"utf-8":return Se(this,te,re,ye);case"ascii":case"latin1":case"binary":return Re(this,te,re,ye);case"base64":return et(this,te,re,ye);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Me(this,te,re,ye);default:if(Ye)throw new TypeError("Unknown encoding: "+Ce);Ce=(""+Ce).toLowerCase(),Ye=!0}},W.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fe(de,te,re){return te===0&&re===de.length?I.fromByteArray(de):I.fromByteArray(de.slice(te,re))}function ht(de,te,re){re=Math.min(de.length,re);const ye=[];let Ce=te;for(;Ce<re;){const ke=de[Ce];let Ye=null,Bn=ke>239?4:ke>223?3:ke>191?2:1;if(Ce+Bn<=re){let Rn,mn,or,gn;switch(Bn){case 1:ke<128&&(Ye=ke);break;case 2:Rn=de[Ce+1],(Rn&192)===128&&(gn=(ke&31)<<6|Rn&63,gn>127&&(Ye=gn));break;case 3:Rn=de[Ce+1],mn=de[Ce+2],(Rn&192)===128&&(mn&192)===128&&(gn=(ke&15)<<12|(Rn&63)<<6|mn&63,gn>2047&&(gn<55296||gn>57343)&&(Ye=gn));break;case 4:Rn=de[Ce+1],mn=de[Ce+2],or=de[Ce+3],(Rn&192)===128&&(mn&192)===128&&(or&192)===128&&(gn=(ke&15)<<18|(Rn&63)<<12|(mn&63)<<6|or&63,gn>65535&&gn<1114112&&(Ye=gn))}}Ye===null?(Ye=65533,Bn=1):Ye>65535&&(Ye-=65536,ye.push(Ye>>>10&1023|55296),Ye=56320|Ye&1023),ye.push(Ye),Ce+=Bn}return At(ye)}const Dt=4096;function At(de){const te=de.length;if(te<=Dt)return String.fromCharCode.apply(String,de);let re="",ye=0;for(;ye<te;)re+=String.fromCharCode.apply(String,de.slice(ye,ye+=Dt));return re}function Wt(de,te,re){let ye="";re=Math.min(de.length,re);for(let Ce=te;Ce<re;++Ce)ye+=String.fromCharCode(de[Ce]&127);return ye}function yn(de,te,re){let ye="";re=Math.min(de.length,re);for(let Ce=te;Ce<re;++Ce)ye+=String.fromCharCode(de[Ce]);return ye}function Yt(de,te,re){const ye=de.length;(!te||te<0)&&(te=0),(!re||re<0||re>ye)&&(re=ye);let Ce="";for(let ke=te;ke<re;++ke)Ce+=kn[de[ke]];return Ce}function Jt(de,te,re){const ye=de.slice(te,re);let Ce="";for(let ke=0;ke<ye.length-1;ke+=2)Ce+=String.fromCharCode(ye[ke]+ye[ke+1]*256);return Ce}W.prototype.slice=function(te,re){const ye=this.length;te=~~te,re=re===void 0?ye:~~re,te<0?(te+=ye,te<0&&(te=0)):te>ye&&(te=ye),re<0?(re+=ye,re<0&&(re=0)):re>ye&&(re=ye),re<te&&(re=te);const Ce=this.subarray(te,re);return Object.setPrototypeOf(Ce,W.prototype),Ce};function bn(de,te,re){if(de%1!==0||de<0)throw new RangeError("offset is not uint");if(de+te>re)throw new RangeError("Trying to access beyond buffer length")}W.prototype.readUintLE=W.prototype.readUIntLE=function(te,re,ye){te=te>>>0,re=re>>>0,ye||bn(te,re,this.length);let Ce=this[te],ke=1,Ye=0;for(;++Ye<re&&(ke*=256);)Ce+=this[te+Ye]*ke;return Ce},W.prototype.readUintBE=W.prototype.readUIntBE=function(te,re,ye){te=te>>>0,re=re>>>0,ye||bn(te,re,this.length);let Ce=this[te+--re],ke=1;for(;re>0&&(ke*=256);)Ce+=this[te+--re]*ke;return Ce},W.prototype.readUint8=W.prototype.readUInt8=function(te,re){return te=te>>>0,re||bn(te,1,this.length),this[te]},W.prototype.readUint16LE=W.prototype.readUInt16LE=function(te,re){return te=te>>>0,re||bn(te,2,this.length),this[te]|this[te+1]<<8},W.prototype.readUint16BE=W.prototype.readUInt16BE=function(te,re){return te=te>>>0,re||bn(te,2,this.length),this[te]<<8|this[te+1]},W.prototype.readUint32LE=W.prototype.readUInt32LE=function(te,re){return te=te>>>0,re||bn(te,4,this.length),(this[te]|this[te+1]<<8|this[te+2]<<16)+this[te+3]*16777216},W.prototype.readUint32BE=W.prototype.readUInt32BE=function(te,re){return te=te>>>0,re||bn(te,4,this.length),this[te]*16777216+(this[te+1]<<16|this[te+2]<<8|this[te+3])},W.prototype.readBigUInt64LE=tr(function(te){te=te>>>0,Ee(te,"offset");const re=this[te],ye=this[te+7];(re===void 0||ye===void 0)&&Te(te,this.length-8);const Ce=re+this[++te]*2**8+this[++te]*2**16+this[++te]*2**24,ke=this[++te]+this[++te]*2**8+this[++te]*2**16+ye*2**24;return BigInt(Ce)+(BigInt(ke)<<BigInt(32))}),W.prototype.readBigUInt64BE=tr(function(te){te=te>>>0,Ee(te,"offset");const re=this[te],ye=this[te+7];(re===void 0||ye===void 0)&&Te(te,this.length-8);const Ce=re*2**24+this[++te]*2**16+this[++te]*2**8+this[++te],ke=this[++te]*2**24+this[++te]*2**16+this[++te]*2**8+ye;return(BigInt(Ce)<<BigInt(32))+BigInt(ke)}),W.prototype.readIntLE=function(te,re,ye){te=te>>>0,re=re>>>0,ye||bn(te,re,this.length);let Ce=this[te],ke=1,Ye=0;for(;++Ye<re&&(ke*=256);)Ce+=this[te+Ye]*ke;return ke*=128,Ce>=ke&&(Ce-=Math.pow(2,8*re)),Ce},W.prototype.readIntBE=function(te,re,ye){te=te>>>0,re=re>>>0,ye||bn(te,re,this.length);let Ce=re,ke=1,Ye=this[te+--Ce];for(;Ce>0&&(ke*=256);)Ye+=this[te+--Ce]*ke;return ke*=128,Ye>=ke&&(Ye-=Math.pow(2,8*re)),Ye},W.prototype.readInt8=function(te,re){return te=te>>>0,re||bn(te,1,this.length),this[te]&128?(255-this[te]+1)*-1:this[te]},W.prototype.readInt16LE=function(te,re){te=te>>>0,re||bn(te,2,this.length);const ye=this[te]|this[te+1]<<8;return ye&32768?ye|4294901760:ye},W.prototype.readInt16BE=function(te,re){te=te>>>0,re||bn(te,2,this.length);const ye=this[te+1]|this[te]<<8;return ye&32768?ye|4294901760:ye},W.prototype.readInt32LE=function(te,re){return te=te>>>0,re||bn(te,4,this.length),this[te]|this[te+1]<<8|this[te+2]<<16|this[te+3]<<24},W.prototype.readInt32BE=function(te,re){return te=te>>>0,re||bn(te,4,this.length),this[te]<<24|this[te+1]<<16|this[te+2]<<8|this[te+3]},W.prototype.readBigInt64LE=tr(function(te){te=te>>>0,Ee(te,"offset");const re=this[te],ye=this[te+7];(re===void 0||ye===void 0)&&Te(te,this.length-8);const Ce=this[te+4]+this[te+5]*2**8+this[te+6]*2**16+(ye<<24);return(BigInt(Ce)<<BigInt(32))+BigInt(re+this[++te]*2**8+this[++te]*2**16+this[++te]*2**24)}),W.prototype.readBigInt64BE=tr(function(te){te=te>>>0,Ee(te,"offset");const re=this[te],ye=this[te+7];(re===void 0||ye===void 0)&&Te(te,this.length-8);const Ce=(re<<24)+this[++te]*2**16+this[++te]*2**8+this[++te];return(BigInt(Ce)<<BigInt(32))+BigInt(this[++te]*2**24+this[++te]*2**16+this[++te]*2**8+ye)}),W.prototype.readFloatLE=function(te,re){return te=te>>>0,re||bn(te,4,this.length),H.read(this,te,!0,23,4)},W.prototype.readFloatBE=function(te,re){return te=te>>>0,re||bn(te,4,this.length),H.read(this,te,!1,23,4)},W.prototype.readDoubleLE=function(te,re){return te=te>>>0,re||bn(te,8,this.length),H.read(this,te,!0,52,8)},W.prototype.readDoubleBE=function(te,re){return te=te>>>0,re||bn(te,8,this.length),H.read(this,te,!1,52,8)};function Kt(de,te,re,ye,Ce,ke){if(!W.isBuffer(de))throw new TypeError('"buffer" argument must be a Buffer instance');if(te>Ce||te<ke)throw new RangeError('"value" argument is out of bounds');if(re+ye>de.length)throw new RangeError("Index out of range")}W.prototype.writeUintLE=W.prototype.writeUIntLE=function(te,re,ye,Ce){if(te=+te,re=re>>>0,ye=ye>>>0,!Ce){const Bn=Math.pow(2,8*ye)-1;Kt(this,te,re,ye,Bn,0)}let ke=1,Ye=0;for(this[re]=te&255;++Ye<ye&&(ke*=256);)this[re+Ye]=te/ke&255;return re+ye},W.prototype.writeUintBE=W.prototype.writeUIntBE=function(te,re,ye,Ce){if(te=+te,re=re>>>0,ye=ye>>>0,!Ce){const Bn=Math.pow(2,8*ye)-1;Kt(this,te,re,ye,Bn,0)}let ke=ye-1,Ye=1;for(this[re+ke]=te&255;--ke>=0&&(Ye*=256);)this[re+ke]=te/Ye&255;return re+ye},W.prototype.writeUint8=W.prototype.writeUInt8=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,1,255,0),this[re]=te&255,re+1},W.prototype.writeUint16LE=W.prototype.writeUInt16LE=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,2,65535,0),this[re]=te&255,this[re+1]=te>>>8,re+2},W.prototype.writeUint16BE=W.prototype.writeUInt16BE=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,2,65535,0),this[re]=te>>>8,this[re+1]=te&255,re+2},W.prototype.writeUint32LE=W.prototype.writeUInt32LE=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,4,4294967295,0),this[re+3]=te>>>24,this[re+2]=te>>>16,this[re+1]=te>>>8,this[re]=te&255,re+4},W.prototype.writeUint32BE=W.prototype.writeUInt32BE=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,4,4294967295,0),this[re]=te>>>24,this[re+1]=te>>>16,this[re+2]=te>>>8,this[re+3]=te&255,re+4};function En(de,te,re,ye,Ce){fe(te,ye,Ce,de,re,7);let ke=Number(te&BigInt(4294967295));de[re++]=ke,ke=ke>>8,de[re++]=ke,ke=ke>>8,de[re++]=ke,ke=ke>>8,de[re++]=ke;let Ye=Number(te>>BigInt(32)&BigInt(4294967295));return de[re++]=Ye,Ye=Ye>>8,de[re++]=Ye,Ye=Ye>>8,de[re++]=Ye,Ye=Ye>>8,de[re++]=Ye,re}function Xe(de,te,re,ye,Ce){fe(te,ye,Ce,de,re,7);let ke=Number(te&BigInt(4294967295));de[re+7]=ke,ke=ke>>8,de[re+6]=ke,ke=ke>>8,de[re+5]=ke,ke=ke>>8,de[re+4]=ke;let Ye=Number(te>>BigInt(32)&BigInt(4294967295));return de[re+3]=Ye,Ye=Ye>>8,de[re+2]=Ye,Ye=Ye>>8,de[re+1]=Ye,Ye=Ye>>8,de[re]=Ye,re+8}W.prototype.writeBigUInt64LE=tr(function(te,re=0){return En(this,te,re,BigInt(0),BigInt("0xffffffffffffffff"))}),W.prototype.writeBigUInt64BE=tr(function(te,re=0){return Xe(this,te,re,BigInt(0),BigInt("0xffffffffffffffff"))}),W.prototype.writeIntLE=function(te,re,ye,Ce){if(te=+te,re=re>>>0,!Ce){const Rn=Math.pow(2,8*ye-1);Kt(this,te,re,ye,Rn-1,-Rn)}let ke=0,Ye=1,Bn=0;for(this[re]=te&255;++ke<ye&&(Ye*=256);)te<0&&Bn===0&&this[re+ke-1]!==0&&(Bn=1),this[re+ke]=(te/Ye>>0)-Bn&255;return re+ye},W.prototype.writeIntBE=function(te,re,ye,Ce){if(te=+te,re=re>>>0,!Ce){const Rn=Math.pow(2,8*ye-1);Kt(this,te,re,ye,Rn-1,-Rn)}let ke=ye-1,Ye=1,Bn=0;for(this[re+ke]=te&255;--ke>=0&&(Ye*=256);)te<0&&Bn===0&&this[re+ke+1]!==0&&(Bn=1),this[re+ke]=(te/Ye>>0)-Bn&255;return re+ye},W.prototype.writeInt8=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,1,127,-128),te<0&&(te=255+te+1),this[re]=te&255,re+1},W.prototype.writeInt16LE=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,2,32767,-32768),this[re]=te&255,this[re+1]=te>>>8,re+2},W.prototype.writeInt16BE=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,2,32767,-32768),this[re]=te>>>8,this[re+1]=te&255,re+2},W.prototype.writeInt32LE=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,4,2147483647,-2147483648),this[re]=te&255,this[re+1]=te>>>8,this[re+2]=te>>>16,this[re+3]=te>>>24,re+4},W.prototype.writeInt32BE=function(te,re,ye){return te=+te,re=re>>>0,ye||Kt(this,te,re,4,2147483647,-2147483648),te<0&&(te=4294967295+te+1),this[re]=te>>>24,this[re+1]=te>>>16,this[re+2]=te>>>8,this[re+3]=te&255,re+4},W.prototype.writeBigInt64LE=tr(function(te,re=0){return En(this,te,re,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),W.prototype.writeBigInt64BE=tr(function(te,re=0){return Xe(this,te,re,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function at(de,te,re,ye,Ce,ke){if(re+ye>de.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("Index out of range")}function rt(de,te,re,ye,Ce){return te=+te,re=re>>>0,Ce||at(de,te,re,4),H.write(de,te,re,ye,23,4),re+4}W.prototype.writeFloatLE=function(te,re,ye){return rt(this,te,re,!0,ye)},W.prototype.writeFloatBE=function(te,re,ye){return rt(this,te,re,!1,ye)};function lt(de,te,re,ye,Ce){return te=+te,re=re>>>0,Ce||at(de,te,re,8),H.write(de,te,re,ye,52,8),re+8}W.prototype.writeDoubleLE=function(te,re,ye){return lt(this,te,re,!0,ye)},W.prototype.writeDoubleBE=function(te,re,ye){return lt(this,te,re,!1,ye)},W.prototype.copy=function(te,re,ye,Ce){if(!W.isBuffer(te))throw new TypeError("argument should be a Buffer");if(ye||(ye=0),!Ce&&Ce!==0&&(Ce=this.length),re>=te.length&&(re=te.length),re||(re=0),Ce>0&&Ce<ye&&(Ce=ye),Ce===ye||te.length===0||this.length===0)return 0;if(re<0)throw new RangeError("targetStart out of bounds");if(ye<0||ye>=this.length)throw new RangeError("Index out of range");if(Ce<0)throw new RangeError("sourceEnd out of bounds");Ce>this.length&&(Ce=this.length),te.length-re<Ce-ye&&(Ce=te.length-re+ye);const ke=Ce-ye;return this===te&&typeof K.prototype.copyWithin=="function"?this.copyWithin(re,ye,Ce):K.prototype.set.call(te,this.subarray(ye,Ce),re),ke},W.prototype.fill=function(te,re,ye,Ce){if(typeof te=="string"){if(typeof re=="string"?(Ce=re,re=0,ye=this.length):typeof ye=="string"&&(Ce=ye,ye=this.length),Ce!==void 0&&typeof Ce!="string")throw new TypeError("encoding must be a string");if(typeof Ce=="string"&&!W.isEncoding(Ce))throw new TypeError("Unknown encoding: "+Ce);if(te.length===1){const Ye=te.charCodeAt(0);(Ce==="utf8"&&Ye<128||Ce==="latin1")&&(te=Ye)}}else typeof te=="number"?te=te&255:typeof te=="boolean"&&(te=Number(te));if(re<0||this.length<re||this.length<ye)throw new RangeError("Out of range index");if(ye<=re)return this;re=re>>>0,ye=ye===void 0?this.length:ye>>>0,te||(te=0);let ke;if(typeof te=="number")for(ke=re;ke<ye;++ke)this[ke]=te;else{const Ye=W.isBuffer(te)?te:W.from(te,Ce),Bn=Ye.length;
vendor: 2,168 bytes, line 997
997if(Bn===0)throw new TypeError('The value "'+te+'" is invalid for argument "value"');for(ke=0;ke<ye-re;++ke)this[ke+re]=Ye[ke%Bn]}return this};const yt={};function oe(de,te,re){yt[de]=class extends re{constructor(){super(),Object.defineProperty(this,"message",{value:te.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${de}]`,this.stack,delete this.name}get code(){return de}set code(Ce){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ce,writable:!0})}toString(){return`${this.name} [${de}]: ${this.message}`}}}oe("ERR_BUFFER_OUT_OF_BOUNDS",function(de){return de?`${de} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),oe("ERR_INVALID_ARG_TYPE",function(de,te){return`The "${de}" argument must be of type number. Received type ${typeof te}`},TypeError),oe("ERR_OUT_OF_RANGE",function(de,te,re){let ye=`The value of "${de}" is out of range.`,Ce=re;return Number.isInteger(re)&&Math.abs(re)>2**32?Ce=Q(String(re)):typeof re=="bigint"&&(Ce=String(re),(re>BigInt(2)**BigInt(32)||re<-(BigInt(2)**BigInt(32)))&&(Ce=Q(Ce)),Ce+="n"),ye+=` It must be ${te}. Received ${Ce}`,ye},RangeError);function Q(de){let te="",re=de.length;const ye=de[0]==="-"?1:0;for(;re>=ye+4;re-=3)te=`_${de.slice(re-3,re)}${te}`;return`${de.slice(0,re)}${te}`}function ee(de,te,re){Ee(te,"offset"),(de[te]===void 0||de[te+re]===void 0)&&Te(te,de.length-(re+1))}function fe(de,te,re,ye,Ce,ke){if(de>re||de<te){const Ye=typeof te=="bigint"?"n":"";let Bn;throw te===0||te===BigInt(0)?Bn=`>= 0${Ye} and < 2${Ye} ** ${(ke+1)*8}${Ye}`:Bn=`>= -(2${Ye} ** ${(ke+1)*8-1}${Ye}) and < 2 ** ${(ke+1)*8-1}${Ye}`,new yt.ERR_OUT_OF_RANGE("value",Bn,de)}ee(ye,Ce,ke)}function Ee(de,te){if(typeof de!="number")throw new yt.ERR_INVALID_ARG_TYPE(te,"number",de)}function Te(de,te,re){throw Math.floor(de)!==de?(Ee(de,re),new yt.ERR_OUT_OF_RANGE("offset","an integer",de)):te<0?new yt.ERR_BUFFER_OUT_OF_BOUNDS:new yt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${te}`,de)}const De=/[^+/0-9A-Za-z-_]/g;function vt(de){if(de=de.split("=")[0],de=de.trim().replace(De,""),de.length<2)return"";for(;de.length%4!==0;)de=de+"=";return de}
vendor: 1,960 bytes, line 997
997function jt(de,te){te=te||1/0;let re;const ye=de.length;let Ce=null;const ke=[];for(let Ye=0;Ye<ye;++Ye){if(re=de.charCodeAt(Ye),re>55295&&re<57344){if(!Ce){if(re>56319){(te-=3)>-1&&ke.push(239,191,189);continue}else if(Ye+1===ye){(te-=3)>-1&&ke.push(239,191,189);continue}Ce=re;continue}if(re<56320){(te-=3)>-1&&ke.push(239,191,189),Ce=re;continue}re=(Ce-55296<<10|re-56320)+65536}else Ce&&(te-=3)>-1&&ke.push(239,191,189);if(Ce=null,re<128){if((te-=1)<0)break;ke.push(re)}else if(re<2048){if((te-=2)<0)break;ke.push(re>>6|192,re&63|128)}else if(re<65536){if((te-=3)<0)break;ke.push(re>>12|224,re>>6&63|128,re&63|128)}else if(re<1114112){if((te-=4)<0)break;ke.push(re>>18|240,re>>12&63|128,re>>6&63|128,re&63|128)}else throw new Error("Invalid code point")}return ke}function kt(de){const te=[];for(let re=0;re<de.length;++re)te.push(de.charCodeAt(re)&255);return te}function dn(de,te){let re,ye,Ce;const ke=[];for(let Ye=0;Ye<de.length&&!((te-=2)<0);++Ye)re=de.charCodeAt(Ye),ye=re>>8,Ce=re%256,ke.push(Ce),ke.push(ye);return ke}function Ut(de){return I.toByteArray(vt(de))}function _n(de,te,re,ye){let Ce;for(Ce=0;Ce<ye&&!(Ce+re>=te.length||Ce>=de.length);++Ce)te[Ce+re]=de[Ce];return Ce}function vn(de,te){return de instanceof te||de!=null&&de.constructor!=null&&de.constructor.name!=null&&de.constructor.name===te.name}function Xn(de){return de!==de}const kn=function(){const de="0123456789abcdef",te=new Array(256);for(let re=0;re<16;++re){const ye=re*16;for(let Ce=0;Ce<16;++Ce)te[ye+Ce]=de[re]+de[Ce]}return te}();function tr(de){return typeof BigInt>"u"?Cn:de}function Cn(){throw new Error("BigInt not supported")}})(e);const T=e.Buffer;n.Blob=e.Blob,n.BlobOptions=e.BlobOptions,n.Buffer=e.Buffer,n.File=e.File,n.FileOptions=e.FileOptions,n.INSPECT_MAX_BYTES=e.INSPECT_MAX_BYTES,n.SlowBuffer=e.SlowBuffer,n.TranscodeEncoding=e.TranscodeEncoding,n.atob=e.atob,n.btoa=e.btoa,n.constants=e.constants,n.default=T,n.isAscii=e.isAscii,n.isUtf8=e.isUtf8,n.kM
vendor: 58,864 bytes, line 997
997axLength=e.kMaxLength,n.kStringMaxLength=e.kStringMaxLength,n.resolveObjectURL=e.resolveObjectURL,n.transcode=e.transcode}(RO)),RO}var $Ie=b6.exports,kV;function Tne(){return kV||(kV=1,function(n){(function(e,t){function r($,A){if(!$)throw new Error(A||"Assertion failed")}function i($,A){$.super_=A;var _=function(){};_.prototype=A.prototype,$.prototype=new _,$.prototype.constructor=$}function s($,A,_){if(s.isBN($))return $;this.negative=0,this.words=null,this.length=0,this.red=null,$!==null&&((A==="le"||A==="be")&&(_=A,A=10),this._init($||0,A||10,_||"be"))}typeof e=="object"?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=q$().Buffer}catch{}s.isBN=function(A){return A instanceof s?!0:A!==null&&typeof A=="object"&&A.constructor.wordSize===s.wordSize&&Array.isArray(A.words)},s.max=function(A,_){return A.cmp(_)>0?A:_},s.min=function(A,_){return A.cmp(_)<0?A:_},s.prototype._init=function(A,_,R){if(typeof A=="number")return this._initNumber(A,_,R);if(typeof A=="object")return this._initArray(A,_,R);_==="hex"&&(_=16),r(_===(_|0)&&_>=2&&_<=36),A=A.toString().replace(/\s+/g,"");var P=0;A[0]==="-"&&(P++,this.negative=1),P<A.length&&(_===16?this._parseHex(A,P,R):(this._parseBase(A,_,P),R==="le"&&this._initArray(this.toArray(),_,R)))},s.prototype._initNumber=function(A,_,R){A<0&&(this.negative=1,A=-A),A<67108864?(this.words=[A&67108863],this.length=1):A<4503599627370496?(this.words=[A&67108863,A/67108864&67108863],this.length=2):(r(A<9007199254740992),this.words=[A&67108863,A/67108864&67108863,1],this.length=3),R==="le"&&this._initArray(this.toArray(),_,R)},s.prototype._initArray=function(A,_,R){if(r(typeof A.length=="number"),A.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(A.length/3),this.words=new Array(this.length);for(var P=0;P<this.length;P++)this.words[P]=0;var q,F,z=0;if(R==="be")for(P=A.length-1,q=0;P>=0;P-=3)F=A[P]|A[P-1]<<8|A[P-2]<<16,this.words[q]|=F<<z&67108863,this.words[q+1]=F>>>26-z&67108863,z+=24,z>=26&&(z-=26,q++);else if(R==="le")for(P=0,q=0;P<A.length;P+=3)F=A[P]|A[P+1]<<8|A[P+2]<<16,this.words[q]|=F<<z&67108863,this.words[q+1]=F>>>26-z&67108863,z+=24,z>=26&&(z-=26,q++);return this._strip()};function a($,A){var _=$.charCodeAt(A);if(_>=48&&_<=57)return _-48;if(_>=65&&_<=70)return _-55;if(_>=97&&_<=102)return _-87;r(!1,"Invalid character in "+$)}function c($,A,_){var R=a($,_);return _-1>=A&&(R|=a($,_-1)<<4),R}s.prototype._parseHex=function(A,_,R){this.length=Math.ceil((A.length-_)/6),this.words=new Array(this.length);for(var P=0;P<this.length;P++)this.words[P]=0;var q=0,F=0,z;if(R==="be")for(P=A.length-1;P>=_;P-=2)z=c(A,_,P)<<q,this.words[F]|=z&67108863,q>=18?(q-=18,F+=1,this.words[F]|=z>>>26):q+=8;else{var B=A.length-_;for(P=B%2===0?_+1:_;P<A.length;P+=2)z=c(A,_,P)<<q,this.words[F]|=z&67108863,q>=18?(q-=18,F+=1,this.words[F]|=z>>>26):q+=8}this._strip()};function u($,A,_,R){for(var P=0,q=0,F=Math.min($.length,_),z=A;z<F;z++){var B=$.charCodeAt(z)-48;P*=R,B>=49?q=B-49+10:B>=17?q=B-17+10:q=B,r(B>=0&&q<R,"Invalid character"),P+=q}return P}s.prototype._parseBase=function(A,_,R){this.words=[0],this.length=1;for(var P=0,q=1;q<=67108863;q*=_)P++;P--,q=q/_|0;for(var F=A.length-R,z=F%P,B=Math.min(F,F-z)+R,C=0,M=R;M<B;M+=P)C=u(A,M,M+P,_),this.imuln(q),this.words[0]+C<67108864?this.words[0]+=C:this._iaddn(C);if(z!==0){var Z=1;for(C=u(A,M,A.length,_),M=0;M<z;M++)Z*=_;this.imuln(Z),this.words[0]+C<67108864?this.words[0]+=C:this._iaddn(C)}this._strip()},s.prototype.copy=function(A){A.words=new Array(this.length);for(var _=0;_<this.length;_++)A.words[_]=this.words[_];A.length=this.length,A.negative=this.negative,A.red=this.red};function d($,A){$.words=A.words,$.length=A.length,$.negative=A.negative,$.red=A.red}if(s.prototype._move=function(A){d(A,this)},s.prototype.clone=function(){var A=new s(null);return this.copy(A),A},s.prototype._expand=function(A){for(;this.length<A;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(A,_){A=A||10,_=_|0||1;var R;if(A===16||A==="hex"){R="";for(var P=0,q=0,F=0;F<this.length;F++){var z=this.words[F],B=((z<<P|q)&16777215).toString(16);q=z>>>24-P&16777215,P+=2,P>=26&&(P-=26,F--),q!==0||F!==this.length-1?R=m[6-B.length]+B+R:R=B+R}for(q!==0&&(R=q.toString(16)+R);R.length%_!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}if(A===(A|0)&&A>=2&&A<=36){var C=w[A],M=y[A];R="";var Z=this.clone();for(Z.negative=0;!Z.isZero();){var J=Z.modrn(M).toString(A);Z=Z.idivn(M),Z.isZero()?R=J+R:R=m[C-J.length]+J+R}for(this.isZero()&&(R="0"+R);R.length%_!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var A=this.words[0];return this.length===2?A+=this.words[1]*67108864:this.length===3&&this.words[2]===1?A+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-A:A},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(A,_){return this.toArrayLike(o,A,_)}),s.prototype.toArray=function(A,_){return this.toArrayLike(Array,A,_)};var b=function(A,_){return A.allocUnsafe?A.allocUnsafe(_):new A(_)};s.prototype.toArrayLike=function(A,_,R){this._strip();var P=this.byteLength(),q=R||Math.max(1,P);r(P<=q,"byte array longer than desired length"),r(q>0,"Requested array length <= 0");var F=b(A,q),z=_==="le"?"LE":"BE";return this["_toArrayLike"+z](F,P),F},s.prototype._toArrayLikeLE=function(A,_){for(var R=0,P=0,q=0,F=0;q<this.length;q++){var z=this.words[q]<<F|P;A[R++]=z&255,R<A.length&&(A[R++]=z>>8&255),R<A.length&&(A[R++]=z>>16&255),F===6?(R<A.length&&(A[R++]=z>>24&255),P=0,F=0):(P=z>>>24,F+=2)}if(R<A.length)for(A[R++]=P;R<A.length;)A[R++]=0},s.prototype._toArrayLikeBE=function(A,_){for(var R=A.length-1,P=0,q=0,F=0;q<this.length;q++){var z=this.words[q]<<F|P;A[R--]=z&255,R>=0&&(A[R--]=z>>8&255),R>=0&&(A[R--]=z>>16&255),F===6?(R>=0&&(A[R--]=z>>24&255),P=0,F=0):(P=z>>>24,F+=2)}if(R>=0)for(A[R--]=P;R>=0;)A[R--]=0},Math.clz32?s.prototype._countBits=function(A){return 32-Math.clz32(A)}:s.prototype._countBits=function(A){var _=A,R=0;return _>=4096&&(R+=13,_>>>=13),_>=64&&(R+=7,_>>>=7),_>=8&&(R+=4,_>>>=4),_>=2&&(R+=2,_>>>=2),R+_},s.prototype._zeroBits=function(A){if(A===0)return 26;var _=A,R=0;return(_&8191)===0&&(R+=13,_>>>=13),(_&127)===0&&(R+=7,_>>>=7),(_&15)===0&&(R+=4,_>>>=4),(_&3)===0&&(R+=2,_>>>=2),(_&1)===0&&R++,R},s.prototype.bitLength=function(){var A=this.words[this.length-1],_=this._countBits(A);return(this.length-1)*26+_};function E($){for(var A=new Array($.bitLength()),_=0;_<A.length;_++){var R=_/26|0,P=_%26;A[_]=$.words[R]>>>P&1}return A}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var A=0,_=0;_<this.length;_++){var R=this._zeroBits(this.words[_]);if(A+=R,R!==26)break}return A},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(A){return this.negative!==0?this.abs().inotn(A).iaddn(1):this.clone()},s.prototype.fromTwos=function(A){return this.testn(A-1)?this.notn(A).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(A){for(;this.length<A.length;)this.words[this.length++]=0;for(var _=0;_<A.length;_++)this.words[_]=this.words[_]|A.words[_];return this._strip()},s.prototype.ior=function(A){return r((this.negative|A.negative)===0),this.iuor(A)},s.prototype.or=function(A){return this.length>A.length?this.clone().ior(A):A.clone().ior(this)},s.prototype.uor=function(A){return this.length>A.length?this.clone().iuor(A):A.clone().iuor(this)},s.prototype.iuand=function(A){var _;this.length>A.length?_=A:_=this;for(var R=0;R<_.length;R++)this.words[R]=this.words[R]&A.words[R];return this.length=_.length,this._strip()},s.prototype.iand=function(A){return r((this.negative|A.negative)===0),this.iuand(A)},s.prototype.and=function(A){return this.length>A.length?this.clone().iand(A):A.clone().iand(this)},s.prototype.uand=function(A){return this.length>A.length?this.clone().iuand(A):A.clone().iuand(this)},s.prototype.iuxor=function(A){var _,R;this.length>A.length?(_=this,R=A):(_=A,R=this);for(var P=0;P<R.length;P++)this.words[P]=_.words[P]^R.words[P];if(this!==_)for(;P<_.length;P++)this.words[P]=_.words[P];return this.length=_.length,this._strip()},s.prototype.ixor=function(A){return r((this.negative|A.negative)===0),this.iuxor(A)},s.prototype.xor=function(A){return this.length>A.length?this.clone().ixor(A):A.clone().ixor(this)},s.prototype.uxor=function(A){return this.length>A.length?this.clone().iuxor(A):A.clone().iuxor(this)},s.prototype.inotn=function(A){r(typeof A=="number"&&A>=0);var _=Math.ceil(A/26)|0,R=A%26;this._expand(_),R>0&&_--;for(var P=0;P<_;P++)this.words[P]=~this.words[P]&67108863;return R>0&&(this.words[P]=~this.words[P]&67108863>>26-R),this._strip()},s.prototype.notn=function(A){return this.clone().inotn(A)},s.prototype.setn=function(A,_){r(typeof A=="number"&&A>=0);var R=A/26|0,P=A%26;return this._expand(R+1),_?this.words[R]=this.words[R]|1<<P:this.words[R]=this.words[R]&~(1<<P),this._strip()},s.prototype.iadd=function(A){var _;if(this.negative!==0&&A.negative===0)return this.negative=0,_=this.isub(A),this.negative^=1,this._normSign();if(this.negative===0&&A.negative!==0)return A.negative=0,_=this.isub(A),A.negative=1,_._normSign();var R,P;this.length>A.length?(R=this,P=A):(R=A,P=this);for(var q=0,F=0;F<P.length;F++)_=(R.words[F]|0)+(P.words[F]|0)+q,this.words[F]=_&67108863,q=_>>>26;for(;q!==0&&F<R.length;F++)_=(R.words[F]|0)+q,this.words[F]=_&67108863,q=_>>>26;if(this.length=R.length,q!==0)this.words[this.length]=q,this.length++;else if(R!==this)for(;F<R.length;F++)this.words[F]=R.words[F];return this},s.prototype.add=function(A){var _;return A.negative!==0&&this.negative===0?(A.negative=0,_=this.sub(A),A.negative^=1,_):A.negative===0&&this.negative!==0?(this.negative=0,_=A.sub(this),this.negative=1,_):this.length>A.length?this.clone().iadd(A):A.clone().iadd(this)},s.prototype.isub=function(A){if(A.negative!==0){A.negative=0;var _=this.iadd(A);return A.negative=1,_._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(A),this.negative=1,this._normSign();var R=this.cmp(A);if(R===0)return this.negative=0,this.length=1,this.words[0]=0,this;var P,q;R>0?(P=this,q=A):(P=A,q=this);for(var F=0,z=0;z<q.length;z++)_=(P.words[z]|0)-(q.words[z]|0)+F,F=_>>26,this.words[z]=_&67108863;for(;F!==0&&z<P.length;z++)_=(P.words[z]|0)+F,F=_>>26,this.words[z]=_&67108863;if(F===0&&z<P.length&&P!==this)for(;z<P.length;z++)this.words[z]=P.words[z];return this.length=Math.max(this.length,z),P!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(A){return this.clone().isub(A)};function T($,A,_){_.negative=A.negative^$.negative;var R=$.length+A.length|0;_.length=R,R=R-1|0;var P=$.words[0]|0,q=A.words[0]|0,F=P*q,z=F&67108863,B=F/67108864|0;_.words[0]=z;for(var C=1;C<R;C++){for(var M=B>>>26,Z=B&67108863,J=Math.min(C,A.length-1),ae=Math.max(0,C-$.length+1);ae<=J;ae++){var we=C-ae|0;P=$.words[we]|0,q=A.words[ae]|0,F=P*q+Z,M+=F/67108864|0,Z=F&67108863}_.words[C]=Z|0,B=M|0}return B!==0?_.words[C]=B|0:_.length--,_._strip()}var N=function(A,_,R){var P=A.words,q=_.words,F=R.words,z=0,B,C,M,Z=P[0]|0,J=Z&8191,ae=Z>>>13,we=P[1]|0,he=we&8191,xe=we>>>13,Se=P[2]|0,Re=Se&8191,et=Se>>>13,Me=P[3]|0,Fe=Me&8191,ht=Me>>>13,Dt=P[4]|0,At=Dt&8191,Wt=Dt>>>13,yn=P[5]|0,Yt=yn&8191,Jt=yn>>>13,bn=P[6]|0,Kt=bn&8191,En=bn>>>13,Xe=P[7]|0,at=Xe&8191,rt=Xe>>>13,lt=P[8]|0,yt=lt&8191,oe=lt>>>13,Q=P[9]|0,ee=Q&8191,fe=Q>>>13,Ee=q[0]|0,Te=Ee&8191,De=Ee>>>13,vt=q[1]|0,jt=vt&8191,kt=vt>>>13,dn=q[2]|0,Ut=dn&8191,_n=dn>>>13,vn=q[3]|0,Xn=vn&8191,kn=vn>>>13,tr=q[4]|0,Cn=tr&8191,de=tr>>>13,te=q[5]|0,re=te&8191,ye=te>>>13,Ce=q[6]|0,ke=Ce&8191,Ye=Ce>>>13,Bn=q[7]|0,Rn=Bn&8191,mn=Bn>>>13,or=q[8]|0,gn=or&8191,Rr=or>>>13,ga=q[9]|0,Kr=ga&8191,Yr=ga>>>13;R.negative=A.negative^_.negative,R.length=19,B=Math.imul(J,Te),C=Math.imul(J,De),C=C+Math.imul(ae,Te)|0,M=Math.imul(ae,De);var ki=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(ki>>>26)|0,ki&=67108863,B=Math.imul(he,Te),C=Math.imul(he,De),C=C+Math.imul(xe,Te)|0,M=Math.imul(xe,De),B=B+Math.imul(J,jt)|0,C=C+Math.imul(J,kt)|0,C=C+Math.imul(ae,jt)|0,M=M+Math.imul(ae,kt)|0;var Sl=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(Sl>>>26)|0,Sl&=67108863,B=Math.imul(Re,Te),C=Math.imul(Re,De),C=C+Math.imul(et,Te)|0,M=Math.imul(et,De),B=B+Math.imul(he,jt)|0,C=C+Math.imul(he,kt)|0,C=C+Math.imul(xe,jt)|0,M=M+Math.imul(xe,kt)|0,B=B+Math.imul(J,Ut)|0,C=C+Math.imul(J,_n)|0,C=C+Math.imul(ae,Ut)|0,M=M+Math.imul(ae,_n)|0;var uu=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(uu>>>26)|0,uu&=67108863,B=Math.imul(Fe,Te),C=Math.imul(Fe,De),C=C+Math.imul(ht,Te)|0,M=Math.imul(ht,De),B=B+Math.imul(Re,jt)|0,C=C+Math.imul(Re,kt)|0,C=C+Math.imul(et,jt)|0,M=M+Math.imul(et,kt)|0,B=B+Math.imul(he,Ut)|0,C=C+Math.imul(he,_n)|0,C=C+Math.imul(xe,Ut)|0,M=M+Math.imul(xe,_n)|0,B=B+Math.imul(J,Xn)|0,C=C+Math.imul(J,kn)|0,C=C+Math.imul(ae,Xn)|0,M=M+Math.imul(ae,kn)|0;var ma=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(ma>>>26)|0,ma&=67108863,B=Math.imul(At,Te),C=Math.imul(At,De),C=C+Math.imul(Wt,Te)|0,M=Math.imul(Wt,De),B=B+Math.imul(Fe,jt)|0,C=C+Math.imul(Fe,kt)|0,C=C+Math.imul(ht,jt)|0,M=M+Math.imul(ht,kt)|0,B=B+Math.imul(Re,Ut)|0,C=C+Math.imul(Re,_n)|0,C=C+Math.imul(et,Ut)|0,M=M+Math.imul(et,_n)|0,B=B+Math.imul(he,Xn)|0,C=C+Math.imul(he,kn)|0,C=C+Math.imul(xe,Xn)|0,M=M+Math.imul(xe,kn)|0,B=B+Math.imul(J,Cn)|0,C=C+Math.imul(J,de)|0,C=C+Math.imul(ae,Cn)|0,M=M+Math.imul(ae,de)|0;var Ja=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(Ja>>>26)|0,Ja&=67108863,B=Math.imul(Yt,Te),C=Math.imul(Yt,De),C=C+Math.imul(Jt,Te)|0,M=Math.imul(Jt,De),B=B+Math.imul(At,jt)|0,C=C+Math.imul(At,kt)|0,C=C+Math.imul(Wt,jt)|0,M=M+Math.imul(Wt,kt)|0,B=B+Math.imul(Fe,Ut)|0,C=C+Math.imul(Fe,_n)|0,C=C+Math.imul(ht,Ut)|0,M=M+Math.imul(ht,_n)|0,B=B+Math.imul(Re,Xn)|0,C=C+Math.imul(Re,kn)|0,C=C+Math.imul(et,Xn)|0,M=M+Math.imul(et,kn)|0,B=B+Math.imul(he,Cn)|0,C=C+Math.imul(he,de)|0,C=C+Math.imul(xe,Cn)|0,M=M+Math.imul(xe,de)|0,B=B+Math.imul(J,re)|0,C=C+Math.imul(J,ye)|0,C=C+Math.imul(ae,re)|0,M=M+Math.imul(ae,ye)|0;var _l=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(_l>>>26)|0,_l&=67108863,B=Math.imul(Kt,Te),C=Math.imul(Kt,De),C=C+Math.imul(En,Te)|0,M=Math.imul(En,De),B=B+Math.imul(Yt,jt)|0,C=C+Math.imul(Yt,kt)|0,C=C+Math.imul(Jt,jt)|0,M=M+Math.imul(Jt,kt)|0,B=B+Math.imul(At,Ut)|0,C=C+Math.imul(At,_n)|0,C=C+Math.imul(Wt,Ut)|0,M=M+Math.imul(Wt,_n)|0,B=B+Math.imul(Fe,Xn)|0,C=C+Math.imul(Fe,kn)|0,C=C+Math.imul(ht,Xn)|0,M=M+Math.imul(ht,kn)|0,B=B+Math.imul(Re,Cn)|0,C=C+Math.imul(Re,de)|0,C=C+Math.imul(et,Cn)|0,M=M+Math.imul(et,de)|0,B=B+Math.imul(he,re)|0,C=C+Math.imul(he,ye)|0,C=C+Math.imul(xe,re)|0,M=M+Math.imul(xe,ye)|0,B=B+Math.imul(J,ke)|0,C=C+Math.imul(J,Ye)|0,C=C+Math.imul(ae,ke)|0,M=M+Math.imul(ae,Ye)|0;var sd=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(sd>>>26)|0,sd&=67108863,B=Math.imul(at,Te),C=Math.imul(at,De),C=C+Math.imul(rt,Te)|0,M=Math.imul(rt,De),B=B+Math.imul(Kt,jt)|0,C=C+Math.imul(Kt,kt)|0,C=C+Math.imul(En,jt)|0,M=M+Math.imul(En,kt)|0,B=B+Math.imul(Yt,Ut)|0,C=C+Math.imul(Yt,_n)|0,C=C+Math.imul(Jt,Ut)|0,M=M+Math.imul(Jt,_n)|0,B=B+Math.imul(At,Xn)|0,C=C+Math.imul(At,kn)|0,C=C+Math.imul(Wt,Xn)|0,M=M+Math.imul(Wt,kn)|0,B=B+Math.imul(Fe,Cn)|0,C=C+Math.imul(Fe,de)|0,C=C+Math.imul(ht,Cn)|0,M=M+Math.imul(ht,de)|0,B=B+Math.imul(Re,re)|0,C=C+Math.imul(Re,ye)|0,C=C+Math.imul(et,re)|0,M=M+Math.imul(et,ye)|0,B=B+Math.imul(he,ke)|0,C=C+Math.imul(he,Ye)|0,C=C+Math.imul(xe,ke)|0,M=M+Math.imul(xe,Ye)|0,B=B+Math.imul(J,Rn)|0,C=C+Math.imul(J,mn)|0,C=C+Math.imul(ae,Rn)|0,M=M+Math.imul(ae,mn)|0;var Cl=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(Cl>>>26)|0,Cl&=67108863,B=Math.imul(yt,Te),C=Math.imul(yt,De),C=C+Math.imul(oe,Te)|0,M=Math.imul(oe,De),B=B+Math.imul(at,jt)|0,C=C+Math.imul(at,kt)|0,C=C+Math.imul(rt,jt)|0,M=M+Math.imul(rt,kt)|0,B=B+Math.imul(Kt,Ut)|0,C=C+Math.imul(Kt,_n)|0,C=C+Math.imul(En,Ut)|0,M=M+Math.imul(En,_n)|0,B=B+Math.imul(Yt,Xn)|0,C=C+Math.imul(Yt,kn)|0,C=C+Math.imul(Jt,Xn)|0,M=M+Math.imul(Jt,kn)|0,B=B+Math.imul(At,Cn)|0,C=C+Math.imul(At,de)|0,C=C+Math.imul(Wt,Cn)|0,M=M+Math.imul(Wt,de)|0,B=B+Math.imul(Fe,re)|0,C=C+Math.imul(Fe,ye)|0,C=C+Math.imul(ht,re)|0,M=M+Math.imul(ht,ye)|0,B=B+Math.imul(Re,ke)|0,C=C+Math.imul(Re,Ye)|0,C=C+Math.imul(et,ke)|0,M=M+Math.imul(et,Ye)|0,B=B+Math.imul(he,Rn)|0,C=C+Math.imul(he,mn)|0,C=C+Math.imul(xe,Rn)|0,M=M+Math.imul(xe,mn)|0,B=B+Math.imul(J,gn)|0,C=C+Math.imul(J,Rr)|0,C=C+Math.imul(ae,gn)|0,M=M+Math.imul(ae,Rr)|0;var ep=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(ep>>>26)|0,ep&=67108863,B=Math.imul(ee,Te),C=Math.imul(ee,De),C=C+Math.imul(fe,Te)|0,M=Math.imul(fe,De),B=B+Math.imul(yt,jt)|0,C=C+Math.imul(yt,kt)|0,C=C+Math.imul(oe,jt)|0,M=M+Math.imul(oe,kt)|0,B=B+Math.imul(at,Ut)|0,C=C+Math.imul(at,_n)|0,C=C+Math.imul(rt,Ut)|0,M=M+Math.imul(rt,_n)|0,B=B+Math.imul(Kt,Xn)|0,C=C+Math.imul(Kt,kn)|0,C=C+Math.imul(En,Xn)|0,M=M+Math.imul(En,kn)|0,B=B+Math.imul(Yt,Cn)|0,C=C+Math.imul(Yt,de)|0,C=C+Math.imul(Jt,Cn)|0,M=M+Math.imul(Jt,de)|0,B=B+Math.imul(At,re)|0,C=C+Math.imul(At,ye)|0,C=C+Math.imul(Wt,re)|0,M=M+Math.imul(Wt,ye)|0,B=B+Math.imul(Fe,ke)|0,C=C+Math.imul(Fe,Ye)|0,C=C+Math.imul(ht,ke)|0,M=M+Math.imul(ht,Ye)|0,B=B+Math.imul(Re,Rn)|0,C=C+Math.imul(Re,mn)|0,C=C+Math.imul(et,Rn)|0,M=M+Math.imul(et,mn)|0,B=B+Math.imul(he,gn)|0,C=C+Math.imul(he,Rr)|0,C=C+Math.imul(xe,gn)|0,M=M+Math.imul(xe,Rr)|0,B=B+Math.imul(J,Kr)|0,C=C+Math.imul(J,Yr)|0,C=C+Math.imul(ae,Kr)|0,M=M+Math.imul(ae,Yr)|0;var ec=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(ec>>>26)|0,ec&=67108863,B=Math.imul(ee,jt),C=Math.imul(ee,kt),C=C+Math.imul(fe,jt)|0,M=Math.imul(fe,kt),B=B+Math.imul(yt,Ut)|0,C=C+Math.imul(yt,_n)|0,C=C+Math.imul(oe,Ut)|0,M=M+Math.imul(oe,_n)|0,B=B+Math.imul(at,Xn)|0,C=C+Math.imul(at,kn)|0,C=C+Math.imul(rt,Xn)|0,M=M+Math.imul(rt,kn)|0,B=B+Math.imul(Kt,Cn)|0,C=C+Math.imul(Kt,de)|0,C=C+Math.imul(En,Cn)|0,M=M+Math.imul(En,de)|0,B=B+Math.imul(Yt,re)|0,C=C+Math.imul(Yt,ye)|0,C=C+Math.imul(Jt,re)|0,M=M+Math.imul(Jt,ye)|0,B=B+Math.imul(At,ke)|0,C=C+Math.imul(At,Ye)|0,C=C+Math.imul(Wt,ke)|0,M=M+Math.imul(Wt,Ye)|0,B=B+Math.imul(Fe,Rn)|0,C=C+Math.imul(Fe,mn)|0,C=C+Math.imul(ht,Rn)|0,M=M+Math.imul(ht,mn)|0,B=B+Math.imul(Re,gn)|0,C=C+Math.imul(Re,Rr)|0,C=C+Math.imul(et,gn)|0,M=M+Math.imul(et,Rr)|0,B=B+Math.imul(he,Kr)|0,C=C+Math.imul(he,Yr)|0,C=C+Math.imul(xe,Kr)|0,M=M+Math.imul(xe,Yr)|0;var Tl=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(Tl>>>26)|0,Tl&=67108863,B=Math.imul(ee,Ut),C=Math.imul(ee,_n),C=C+Math.imul(fe,Ut)|0,M=Math.imul(fe,_n),B=B+Math.imul(yt,Xn)|0,C=C+Math.imul(yt,kn)|0,C=C+Math.imul(oe,Xn)|0,M=M+Math.imul(oe,kn)|0,B=B+Math.imul(at,Cn)|0,C=C+Math.imul(at,de)|0,C=C+Math.imul(rt,Cn)|0,M=M+Math.imul(rt,de)|0,B=B+Math.imul(Kt,re)|0,C=C+Math.imul(Kt,ye)|0,C=C+Math.imul(En,re)|0,M=M+Math.imul(En,ye)|0,B=B+Math.imul(Yt,ke)|0,C=C+Math.imul(Yt,Ye)|0,C=C+Math.imul(Jt,ke)|0,M=M+Math.imul(Jt,Ye)|0,B=B+Math.imul(At,Rn)|0,C=C+Math.imul(At,mn)|0,C=C+Math.imul(Wt,Rn)|0,M=M+Math.imul(Wt,mn)|0,B=B+Math.imul(Fe,gn)|0,C=C+Math.imul(Fe,Rr)|0,C=C+Math.imul(ht,gn)|0,M=M+Math.imul(ht,Rr)|0,B=B+Math.imul(Re,Kr)|0,C=C+Math.imul(Re,Yr)|0,C=C+Math.imul(et,Kr)|0,M=M+Math.imul(et,Yr)|0;var Ao=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(Ao>>>26)|0,Ao&=67108863,B=Math.imul(ee,Xn),C=Math.imul(ee,kn),C=C+Math.imul(fe,Xn)|0,M=Math.imul(fe,kn),B=B+Math.imul(yt,Cn)|0,C=C+Math.imul(yt,de)|0,C=C+Math.imul(oe,Cn)|0,M=M+Math.imul(oe,de)|0,B=B+Math.imul(at,re)|0,C=C+Math.imul(at,ye)|0,C=C+Math.imul(rt,re)|0,M=M+Math.imul(rt,ye)|0,B=B+Math.imul(Kt,ke)|0,C=C+Math.imul(Kt,Ye)|0,C=C+Math.imul(En,ke)|0,M=M+Math.imul(En,Ye)|0,B=B+Math.imul(Yt,Rn)|0,C=C+Math.imul(Yt,mn)|0,C=C+Math.imul(Jt,Rn)|0,M=M+Math.imul(Jt,mn)|0,B=B+Math.imul(At,gn)|0,C=C+Math.imul(At,Rr)|0,C=C+Math.imul(Wt,gn)|0,M=M+Math.imul(Wt,Rr)|0,B=B+Math.imul(Fe,Kr)|0,C=C+Math.imul(Fe,Yr)|0,C=C+Math.imul(ht,Kr)|0,M=M+Math.imul(ht,Yr)|0;var du=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(du>>>26)|0,du&=67108863,B=Math.imul(ee,Cn),C=Math.imul(ee,de),C=C+Math.imul(fe,Cn)|0,M=Math.imul(fe,de),B=B+Math.imul(yt,re)|0,C=C+Math.imul(yt,ye)|0,C=C+Math.imul(oe,re)|0,M=M+Math.imul(oe,ye)|0,B=B+Math.imul(at,ke)|0,C=C+Math.imul(at,Ye)|0,C=C+Math.imul(rt,ke)|0,M=M+Math.imul(rt,Ye)|0,B=B+Math.imul(Kt,Rn)|0,C=C+Math.imul(Kt,mn)|0,C=C+Math.imul(En,Rn)|0,M=M+Math.imul(En,mn)|0,B=B+Math.imul(Yt,gn)|0,C=C+Math.imul(Yt,Rr)|0,C=C+Math.imul(Jt,gn)|0,M=M+Math.imul(Jt,Rr)|0,B=B+Math.imul(At,Kr)|0,C=C+Math.imul(At,Yr)|0,C=C+Math.imul(Wt,Kr)|0,M=M+Math.imul(Wt,Yr)|0;var od=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(od>>>26)|0,od&=67108863,B=Math.imul(ee,re),C=Math.imul(ee,ye),C=C+Math.imul(fe,re)|0,M=Math.imul(fe,ye),B=B+Math.imul(yt,ke)|0,C=C+Math.imul(yt,Ye)|0,C=C+Math.imul(oe,ke)|0,M=M+Math.imul(oe,Ye)|0,B=B+Math.imul(at,Rn)|0,C=C+Math.imul(at,mn)|0,C=C+Math.imul(rt,Rn)|0,M=M+Math.imul(rt,mn)|0,B=B+Math.imul(Kt,gn)|0,C=C+Math.imul(Kt,Rr)|0,C=C+Math.imul(En,gn)|0,M=M+Math.imul(En,Rr)|0,B=B+Math.imul(Yt,Kr)|0,C=C+Math.imul(Yt,Yr)|0,C=C+Math.imul(Jt,Kr)|0,M=M+Math.imul(Jt,Yr)|0;var Mc=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(Mc>>>26)|0,Mc&=67108863,B=Math.imul(ee,ke),C=Math.imul(ee,Ye),C=C+Math.imul(fe,ke)|0,M=Math.imul(fe,Ye),B=B+Math.imul(yt,Rn)|0,C=C+Math.imul(yt,mn)|0,C=C+Math.imul(oe,Rn)|0,M=M+Math.imul(oe,mn)|0,B=B+Math.imul(at,gn)|0,C=C+Math.imul(at,Rr)|0,C=C+Math.imul(rt,gn)|0,M=M+Math.imul(rt,Rr)|0,B=B+Math.imul(Kt,Kr)|0,C=C+Math.imul(Kt,Yr)|0,C=C+Math.imul(En,Kr)|0,M=M+Math.imul(En,Yr)|0;var ad=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(ad>>>26)|0,ad&=67108863,B=Math.imul(ee,Rn),C=Math.imul(ee,mn),C=C+Math.imul(fe,Rn)|0,M=Math.imul(fe,mn),B=B+Math.imul(yt,gn)|0,C=C+Math.imul(yt,Rr)|0,C=C+Math.imul(oe,gn)|0,M=M+Math.imul(oe,Rr)|0,B=B+Math.imul(at,Kr)|0,C=C+Math.imul(at,Yr)|0,C=C+Math.imul(rt,Kr)|0,M=M+Math.imul(rt,Yr)|0;var cd=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(cd>>>26)|0,cd&=67108863,B=Math.imul(ee,gn),C=Math.imul(ee,Rr),C=C+Math.imul(fe,gn)|0,M=Math.imul(fe,Rr),B=B+Math.imul(yt,Kr)|0,C=C+Math.imul(yt,Yr)|0,C=C+Math.imul(oe,Kr)|0,M=M+Math.imul(oe,Yr)|0;var tp=(z+B|0)+((C&8191)<<13)|0;z=(M+(C>>>13)|0)+(tp>>>26)|0,tp&=67108863,B=Math.imul(ee,Kr),C=Math.imul(ee,Yr),C=C+Math.imul(fe,Kr)|0,M=Math.imul(fe,Yr);var ld=(z+B|0)+((C&8191)<<13)|0;return z=(M+(C>>>13)|0)+(ld>>>26)|0,ld&=67108863,F[0]=ki,F[1]=Sl,F[2]=uu,F[3]=ma,F[4]=Ja,F[5]=_l,F[6]=sd,F[7]=Cl,F[8]=ep,F[9]=ec,F[10]=Tl,F[11]=Ao,F[12]=du,F[13]=od,F[14]=Mc,F[15]=ad,F[16]=cd,F[17]=tp,F[18]=ld,z!==0&&(F[19]=z,R.length++),R};Math.imul||(N=T);function I($,A,_){_.negative=A.negative^$.negative,_.length=$.length+A.length;for(var R=0,P=0,q=0;q<_.length-1;q++){var F=P;P=0;for(var z=R&67108863,B=Math.min(q,A.length-1),C=Math.max(0,q-$.length+1);C<=B;C++){var M=q-C,Z=$.words[M]|0,J=A.words[C]|0,ae=Z*J,we=ae&67108863;F=F+(ae/67108864|0)|0,we=we+z|0,z=we&67108863,F=F+(we>>>26)|0,P+=F>>>26,F&=67108863}_.words[q]=z,R=F,F=P}return R!==0?_.words[q]=R:_.length--,_._strip()}function H($,A,_){return I($,A,_)}s.prototype.mulTo=function(A,_){var R,P=this.length+A.length;return this.length===10&&A.length===10?R=N(this,A,_):P<63?R=T(this,A,_):P<1024?R=I(this,A,_):R=H(this,A,_),R},s.prototype.mul=function(A){var _=new s(null);return _.words=new Array(this.length+A.length),this.mulTo(A,_)},s.prototype.mulf=function(A){var _=new s(null);return _.words=new Array(this.length+A.length),H(this,A,_)},s.prototype.imul=function(A){return this.clone().mulTo(A,this)},s.prototype.imuln=function(A){var _=A<0;_&&(A=-A),r(typeof A=="number"),r(A<67108864);for(var R=0,P=0;P<this.length;P++){var q=(this.words[P]|0)*A,F=(q&67108863)+(R&67108863);R>>=26,R+=q/67108864|0,R+=F>>>26,this.words[P]=F&67108863}return R!==0&&(this.words[P]=R,this.length++),this.length=A===0?1:this.length,_?this.ineg():this},s.prototype.muln=function(A){return this.clone().imuln(A)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(A){var _=E(A);if(_.length===0)return new s(1);for(var R=this,P=0;P<_.length&&_[P]===0;P++,R=R.sqr());if(++P<_.length)for(var q=R.sqr();P<_.length;P++,q=q.sqr())_[P]!==0&&(R=R.mul(q));return R},s.prototype.iushln=function(A){r(typeof A=="number"&&A>=0);var _=A%26,R=(A-_)/26,P=67108863>>>26-_<<26-_,q;if(_!==0){var F=0;for(q=0;q<this.length;q++){var z=this.words[q]&P,B=(this.words[q]|0)-z<<_;this.words[q]=B|F,F=z>>>26-_}F&&(this.words[q]=F,this.length++)}if(R!==0){for(q=this.length-1;q>=0;q--)this.words[q+R]=this.words[q];for(q=0;q<R;q++)this.words[q]=0;this.length+=R}return this._strip()},s.prototype.ishln=function(A){return r(this.negative===0),this.iushln(A)},s.prototype.iushrn=function(A,_,R){r(typeof A=="number"&&A>=0);var P;_?P=(_-_%26)/26:P=0;var q=A%26,F=Math.min((A-q)/26,this.length),z=67108863^67108863>>>q<<q,B=R;if(P-=F,P=Math.max(0,P),B){for(var C=0;C<F;C++)B.words[C]=this.words[C];B.length=F}if(F!==0)if(this.length>F)for(this.length-=F,C=0;C<this.length;C++)this.words[C]=this.words[C+F];else this.words[0]=0,this.length=1;var M=0;for(C=this.length-1;C>=0&&(M!==0||C>=P);C--){var Z=this.words[C]|0;this.words[C]=M<<26-q|Z>>>q,M=Z&z}return B&&M!==0&&(B.words[B.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(A,_,R){return r(this.negative===0),this.iushrn(A,_,R)},s.prototype.shln=function(A){return this.clone().ishln(A)},s.prototype.ushln=function(A){return this.clone().iushln(A)},s.prototype.shrn=function(A){return this.clone().ishrn(A)},s.prototype.ushrn=function(A){return this.clone().iushrn(A)},s.prototype.testn=function(A){r(typeof A=="number"&&A>=0);var _=A%26,R=(A-_)/26,P=1<<_;if(this.length<=R)return!1;var q=this.words[R];return!!(q&P)},s.prototype.imaskn=function(A){r(typeof A=="number"&&A>=0);var _=A%26,R=(A-_)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=R)return this;if(_!==0&&R++,this.length=Math.min(R,this.length),_!==0){var P=67108863^67108863>>>_<<_;this.words[this.length-1]&=P}return this._strip()},s.prototype.maskn=function(A){return this.clone().imaskn(A)},s.prototype.iaddn=function(A){return r(typeof A=="number"),r(A<67108864),A<0?this.isubn(-A):this.negative!==0?this.length===1&&(this.words[0]|0)<=A?(this.words[0]=A-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(A),this.negative=1,this):this._iaddn(A)},s.prototype._iaddn=function(A){this.words[0]+=A;for(var _=0;_<this.length&&this.words[_]>=67108864;_++)this.words[_]-=67108864,_===this.length-1?this.words[_+1]=1:this.words[_+1]++;return this.length=Math.max(this.length,_+1),this},s.prototype.isubn=function(A){if(r(typeof A=="number"),r(A<67108864),A<0)return this.iaddn(-A);if(this.negative!==0)return this.negative=0,this.iaddn(A),this.negative=1,this;if(this.words[0]-=A,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var _=0;_<this.length&&this.words[_]<0;_++)this.words[_]+=67108864,this.words[_+1]-=1;return this._strip()},s.prototype.addn=function(A){return this.clone().iaddn(A)},s.prototype.subn=function(A){return this.clone().isubn(A)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(A,_,R){var P=A.length+R,q;this._expand(P);var F,z=0;for(q=0;q<A.length;q++){F=(this.words[q+R]|0)+z;var B=(A.words[q]|0)*_;F-=B&67108863,z=(F>>26)-(B/67108864|0),this.words[q+R]=F&67108863}for(;q<this.length-R;q++)F=(this.words[q+R]|0)+z,z=F>>26,this.words[q+R]=F&67108863;if(z===0)return this._strip();for(r(z===-1),z=0,q=0;q<this.length;q++)F=-(this.words[q]|0)+z,z=F>>26,this.words[q]=F&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(A,_){var R=this.length-A.length,P=this.clone(),q=A,F=q.words[q.length-1]|0,z=this._countBits(F);R=26-z,R!==0&&(q=q.ushln(R),P.iushln(R),F=q.words[q.length-1]|0);var B=P.length-q.length,C;if(_!=="mod"){C=new s(null),C.length=B+1,C.words=new Array(C.length);for(var M=0;M<C.length;M++)C.words[M]=0}var Z=P.clone()._ishlnsubmul(q,1,B);Z.negative===0&&(P=Z,C&&(C.words[B]=1));for(var J=B-1;J>=0;J--){var ae=(P.words[q.length+J]|0)*67108864+(P.words[q.length+J-1]|0);for(ae=Math.min(ae/F|0,67108863),P._ishlnsubmul(q,ae,J);P.negative!==0;)ae--,P.negative=0,P._ishlnsubmul(q,1,J),P.isZero()||(P.negative^=1);C&&(C.words[J]=ae)}return C&&C._strip(),P._strip(),_!=="div"&&R!==0&&P.iushrn(R),{div:C||null,mod:P}},s.prototype.divmod=function(A,_,R){if(r(!A.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var P,q,F;return this.negative!==0&&A.negative===0?(F=this.neg().divmod(A,_),_!=="mod"&&(P=F.div.neg()),_!=="div"&&(q=F.mod.neg(),R&&q.negative!==0&&q.iadd(A)),{div:P,mod:q}):this.negative===0&&A.negative!==0?(F=this.divmod(A.neg(),_),_!=="mod"&&(P=F.div.neg()),{div:P,mod:F.mod}):(this.negative&A.negative)!==0?(F=this.neg().divmod(A.neg(),_),_!=="div"&&(q=F.mod.neg(),R&&q.negative!==0&&q.isub(A)),{div:F.div,mod:q}):A.length>this.length||this.cmp(A)<0?{div:new s(0),mod:this}:A.length===1?_==="div"?{div:this.divn(A.words[0]),mod:null}:_==="mod"?{div:null,mod:new s(this.modrn(A.words[0]))}:{div:this.divn(A.words[0]),mod:new s(this.modrn(A.words[0]))}:this._wordDiv(A,_)},s.prototype.div=function(A){return this.divmod(A,"div",!1).div},s.prototype.mod=function(A){return this.divmod(A,"mod",!1).mod},s.prototype.umod=function(A){return this.divmod(A,"mod",!0).mod},s.prototype.divRound=function(A){var _=this.divmod(A);if(_.mod.isZero())return _.div;var R=_.div.negative!==0?_.mod.isub(A):_.mod,P=A.ushrn(1),q=A.andln(1),F=R.cmp(P);return F<0||q===1&&F===0?_.div:_.div.negative!==0?_.div.isubn(1):_.div.iaddn(1)},s.prototype.modrn=function(A){var _=A<0;_&&(A=-A),r(A<=67108863);for(var R=(1<<26)%A,P=0,q=this.length-1;q>=0;q--)P=(R*P+(this.words[q]|0))%A;return _?-P:P},s.prototype.modn=function(A){return this.modrn(A)},s.prototype.idivn=function(A){var _=A<0;_&&(A=-A),r(A<=67108863);for(var R=0,P=this.length-1;P>=0;P--){var q=(this.words[P]|0)+R*67108864;this.words[P]=q/A|0,R=q%A}return this._strip(),_?this.ineg():this},s.prototype.divn=function(A){return this.clone().idivn(A)},s.prototype.egcd=function(A){r(A.negative===0),r(!A.isZero());var _=this,R=A.clone();_.negative!==0?_=_.umod(A):_=_.clone();for(var P=new s(1),q=new s(0),F=new s(0),z=new s(1),B=0;_.isEven()&&R.isEven();)_.iushrn(1),R.iushrn(1),++B;for(var C=R.clone(),M=_.clone();!_.isZero();){for(var Z=0,J=1;(_.words[0]&J)===0&&Z<26;++Z,J<<=1);if(Z>0)for(_.iushrn(Z);Z-- >0;)(P.isOdd()||q.isOdd())&&(P.iadd(C),q.isub(M)),P.iushrn(1),q.iushrn(1);for(var ae=0,we=1;(R.words[0]&we)===0&&ae<26;++ae,we<<=1);if(ae>0)for(R.iushrn(ae);ae-- >0;)(F.isOdd()||z.isOdd())&&(F.iadd(C),z.isub(M)),F.iushrn(1),z.iushrn(1);_.cmp(R)>=0?(_.isub(R),P.isub(F),q.isub(z)):(R.isub(_),F.isub(P),z.isub(q))}return{a:F,b:z,gcd:R.iushln(B)}},s.prototype._invmp=function(A){r(A.negative===0),r(!A.isZero());var _=this,R=A.clone();_.negative!==0?_=_.umod(A):_=_.clone();for(var P=new s(1),q=new s(0),F=R.clone();_.cmpn(1)>0&&R.cmpn(1)>0;){for(var z=0,B=1;(_.words[0]&B)===0&&z<26;++z,B<<=1);if(z>0)for(_.iushrn(z);z-- >0;)P.isOdd()&&P.iadd(F),P.iushrn(1);for(var C=0,M=1;(R.words[0]&M)===0&&C<26;++C,M<<=1);if(C>0)for(R.iushrn(C);C-- >0;)q.isOdd()&&q.iadd(F),q.iushrn(1);_.cmp(R)>=0?(_.isub(R),P.isub(q)):(R.isub(_),q.isub(P))}var Z;return _.cmpn(1)===0?Z=P:Z=q,Z.cmpn(0)<0&&Z.iadd(A),Z},s.prototype.gcd=function(A){if(this.isZero())return A.abs();if(A.isZero())return this.abs();var _=this.clone(),R=A.clone();_.negative=0,R.negative=0;for(var P=0;_.isEven()&&R.isEven();P++)_.iushrn(1),R.iushrn(1);do{for(;_.isEven();)_.iushrn(1);for(;R.isEven();)R.iushrn(1);var q=_.cmp(R);if(q<0){var F=_;_=R,R=F}else if(q===0||R.cmpn(1)===0)break;_.isub(R)}while(!0);return R.iushln(P)},s.prototype.invm=function(A){return this.egcd(A).a.umod(A)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(A){return this.words[0]&A},s.prototype.bincn=function(A){r(typeof A=="number");var _=A%26,R=(A-_)/26,P=1<<_;if(this.length<=R)return this._expand(R+1),this.words[R]|=P,this;for(var q=P,F=R;q!==0&&F<this.length;F++){var z=this.words[F]|0;z+=q,q=z>>>26,z&=67108863,this.words[F]=z}return q!==0&&(this.words[F]=q,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(A){var _=A<0;if(this.negative!==0&&!_)return-1;if(this.negative===0&&_)return 1;this._strip();var R;if(this.length>1)R=1;else{_&&(A=-A),r(A<=67108863,"Number is too big");var P=this.words[0]|0;R=P===A?0:P<A?-1:1}return this.negative!==0?-R|0:R},s.prototype.cmp=function(A){if(this.negative!==0&&A.negative===0)return-1;if(this.negative===0&&A.negative!==0)return 1;var _=this.ucmp(A);return this.negative!==0?-_|0:_},s.prototype.ucmp=function(A){if(this.length>A.length)return 1;if(this.length<A.length)return-1;for(var _=0,R=this.length-1;R>=0;R--){var P=this.words[R]|0,q=A.words[R]|0;if(P!==q){P<q?_=-1:P>q&&(_=1);break}}return _},s.prototype.gtn=function(A){return this.cmpn(A)===1},s.prototype.gt=function(A){return this.cmp(A)===1},s.prototype.gten=function(A){return this.cmpn(A)>=0},s.prototype.gte=function(A){return this.cmp(A)>=0},s.prototype.ltn=function(A){return this.cmpn(A)===-1},s.prototype.lt=function(A){return this.cmp(A)===-1},s.prototype.lten=function(A){return this.cmpn(A)<=0},s.prototype.lte=function(A){return this.cmp(A)<=0},s.prototype.eqn=function(A){return this.cmpn(A)===0},s.prototype.eq=function(A){return this.cmp(A)===0},s.red=function(A){return new V(A)},s.prototype.toRed=function(A){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),A.convertTo(this)._forceRed(A)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(A){return this.red=A,this},s.prototype.forceRed=function(A){return r(!this.red,"Already a number in reduction context"),this._forceRed(A)},s.prototype.redAdd=function(A){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,A)},s.prototype.redIAdd=function(A){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,A)},s.prototype.redSub=function(A){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,A)},s.prototype.redISub=function(A){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,A)},s.prototype.redShl=function(A){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,A)},s.prototype.redMul=function(A){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.mul(this,A)},s.prototype.redIMul=function(A){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.imul(this,A)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(A){return r(this.red&&!A.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,A)};var L={k256:null,p224:null,p192:null,p25519:null};function U($,A){this.name=$,this.p=new s(A,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}U.prototype._tmp=function(){var A=new s(null);return A.words=new Array(Math.ceil(this.n/13)),A},U.prototype.ireduce=function(A){var _=A,R;do this.split(_,this.tmp),_=this.imulK(_),_=_.iadd(this.tmp),R=_.bitLength();while(R>this.n);var P=R<this.n?-1:_.ucmp(this.p);return P===0?(_.words[0]=0,_.length=1):P>0?_.isub(this.p):_.strip!==void 0?_.strip():_._strip(),_},U.prototype.split=function(A,_){A.iushrn(this.n,0,_)},U.prototype.imulK=function(A){return A.imul(this.k)};function K(){U.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(K,U),K.prototype.split=function(A,_){for(var R=4194303,P=Math.min(A.length,9),q=0;q<P;q++)_.words[q]=A.words[q];if(_.length=P,A.length<=9){A.words[0]=0,A.length=1;return}var F=A.words[9];for(_.words[_.length++]=F&R,q=10;q<A.length;q++){var z=A.words[q]|0;A.words[q-10]=(z&R)<<4|F>>>22,F=z}F>>>=22,A.words[q-10]=F,F===0&&A.length>10?A.length-=10:A.length-=9},K.prototype.imulK=function(A){A.words[A.length]=0,A.words[A.length+1]=0,A.length+=2;for(var _=0,R=0;R<A.length;R++){var P=A.words[R]|0;_+=P*977,A.words[R]=_&67108863,_=P*64+(_/67108864|0)}return A.words[A.length-1]===0&&(A.length--,A.words[A.length-1]===0&&A.length--),A};function Y(){U.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Y,U);function k(){U.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(k,U);function j(){U.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(j,U),j.prototype.imulK=function(A){for(var _=0,R=0;R<A.length;R++){var P=(A.words[R]|0)*19+_,q=P&67108863;P>>>=26,A.words[R]=q,_=P}return _!==0&&(A.words[A.length++]=_),A},s._prime=function(A){if(L[A])return L[A];var _;if(A==="k256")_=new K;else if(A==="p224")_=new Y;else if(A==="p192")_=new k;else if(A==="p25519")_=new j;else throw new Error("Unknown prime "+A);return L[A]=_,_};function V($){if(typeof $=="string"){var A=s._prime($);this.m=A.p,this.prime=A}else r($.gtn(1),"modulus must be greater than 1"),this.m=$,this.prime=null}V.prototype._verify1=function(A){r(A.negative===0,"red works only with positives"),r(A.red,"red works only with red numbers")},V.prototype._verify2=function(A,_){r((A.negative|_.negative)===0,"red works only with positives"),r(A.red&&A.red===_.red,"red works only with red numbers")},V.prototype.imod=function(A){return this.prime?this.prime.ireduce(A)._forceRed(this):(d(A,A.umod(this.m)._forceRed(this)),A)},V.prototype.neg=function(A){return A.isZero()?A.clone():this.m.sub(A)._forceRed(this)},V.prototype.add=function(A,_){this._verify2(A,_);var R=A.add(_);return R.cmp(this.m)>=0&&R.isub(this.m),R._forceRed(this)},V.prototype.iadd=function(A,_){this._verify2(A,_);var R=A.iadd(_);return R.cmp(this.m)>=0&&R.isub(this.m),R},V.prototype.sub=function(A,_){this._verify2(A,_);var R=A.sub(_);return R.cmpn(0)<0&&R.iadd(this.m),R._forceRed(this)},V.prototype.isub=function(A,_){this._verify2(A,_);var R=A.isub(_);return R.cmpn(0)<0&&R.iadd(this.m),R},V.prototype.shl=function(A,_){return this._verify1(A),this.imod(A.ushln(_))},V.prototype.imul=function(A,_){return this._verify2(A,_),this.imod(A.imul(_))},V.prototype.mul=function(A,_){return this._verify2(A,_),this.imod(A.mul(_))},V.prototype.isqr=function(A){return this.imul(A,A.clone())},V.prototype.sqr=function(A){return this.mul(A,A)},V.prototype.sqrt=function(A){if(A.isZero())return A.clone();var _=this.m.andln(3);if(r(_%2===1),_===3){var R=this.m.add(new s(1)).iushrn(2);return this.pow(A,R)}for(var P=this.m.subn(1),q=0;!P.isZero()&&P.andln(1)===0;)q++,P.iushrn(1);r(!P.isZero());var F=new s(1).toRed(this),z=F.redNeg(),B=this.m.subn(1).iushrn(1),C=this.m.bitLength();for(C=new s(2*C*C).toRed(this);this.pow(C,B).cmp(z)!==0;)C.redIAdd(z);for(var M=this.pow(C,P),Z=this.pow(A,P.addn(1).iushrn(1)),J=this.pow(A,P),ae=q;J.cmp(F)!==0;){for(var we=J,he=0;we.cmp(F)!==0;he++)we=we.redSqr();r(he<ae);var xe=this.pow(M,new s(1).iushln(ae-he-1));Z=Z.redMul(xe),M=xe.redSqr(),J=J.redMul(M),ae=he}return Z},V.prototype.invm=function(A){var _=A._invmp(this.m);return _.negative!==0?(_.negative=0,this.imod(_).redNeg()):this.imod(_)},V.prototype.pow=function(A,_){if(_.isZero())return new s(1).toRed(this);if(_.cmpn(1)===0)return A.clone();var R=4,P=new Array(1<<R);P[0]=new s(1).toRed(this),P[1]=A;for(var q=2;q<P.length;q++)P[q]=this.mul(P[q-1],A);var F=P[0],z=0,B=0,C=_.bitLength()%26;for(C===0&&(C=26),q=_.length-1;q>=0;q--){for(var M=_.words[q],Z=C-1;Z>=0;Z--){var J=M>>Z&1;if(F!==P[0]&&(F=this.sqr(F)),J===0&&z===0){B=0;continue}z<<=1,z|=J,B++,!(B!==R&&(q!==0||Z!==0))&&(F=this.mul(F,P[z]),B=0,z=0)}C=26}return F},V.prototype.convertTo=function(A){var _=A.umod(this.m);return _===A?_.clone():_},V.prototype.convertFrom=function(A){var _=A.clone();return _.red=null,_},s.mont=function(A){return new W(A)};function W($){V.call(this,$),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(W,V),W.prototype.convertTo=function(A){return this.imod(A.ushln(this.shift))},W.prototype.convertFrom=function(A){var _=this.imod(A.mul(this.rinv));return _.red=null,_},W.prototype.imul=function(A,_){if(A.isZero()||_.isZero())return A.words[0]=0,A.length=1,A;var R=A.imul(_),P=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),q=R.isub(P).iushrn(this.shift),F=q;return q.cmp(this.m)>=0?F=q.isub(this.m):q.cmpn(0)<0&&(F=q.iadd(this.m)),F._forceRed(this)},W.prototype.mul=function(A,_){if(A.isZero()||_.isZero())return new s(0)._forceRed(this);var R=A.mul(_),P=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),q=R.isub(P).iushrn(this.shift),F=q;return q.cmp(this.m)>=0?F=q.isub(this.m):q.cmpn(0)<0&&(F=q.iadd(this.m)),F._forceRed(this)},W.prototype.invm=function(A){var _=this.imod(A._invmp(this.m).mul(this.r2));return _._forceRed(this)}})(n,$Ie)}(b6)),b6.exports}var UIe=Tne();const gN=xo(UIe);var SI={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var OV;function K$(){return OV||(OV=1,function(n,e){var t=q$(),r=t.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(i(t,e),e.Buffer=s);function s(o,a,c){return r(o,a,c)}s.prototype=Object.create(r.prototype),i(r,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=r(o);return a!==void 0?typeof c=="string"?u.fill(a,c):u.fill(a):u.fill(0),u},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(o)}}(SI,SI.exports)),SI.exports}var MO,PV;function jIe(){if(PV)return MO;PV=1;var n=K$().Buffer;function e(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<t.length;s++){var o=t.charAt(s),a=o.charCodeAt(0);if(r[a]!==255)throw new TypeError(o+" is ambiguous");r[a]=s}var c=t.length,u=t.charAt(0),d=Math.log(c)/Math.log(256),f=Math.log(256)/Math.log(c);function m(b){if((Array.isArray(b)||b instanceof Uint8Array)&&(b=n.from(b)),!n.isBuffer(b))throw new TypeError("Expected Buffer");if(b.length===0)return"";for(var E=0,T=0,N=0,I=b.length;N!==I&&b[N]===0;)N++,E++;for(var H=(I-N)*f+1>>>0,L=new Uint8Array(H);N!==I;){for(var U=b[N],K=0,Y=H-1;(U!==0||K<T)&&Y!==-1;Y--,K++)U+=256*L[Y]>>>0,L[Y]=U%c>>>0,U=U/c>>>0;if(U!==0)throw new Error("Non-zero carry");T=K,N++}for(var k=H-T;k!==H&&L[k]===0;)k++;for(var j=u.repeat(E);k<H;++k)j+=t.charAt(L[k]);return j}function w(b){if(typeof b!="string")throw new TypeError("Expected String");if(b.length===0)return n.alloc(0);for(var E=0,T=0,N=0;b[E]===u;)T++,E++;for(var I=(b.length-E)*d+1>>>0,H=new Uint8Array(I);E<b.length;){var L=b.charCodeAt(E);if(L>255)return;var U=r[L];if(U===255)return;for(var K=0,Y=I-1;(U!==0||K<N)&&Y!==-1;Y--,K++)U+=c*H[Y]>>>0,H[Y]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");N=K,E++}for(var k=I-N;k!==I&&H[k]===0;)k++;var j=n.allocUnsafe(T+(I-k));j.fill(0,0,T);for(var V=T;k!==I;)j[V++]=H[k++];return j}function y(b){var E=w(b);if(E)return E;throw new Error("Non-base"+c+" character")}return{encode:m,decodeUnsafe:w,decode:y}}return MO=e,MO}var kO,DV;function zIe(){if(DV)return kO;DV=1;var n=jIe(),e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return kO=n(e),kO}var FIe=zIe();const aa=xo(FIe);var Ci={},OO,BV;function WIe(){if(BV)return OO;BV=1;var n=K$().Buffer;function e(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<t.length;s++){var o=t.charAt(s),a=o.charCodeAt(0);if(r[a]!==255)throw new TypeError(o+" is ambiguous");r[a]=s}var c=t.length,u=t.charAt(0),d=Math.log(c)/Math.log(256),f=Math.log(256)/Math.log(c);function m(b){if((Array.isArray(b)||b instanceof Uint8Array)&&(b=n.from(b)),!n.isBuffer(b))throw new TypeError("Expected Buffer");if(b.length===0)return"";for(var E=0,T=0,N=0,I=b.length;N!==I&&b[N]===0;)N++,E++;for(var H=(I-N)*f+1>>>0,L=new Uint8Array(H);N!==I;){for(var U=b[N],K=0,Y=H-1;(U!==0||K<T)&&Y!==-1;Y--,K++)U+=256*L[Y]>>>0,L[Y]=U%c>>>0,U=U/c>>>0;if(U!==0)throw new Error("Non-zero carry");T=K,N++}for(var k=H-T;k!==H&&L[k]===0;)k++;for(var j=u.repeat(E);k<H;++k)j+=t.charAt(L[k]);return j}function w(b){if(typeof b!="string")throw new TypeError("Expected String");if(b.length===0)return n.alloc(0);for(var E=0,T=0,N=0;b[E]===u;)T++,E++;for(var I=(b.length-E)*d+1>>>0,H=new Uint8Array(I);E<b.length;){var L=b.charCodeAt(E);if(L>255)return;var U=r[L];if(U===255)return;for(var K=0,Y=I-1;(U!==0||K<N)&&Y!==-1;Y--,K++)U+=c*H[Y]>>>0,H[Y]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");N=K,E++}for(var k=I-N;k!==I&&H[k]===0;)k++;var j=n.allocUnsafe(T+(I-k));j.fill(0,0,T);for(var V=T;k!==I;)j[V++]=H[k++];return j}function y(b){var E=w(b);if(E)return E;throw new Error("Non-base"+c+" character")}return{encode:m,decodeUnsafe:w,decode:y}}return OO=e,OO}var PO,LV;function HIe(){if(LV)return PO;LV=1;var n=WIe(),e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return PO=n(e),PO}function Kp(n,e,t){return e<=n&&n<=t}function iR(n){if(n===void 0)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}function VIe(n){for(var e=String(n),t=e.length,r=0,i=[];r<t;){var s=e.charCodeAt(r);if(s<55296||s>57343)i.push(s);else if(56320<=s&&s<=57343)i.push(65533);else if(55296<=s&&s<=56319)if(r===t-1)i.push(65533);else{var o=n.charCodeAt(r+1);if(56320<=o&&o<=57343){var a=s&1023,c=o&1023;i.push(65536+(a<<10)+c),r+=1}else i.push(65533)}r+=1}return i}function qIe(n){for(var e="",t=0;t<n.length;++t){var r=n[t];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}var mN=-1;function Y$(n){this.tokens=[].slice.call(n)}Y$.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():mN},prepend:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(n)},push:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.push(e.shift());else this.tokens.push(n)}};var yx=-1;function DO(n,e){if(n)throw TypeError("Decoder error");return e||65533}var wN="utf-8";function yN(n,e){if(!(this instanceof yN))return new yN(n,e);if(n=n!==void 0?String(n).toLowerCase():wN,n!==wN)throw new Error("Encoding not supported. Only utf-8 is supported");e=iR(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}yN.prototype={decode:function(e,t){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),t=iR(t),this._streaming||(this._decoder=new KIe({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var i=new Y$(r),s=[],o;!i.endOfStream()&&(o=this._decoder.handler(i,i.read()),o!==yx);)o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o));if(!this._streaming){do{if(o=this._decoder.handler(i,i.read()),o===yx)break;o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}while(!i.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),qIe(s)}};function bN(n,e){if(!(this instanceof bN))return new bN(n,e);if(n=n!==void 0?String(n).toLowerCase():wN,n!==wN)throw new Error("Encoding not supported. Only utf-8 is supported");e=iR(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}bN.prototype={encode:function(e,t){e=e?String(e):"",t=iR(t),this._streaming||(this._encoder=new YIe(this._options)),this._streaming=!!t.stream;for(var r=[],i=new Y$(VIe(e)),s;!i.endOfStream()&&(s=this._encoder.handler(i,i.read()),s!==yx);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(i,i.read()),s!==yx;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)}};function KIe(n){var e=n.fatal,t=0,r=0,i=0,s=128,o=191;this.handler=function(a,c){if(c===mN&&i!==0)return i=0,DO(e);if(c===mN)return yx;if(i===0){if(Kp(c,0,127))return c;if(Kp(c,194,223))i=1,t=c-192;else if(Kp(c,224,239))c===224&&(s=160),c===237&&(o=159),i=2,t=c-224;else if(Kp(c,240,244))c===240&&(s=144),c===244&&(o=143),i=3,t=c-240;else return DO(e);return t=t<<6*i,null}if(!Kp(c,s,o))return t=i=r=0,s=128,o=191,a.prepend(c),DO(e);if(s=128,o=191,r+=1,t+=c-128<<6*(i-r),r!==i)return null;var u=t;return t=i=r=0,u}}function YIe(n){n.fatal,this.handler=function(e,t){if(t===mN)return yx;if(Kp(t,0,127))return t;var r,i;Kp(t,128,2047)?(r=1,i=192):Kp(t,2048,65535)?(r=2,i=224):Kp(t,65536,1114111)&&(r=3,i=240);for(var s=[(t>>6*r)+i];r>0;){var o=t>>6*(r-1);s.push(128|o&63),r-=1}return s}}const GIe=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:yN,TextEncoder:bN},Symbol.toStringTag,{value:"Module"})),ZIe=Vx(GIe);var $V;function QIe(){if($V)return Ci;$V=1;var n=Ci&&Ci.__createBinding||(Object.create?function(k,j,V,W){W===void 0&&(W=V),Object.defineProperty(k,W,{enumerable:!0,get:function(){return j[V]}})}:function(k,j,V,W){W===void 0&&(W=V),k[W]=j[V]}),e=Ci&&Ci.__setModuleDefault||(Object.create?function(k,j){Object.defineProperty(k,"default",{enumerable:!0,value:j})}:function(k,j){k.default=j}),t=Ci&&Ci.__decorate||function(k,j,V,W){var $=arguments.length,A=$<3?j:W===null?W=Object.getOwnPropertyDescriptor(j,V):W,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(k,j,V,W);else for(var R=k.length-1;R>=0;R--)(_=k[R])&&(A=($<3?_(A):$>3?_(j,V,A):_(j,V))||A);return $>3&&A&&Object.defineProperty(j,V,A),A},r=Ci&&Ci.__importStar||function(k){if(k&&k.__esModule)return k;var j={};if(k!=null)for(var V in k)V!=="default"&&Object.hasOwnProperty.call(k,V)&&n(j,k,V);return e(j,k),j},i=Ci&&Ci.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.deserializeUnchecked=Ci.deserialize=Ci.serialize=Ci.BinaryReader=Ci.BinaryWriter=Ci.BorshError=Ci.baseDecode=Ci.baseEncode=void 0;const s=i(Tne()),o=i(HIe()),a=r(ZIe),c=typeof TextDecoder!="function"?a.TextDecoder:TextDecoder,u=new c("utf-8",{fatal:!0});function d(k){return typeof k=="string"&&(k=pn.from(k,"utf8")),o.default.encode(pn.from(k))}Ci.baseEncode=d;function f(k){return pn.from(o.default.decode(k))}Ci.baseDecode=f;const m=1024;class w extends Error{constructor(j){super(j),this.fieldPath=[],this.originalMessage=j}addToFieldPath(j){this.fieldPath.splice(0,0,j),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}Ci.BorshError=w;class y{constructor(){this.buf=pn.alloc(m),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=pn.concat([this.buf,pn.alloc(m)]))}writeU8(j){this.maybeResize(),this.buf.writeUInt8(j,this.length),this.length+=1}writeU16(j){this.maybeResize(),this.buf.writeUInt16LE(j,this.length),this.length+=2}writeU32(j){this.maybeResize(),this.buf.writeUInt32LE(j,this.length),this.length+=4}writeU64(j){this.maybeResize(),this.writeBuffer(pn.from(new s.default(j).toArray("le",8)))}writeU128(j){this.maybeResize(),this.writeBuffer(pn.from(new s.default(j).toArray("le",16)))}writeU256(j){this.maybeResize(),this.writeBuffer(pn.from(new s.default(j).toArray("le",32)))}writeU512(j){this.maybeResize(),this.writeBuffer(pn.from(new s.default(j).toArray("le",64)))}writeBuffer(j){this.buf=pn.concat([pn.from(this.buf.subarray(0,this.length)),j,pn.alloc(m)]),this.length+=j.length}writeString(j){this.maybeResize();const V=pn.from(j,"utf8");this.writeU32(V.length),this.writeBuffer(V)}writeFixedArray(j){this.writeBuffer(pn.from(j))}writeArray(j,V){this.maybeResize(),this.writeU32(j.length);for(const W of j)this.maybeResize(),V(W)}toArray(){return this.buf.subarray(0,this.length)}}Ci.BinaryWriter=y;function b(k,j,V){const W=V.value;V.value=function(...$){try{return W.apply(this,$)}catch(A){if(A instanceof RangeError){const _=A.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(_)>=0)throw new w("Reached the end of buffer when deserializing")}throw A}}}class E{constructor(j){this.buf=j,this.offset=0}readU8(){const j=this.buf.readUInt8(this.offset);return this.offset+=1,j}readU16(){const j=this.buf.readUInt16LE(this.offset);return this.offset+=2,j}readU32(){const j=this.buf.readUInt32LE(this.offset);return this.offset+=4,j}readU64(){const j=this.readBuffer(8);return new s.default(j,"le")}readU128(){const j=this.readBuffer(16);return new s.default(j,"le")}readU256(){const j=this.readBuffer(32);return new s.default(j,"le")}readU512(){const j=this.readBuffer(64);return new s.default(j,"le")}readBuffer(j){if(this.offset+j>this.buf.length)throw new w(`Expected buffer length ${j} isn't within bounds`);const V=this.buf.slice(this.offset,this.offset+j);return this.offset+=j,V}readString(){const j=this.readU32(),V=this.readBuffer(j);try{return u.decode(V)}catch(W){throw new w(`Error decoding UTF-8 string: ${W}`)}}readFixedArray(j){return new Uint8Array(this.readBuffer(j))}readArray(j){const V=this.readU32(),W=Array();for(let $=0;$<V;++$)W.push(j());return W}}t([b],E.prototype,"readU8",null),t([b],E.prototype,"readU16",null),t([b],E.prototype,"readU32",null),t([b],E.prototype,"readU64",null),t([b],E.prototype,"readU128",null),t([b],E.prototype,"readU256",null),t([b],E.prototype,"readU512",null),t([b],E.prototype,"readString",null),t([b],E.prototype,"readFixedArray",null),t([b],E.prototype,"readArray",null),Ci.BinaryReader=E;function T(k){return k.charAt(0).toUpperCase()+k.slice(1)}function N(k,j,V,W,$){try{if(typeof W=="string")$[`write${T(W)}`](V);else if(W instanceof Array)if(typeof W[0]=="number"){if(V.length!==W[0])throw new w(`Expecting byte array of length ${W[0]}, but got ${V.length} bytes`);$.writeFixedArray(V)}else if(W.length===2&&typeof W[1]=="number"){if(V.length!==W[1])throw new w(`Expecting byte array of length ${W[1]}, but got ${V.length} bytes`);for(let A=0;A<W[1];A++)N(k,null,V[A],W[0],$)}else $.writeArray(V,A=>{N(k,j,A,W[0],$)});else if(W.kind!==void 0)switch(W.kind){case"option":{V==null?$.writeU8(0):($.writeU8(1),N(k,j,V,W.type,$));break}case"map":{$.writeU32(V.size),V.forEach((A,_)=>{N(k,j,_,W.key,$),N(k,j,A,W.value,$)});break}default:throw new w(`FieldType ${W} unrecognized`)}else I(k,V,$)}catch(A){throw A instanceof w&&A.addToFieldPath(j),A}}function I(k,j,V){if(typeof j.borshSerialize=="function"){j.borshSerialize(V);return}const W=k.get(j.constructor);if(!W)throw new w(`Class ${j.constructor.name} is missing in schema`);if(W.kind==="struct")W.fields.map(([$,A])=>{N(k,$,j[$],A,V)});else if(W.kind==="enum"){const $=j[W.field];for(let A=0;A<W.values.length;++A){const[_,R]=W.values[A];if(_===$){V.writeU8(A),N(k,_,j[_],R,V);break}}}else throw new w(`Unexpected schema kind: ${W.kind} for ${j.constructor.name}`)}function H(k,j,V=y){const W=new V;return I(k,j,W),W.toArray()}Ci.serialize=H;function L(k,j,V,W){try{if(typeof V=="string")return W[`read${T(V)}`]();if(V instanceof Array){if(typeof V[0]=="number")return W.readFixedArray(V[0]);if(typeof V[1]=="number"){const $=[];for(let A=0;A<V[1];A++)$.push(L(k,null,V[0],W));return $}else return W.readArray(()=>L(k,j,V[0],W))}if(V.kind==="option")return W.readU8()?L(k,j,V.type,W):void 0;if(V.kind==="map"){let $=new Map;const A=W.readU32();for(let _=0;_<A;_++){const R=L(k,j,V.key,W),P=L(k,j,V.value,W);$.set(R,P)}return $}return U(k,V,W)}catch($){throw $ instanceof w&&$.addToFieldPath(j),$}}function U(k,j,V){if(typeof j.borshDeserialize=="function")return j.borshDeserialize(V);const W=k.get(j);if(!W)throw new w(`Class ${j.name} is missing in schema`);if(W.kind==="struct"){const $={};for(const[A,_]of k.get(j).fields)$[A]=L(k,A,_,V);return new j($)}if(W.kind==="enum"){const $=V.readU8();if($>=W.values.length)throw new w(`Enum index: ${$} is out of range`);const[A,_]=W.values[$],R=L(k,A,_,V);return new j({[A]:R})}throw new w(`Unexpected schema kind: ${W.kind} for ${j.constructor.name}`)}function K(k,j,V,W=E){const $=new W(V),A=U(k,j,$);
997if($.offset<V.length)throw new w(`Unexpected ${V.length-$.offset} bytes after deserialized data`);return A}Ci.deserialize=K;function Y(k,j,V,W=E){const $=new W(V);return U(k,j,$)}return Ci.deserializeUnchecked=Y,Ci}var q2=QIe(),Qe={},UV;function XIe(){if(UV)return Qe;UV=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.s16=Qe.s8=Qe.nu64be=Qe.u48be=Qe.u40be=Qe.u32be=Qe.u24be=Qe.u16be=Qe.nu64=Qe.u48=Qe.u40=Qe.u32=Qe.u24=Qe.u16=Qe.u8=Qe.offset=Qe.greedy=Qe.Constant=Qe.UTF8=Qe.CString=Qe.Blob=Qe.Boolean=Qe.BitField=Qe.BitStructure=Qe.VariantLayout=Qe.Union=Qe.UnionLayoutDiscriminator=Qe.UnionDiscriminator=Qe.Structure=Qe.Sequence=Qe.DoubleBE=Qe.Double=Qe.FloatBE=Qe.Float=Qe.NearInt64BE=Qe.NearInt64=Qe.NearUInt64BE=Qe.NearUInt64=Qe.IntBE=Qe.Int=Qe.UIntBE=Qe.UInt=Qe.OffsetLayout=Qe.GreedyCount=Qe.ExternalLayout=Qe.bindConstructorLayout=Qe.nameWithProperty=Qe.Layout=Qe.uint8ArrayToBuffer=Qe.checkUint8Array=void 0,Qe.constant=Qe.utf8=Qe.cstr=Qe.blob=Qe.unionLayoutDiscriminator=Qe.union=Qe.seq=Qe.bits=Qe.struct=Qe.f64be=Qe.f64=Qe.f32be=Qe.f32=Qe.ns64be=Qe.s48be=Qe.s40be=Qe.s32be=Qe.s24be=Qe.s16be=Qe.ns64=Qe.s48=Qe.s40=Qe.s32=Qe.s24=void 0;const n=q$();function e(C){if(!(C instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}Qe.checkUint8Array=e;function t(C){return e(C),n.Buffer.from(C.buffer,C.byteOffset,C.length)}Qe.uint8ArrayToBuffer=t;let r=class{constructor(M,Z){if(!Number.isInteger(M))throw new TypeError("span must be an integer");this.span=M,this.property=Z}makeDestinationObject(){return{}}getSpan(M,Z){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(M){const Z=Object.create(this.constructor.prototype);return Object.assign(Z,this),Z.property=M,Z}fromArray(M){}};Qe.Layout=r;function i(C,M){return M.property?C+"["+M.property+"]":C}Qe.nameWithProperty=i;function s(C,M){if(typeof C!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(C,"layout_"))throw new Error("Class is already bound to a layout");if(!(M&&M instanceof r))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(M,"boundConstructor_"))throw new Error("layout is already bound to a constructor");C.layout_=M,M.boundConstructor_=C,M.makeDestinationObject=()=>new C,Object.defineProperty(C.prototype,"encode",{value(Z,J){return M.encode(this,Z,J)},writable:!0}),Object.defineProperty(C,"decode",{value(Z,J){return M.decode(Z,J)},writable:!0})}Qe.bindConstructorLayout=s;class o extends r{isCount(){throw new Error("ExternalLayout is abstract")}}Qe.ExternalLayout=o;class a extends o{constructor(M=1,Z){if(!Number.isInteger(M)||0>=M)throw new TypeError("elementSpan must be a (positive) integer");super(-1,Z),this.elementSpan=M}isCount(){return!0}decode(M,Z=0){e(M);const J=M.length-Z;return Math.floor(J/this.elementSpan)}encode(M,Z,J){return 0}}Qe.GreedyCount=a;class c extends o{constructor(M,Z=0,J){if(!(M instanceof r))throw new TypeError("layout must be a Layout");if(!Number.isInteger(Z))throw new TypeError("offset must be integer or undefined");super(M.span,J||M.property),this.layout=M,this.offset=Z}isCount(){return this.layout instanceof u||this.layout instanceof d}decode(M,Z=0){return this.layout.decode(M,Z+this.offset)}encode(M,Z,J=0){return this.layout.encode(M,Z,J+this.offset)}}Qe.OffsetLayout=c;class u extends r{constructor(M,Z){if(super(M,Z),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(M,Z=0){return t(M).readUIntLE(Z,this.span)}encode(M,Z,J=0){return t(Z).writeUIntLE(M,J,this.span),this.span}}Qe.UInt=u;class d extends r{constructor(M,Z){if(super(M,Z),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(M,Z=0){return t(M).readUIntBE(Z,this.span)}encode(M,Z,J=0){return t(Z).writeUIntBE(M,J,this.span),this.span}}Qe.UIntBE=d;class f extends r{constructor(M,Z){if(super(M,Z),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(M,Z=0){return t(M).readIntLE(Z,this.span)}encode(M,Z,J=0){return t(Z).writeIntLE(M,J,this.span),this.span}}Qe.Int=f;class m extends r{constructor(M,Z){if(super(M,Z),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(M,Z=0){return t(M).readIntBE(Z,this.span)}encode(M,Z,J=0){return t(Z).writeIntBE(M,J,this.span),this.span}}Qe.IntBE=m;const w=Math.pow(2,32);function y(C){const M=Math.floor(C/w),Z=C-M*w;return{hi32:M,lo32:Z}}function b(C,M){return C*w+M}class E extends r{constructor(M){super(8,M)}
997decode(M,Z=0){const J=t(M),ae=J.readUInt32LE(Z),we=J.readUInt32LE(Z+4);return b(we,ae)}encode(M,Z,J=0){const ae=y(M),we=t(Z);return we.writeUInt32LE(ae.lo32,J),we.writeUInt32LE(ae.hi32,J+4),8}}Qe.NearUInt64=E;class T extends r{constructor(M){super(8,M)}decode(M,Z=0){const J=t(M),ae=J.readUInt32BE(Z),we=J.readUInt32BE(Z+4);return b(ae,we)}encode(M,Z,J=0){const ae=y(M),we=t(Z);return we.writeUInt32BE(ae.hi32,J),we.writeUInt32BE(ae.lo32,J+4),8}}Qe.NearUInt64BE=T;class N extends r{constructor(M){super(8,M)}decode(M,Z=0){const J=t(M),ae=J.readUInt32LE(Z),we=J.readInt32LE(Z+4);return b(we,ae)}encode(M,Z,J=0){const ae=y(M),we=t(Z);return we.writeUInt32LE(ae.lo32,J),we.writeInt32LE(ae.hi32,J+4),8}}Qe.NearInt64=N;class I extends r{constructor(M){super(8,M)}decode(M,Z=0){const J=t(M),ae=J.readInt32BE(Z),we=J.readUInt32BE(Z+4);return b(ae,we)}encode(M,Z,J=0){const ae=y(M),we=t(Z);return we.writeInt32BE(ae.hi32,J),we.writeUInt32BE(ae.lo32,J+4),8}}Qe.NearInt64BE=I;class H extends r{constructor(M){super(4,M)}decode(M,Z=0){return t(M).readFloatLE(Z)}encode(M,Z,J=0){return t(Z).writeFloatLE(M,J),4}}Qe.Float=H;class L extends r{constructor(M){super(4,M)}decode(M,Z=0){return t(M).readFloatBE(Z)}encode(M,Z,J=0){return t(Z).writeFloatBE(M,J),4}}Qe.FloatBE=L;class U extends r{constructor(M){super(8,M)}decode(M,Z=0){return t(M).readDoubleLE(Z)}encode(M,Z,J=0){return t(Z).writeDoubleLE(M,J),8}}Qe.Double=U;class K extends r{constructor(M){super(8,M)}decode(M,Z=0){return t(M).readDoubleBE(Z)}encode(M,Z,J=0){return t(Z).writeDoubleBE(M,J),8}}Qe.DoubleBE=K;class Y extends r{constructor(M,Z,J){if(!(M instanceof r))throw new TypeError("elementLayout must be a Layout");if(!(Z instanceof o&&Z.isCount()||Number.isInteger(Z)&&0<=Z))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let ae=-1;!(Z instanceof o)&&0<M.span&&(ae=Z*M.span),super(ae,J),this.elementLayout=M,this.count=Z}getSpan(M,Z=0){if(0<=this.span)return this.span;let J=0,ae=this.count;if(ae instanceof o&&(ae=ae.decode(M,Z)),0<this.elementLayout.span)J=ae*this.elementLayout.span;else{let we=0;for(;we<ae;)J+=this.elementLayout.getSpan(M,Z+J),++we}return J}decode(M,Z=0){const J=[];let ae=0,we=this.count;for(we instanceof o&&(we=we.decode(M,Z));ae<we;)J.push(this.elementLayout.decode(M,Z)),Z+=this.elementLayout.getSpan(M,Z),ae+=1;return J}encode(M,Z,J=0){const ae=this.elementLayout,we=M.reduce((he,xe)=>he+ae.encode(xe,Z,J+he),0);return this.count instanceof o&&this.count.encode(M.length,Z,J),we}}Qe.Sequence=Y;class k extends r{constructor(M,Z,J){if(!(Array.isArray(M)&&M.reduce((we,he)=>we&&he instanceof r,!0)))throw new TypeError("fields must be array of Layout instances");typeof Z=="boolean"&&J===void 0&&(J=Z,Z=void 0);for(const we of M)if(0>we.span&&we.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let ae=-1;try{ae=M.reduce((we,he)=>we+he.getSpan(),0)}catch{}super(ae,Z),this.fields=M,this.decodePrefixes=!!J}getSpan(M,Z=0){if(0<=this.span)return this.span;let J=0;try{J=this.fields.reduce((ae,we)=>{const he=we.getSpan(M,Z);return Z+=he,ae+he},0)}catch{throw new RangeError("indeterminate span")}return J}decode(M,Z=0){e(M);const J=this.makeDestinationObject();for(const ae of this.fields)if(ae.property!==void 0&&(J[ae.property]=ae.decode(M,Z)),Z+=ae.getSpan(M,Z),this.decodePrefixes&&M.length===Z)break;return J}encode(M,Z,J=0){const ae=J;let we=0,he=0;for(const xe of this.fields){let Se=xe.span;if(he=0<Se?Se:0,xe.property!==void 0){const Re=M[xe.property];Re!==void 0&&(he=xe.encode(Re,Z,J),0>Se&&(Se=xe.getSpan(Z,J)))}we=J,J+=Se}return we+he-ae}fromArray(M){const Z=this.makeDestinationObject();for(const J of this.fields)J.property!==void 0&&0<M.length&&(Z[J.property]=M.shift());return Z}layoutFor(M){if(typeof M!="string")throw new TypeError("property must be string");for(const Z of this.fields)if(Z.property===M)return Z}offsetOf(M){if(typeof M!="string")throw new TypeError("property must be string");let Z=0;for(const J of this.fields){if(J.property===M)return Z;0>J.span?Z=-1:0<=Z&&(Z+=J.span)}}}Qe.Structure=k;class j{constructor(M){this.property=M}decode(M,Z){throw new Error("UnionDiscriminator is abstract")}encode(M,Z,J){throw new Error("UnionDiscriminator is abstract")}}Qe.UnionDiscriminator=j;class V extends j{constructor(M,Z){if(!(M instanceof o&&M.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");
vendor: 4,451 bytes, line 997
997super(Z||M.property||"variant"),this.layout=M}decode(M,Z){return this.layout.decode(M,Z)}encode(M,Z,J){return this.layout.encode(M,Z,J)}}Qe.UnionLayoutDiscriminator=V;class W extends r{constructor(M,Z,J){let ae;if(M instanceof u||M instanceof d)ae=new V(new c(M));else if(M instanceof o&&M.isCount())ae=new V(M);else if(M instanceof j)ae=M;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(Z===void 0&&(Z=null),!(Z===null||Z instanceof r))throw new TypeError("defaultLayout must be null or a Layout");if(Z!==null){if(0>Z.span)throw new Error("defaultLayout must have constant span");Z.property===void 0&&(Z=Z.replicate("content"))}let we=-1;Z&&(we=Z.span,0<=we&&(M instanceof u||M instanceof d)&&(we+=ae.layout.span)),super(we,J),this.discriminator=ae,this.usesPrefixDiscriminator=M instanceof u||M instanceof d,this.defaultLayout=Z,this.registry={};let he=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(xe){return he(xe)},this.configGetSourceVariant=function(xe){he=xe.bind(this)}}getSpan(M,Z=0){if(0<=this.span)return this.span;const J=this.getVariant(M,Z);if(!J)throw new Error("unable to determine span for unrecognized variant");return J.getSpan(M,Z)}defaultGetSourceVariant(M){if(Object.prototype.hasOwnProperty.call(M,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(M,this.defaultLayout.property))return;const Z=this.registry[M[this.discriminator.property]];if(Z&&(!Z.layout||Z.property&&Object.prototype.hasOwnProperty.call(M,Z.property)))return Z}else for(const Z in this.registry){const J=this.registry[Z];if(J.property&&Object.prototype.hasOwnProperty.call(M,J.property))return J}throw new Error("unable to infer src variant")}decode(M,Z=0){let J;const ae=this.discriminator,we=ae.decode(M,Z),he=this.registry[we];if(he===void 0){const xe=this.defaultLayout;let Se=0;this.usesPrefixDiscriminator&&(Se=ae.layout.span),J=this.makeDestinationObject(),J[ae.property]=we,J[xe.property]=xe.decode(M,Z+Se)}else J=he.decode(M,Z);return J}encode(M,Z,J=0){const ae=this.getSourceVariant(M);if(ae===void 0){const we=this.discriminator,he=this.defaultLayout;let xe=0;return this.usesPrefixDiscriminator&&(xe=we.layout.span),we.encode(M[we.property],Z,J),xe+he.encode(M[he.property],Z,J+xe)}return ae.encode(M,Z,J)}addVariant(M,Z,J){const ae=new $(this,M,Z,J);return this.registry[M]=ae,ae}getVariant(M,Z=0){let J;return M instanceof Uint8Array?J=this.discriminator.decode(M,Z):J=M,this.registry[J]}}Qe.Union=W;class $ extends r{constructor(M,Z,J,ae){if(!(M instanceof W))throw new TypeError("union must be a Union");if(!Number.isInteger(Z)||0>Z)throw new TypeError("variant must be a (non-negative) integer");if(typeof J=="string"&&ae===void 0&&(ae=J,J=null),J){if(!(J instanceof r))throw new TypeError("layout must be a Layout");if(M.defaultLayout!==null&&0<=J.span&&J.span>M.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof ae!="string")throw new TypeError("variant must have a String property")}let we=M.span;0>M.span&&(we=J?J.span:0,0<=we&&M.usesPrefixDiscriminator&&(we+=M.discriminator.layout.span)),super(we,ae),this.union=M,this.variant=Z,this.layout=J||null}getSpan(M,Z=0){if(0<=this.span)return this.span;let J=0;this.union.usesPrefixDiscriminator&&(J=this.union.discriminator.layout.span);let ae=0;return this.layout&&(ae=this.layout.getSpan(M,Z+J)),J+ae}decode(M,Z=0){const J=this.makeDestinationObject();if(this!==this.union.getVariant(M,Z))throw new Error("variant mismatch");let ae=0;return this.union.usesPrefixDiscriminator&&(ae=this.union.discriminator.layout.span),this.layout?J[this.property]=this.layout.decode(M,Z+ae):this.property?J[this.property]=!0:this.union.usesPrefixDiscriminator&&(J[this.union.discriminator.property]=this.variant),J}encode(M,Z,J=0){let ae=0;if(this.union.usesPrefixDiscriminator&&(ae=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(M,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,Z,J);let we=ae;if(this.layout&&(this.layout.encode(M[this.property],Z,J+ae),we+=this.layout.getSpan(Z,J+ae),0<=this.union.span&&we>this.union.span))throw new Error("encoded variant overruns containing union");return we}fromArray(M){if(this.layout)return this.layout.fromArray(M)}}Qe.VariantLayout=$;function A(C){return 0>
997C&&(C+=4294967296),C}class _ extends r{constructor(M,Z,J){if(!(M instanceof u||M instanceof d))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof Z=="string"&&J===void 0&&(J=Z,Z=!1),4<M.span)throw new RangeError("word cannot exceed 32 bits");super(M.span,J),this.word=M,this.msb=!!Z,this.fields=[];let ae=0;this._packedSetValue=function(we){return ae=A(we),this},this._packedGetValue=function(){return ae}}decode(M,Z=0){const J=this.makeDestinationObject(),ae=this.word.decode(M,Z);this._packedSetValue(ae);for(const we of this.fields)we.property!==void 0&&(J[we.property]=we.decode(M));return J}encode(M,Z,J=0){const ae=this.word.decode(Z,J);this._packedSetValue(ae);for(const we of this.fields)if(we.property!==void 0){const he=M[we.property];he!==void 0&&we.encode(he)}return this.word.encode(this._packedGetValue(),Z,J)}addField(M,Z){const J=new R(this,M,Z);return this.fields.push(J),J}addBoolean(M){const Z=new P(this,M);return this.fields.push(Z),Z}fieldFor(M){if(typeof M!="string")throw new TypeError("property must be string");for(const Z of this.fields)if(Z.property===M)return Z}}Qe.BitStructure=_;class R{constructor(M,Z,J){if(!(M instanceof _))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(Z)||0>=Z)throw new TypeError("bits must be positive integer");const ae=8*M.span,we=M.fields.reduce((he,xe)=>he+xe.bits,0);if(Z+we>ae)throw new Error("bits too long for span remainder ("+(ae-we)+" of "+ae+" remain)");this.container=M,this.bits=Z,this.valueMask=(1<<Z)-1,Z===32&&(this.valueMask=4294967295),this.start=we,this.container.msb&&(this.start=ae-we-Z),this.wordMask=A(this.valueMask<<this.start),this.property=J}decode(M,Z){const J=this.container._packedGetValue();return A(J&this.wordMask)>>>this.start}encode(M){if(typeof M!="number"||!Number.isInteger(M)||M!==A(M&this.valueMask))throw new TypeError(i("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const Z=this.container._packedGetValue(),J=A(M<<this.start);this.container._packedSetValue(A(Z&~this.wordMask)|J)}}Qe.BitField=R;class P extends R{constructor(M,Z){super(M,1,Z)}decode(M,Z){return!!super.decode(M,Z)}encode(M){typeof M=="boolean"&&(M=+M),super.encode(M)}}Qe.Boolean=P;class q extends r{constructor(M,Z){if(!(M instanceof o&&M.isCount()||Number.isInteger(M)&&0<=M))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let J=-1;M instanceof o||(J=M),super(J,Z),this.length=M}getSpan(M,Z){let J=this.span;return 0>J&&(J=this.length.decode(M,Z)),J}decode(M,Z=0){let J=this.span;return 0>J&&(J=this.length.decode(M,Z)),t(M).slice(Z,Z+J)}encode(M,Z,J){let ae=this.length;if(this.length instanceof o&&(ae=M.length),!(M instanceof Uint8Array&&ae===M.length))throw new TypeError(i("Blob.encode",this)+" requires (length "+ae+") Uint8Array as src");if(J+ae>Z.length)throw new RangeError("encoding overruns Uint8Array");const we=t(M);return t(Z).write(we.toString("hex"),J,ae,"hex"),this.length instanceof o&&this.length.encode(ae,Z,J),ae}}Qe.Blob=q;class F extends r{constructor(M){super(-1,M)}getSpan(M,Z=0){e(M);let J=Z;for(;J<M.length&&M[J]!==0;)J+=1;return 1+J-Z}decode(M,Z=0){const J=this.getSpan(M,Z);return t(M).slice(Z,Z+J-1).toString("utf-8")}encode(M,Z,J=0){typeof M!="string"&&(M=String(M));const ae=n.Buffer.from(M,"utf8"),we=ae.length;if(J+we>Z.length)throw new RangeError("encoding overruns Buffer");const he=t(Z);return ae.copy(he,J),he[J+we]=0,we+1}}Qe.CString=F;class z extends r{constructor(M,Z){if(typeof M=="string"&&Z===void 0&&(Z=M,M=void 0),M===void 0)M=-1;else if(!Number.isInteger(M))throw new TypeError("maxSpan must be an integer");super(-1,Z),this.maxSpan=M}getSpan(M,Z=0){return e(M),M.length-Z}decode(M,Z=0){const J=this.getSpan(M,Z);if(0<=this.maxSpan&&this.maxSpan<J)throw new RangeError("text length exceeds maxSpan");return t(M).slice(Z,Z+J).toString("utf-8")}encode(M,Z,J=0){typeof M!="string"&&(M=String(M));const ae=n.Buffer.from(M,"utf8"),we=ae.length;if(0<=this.maxSpan&&this.maxSpan<we)throw new RangeError("text length exceeds maxSpan");if(J+we>Z.length)throw new RangeError("encoding overruns Buffer");return ae.copy(t(Z),J),we}}Qe.UTF8=z;class B extends r{constructor(M,Z){super(0,Z),this.value=M}decode(M,Z){return this.value}encode(M,Z,J){return 0}}return Qe.Constant=B,Qe.greedy=(C,M)=>new a(C,M),Qe.offset=(C,M,Z)=>new c(C,M,Z),Qe.u8=C=>new u(1,C),Qe.u16=C=>new u(2,C),Qe.u24=C=>new u(3,C),Qe.u32=C=>new u(4,C),Qe.u40=C=>new u(5,C),Qe.u48=C=>new u(6,C),Qe.nu64=C=>new E(C),Qe.u16be=C=>new d(2,C),Qe.u24be=C=>new d(3,C),Qe.u32be=C=>new d(4,C),Qe.u40be=C=>new d(5,C),Qe.u48be=C=>new d(6,C),Qe.nu64be=C=>new T(C),Qe.s8=C=>new f(1,C),Qe.s16=C=>new f(2,C),Qe.s24=C=>new f(3,C),Qe.s32=C=>new f(4,C),Qe.s40=C=>new f(5,C),Qe.s48=C=>new f(6,C),Qe.ns64=C=>new N(C),Qe.s16be=C=>
997new m(2,C),Qe.s24be=C=>new m(3,C),Qe.s32be=C=>new m(4,C),Qe.s40be=C=>new m(5,C),Qe.s48be=C=>new m(6,C),Qe.ns64be=C=>new I(C),Qe.f32=C=>new H(C),Qe.f32be=C=>new L(C),Qe.f64=C=>new U(C),Qe.f64be=C=>new K(C),Qe.struct=(C,M,Z)=>new k(C,M,Z),Qe.bits=(C,M,Z)=>new _(C,M,Z),Qe.seq=(C,M,Z)=>new Y(C,M,Z),Qe.union=(C,M,Z)=>new W(C,M,Z),Qe.unionLayoutDiscriminator=(C,M)=>new V(C,M),Qe.blob=(C,M)=>new q(C,M),Qe.cstr=C=>new F(C),Qe.utf8=(C,M)=>new z(C,M),Qe.constant=(C,M)=>new B(C,M),Qe}var ie=XIe(),JIe=8078e3,e6e=8078001,t6e=8078004,n6e=8078005,r6e=8078006,i6e=8078011;function Ine(n){return Array.isArray(n)?"%5B"+n.map(Ine).join("%2C%20")+"%5D":typeof n=="bigint"?`${n}n`:encodeURIComponent(String(n!=null&&Object.getPrototypeOf(n)===null?{...n}:n))}function s6e([n,e]){return`${n}=${Ine(e)}`}function o6e(n){const e=Object.entries(n).map(s6e).join("&");return btoa(e)}function a6e(n,e={}){{let t=`Solana error #${n}; Decode this error by running \`npx @solana/errors decode -- ${n}`;return Object.keys(e).length&&(t+=` '${o6e(e)}'`),`${t}\``}}var K2=class extends Error{constructor(...[t,r]){let i,s;if(r){const{cause:a,...c}=r;a&&(s={cause:a}),Object.keys(c).length>0&&(i=c)}const o=a6e(t,i);super(o,s);Ts(this,"cause",this.cause);Ts(this,"context");this.context={__code:t,...i},this.name="SolanaError"}};function c6e(n,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(n)}function l6e(n){return Object.freeze({...n,encode:e=>{const t=new Uint8Array(c6e(e,n));return n.write(e,t,0),t}})}function u6e(n){return Object.freeze({...n,decode:(e,t=0)=>n.read(e,t)[0]})}function c2(n){return"fixedSize"in n&&typeof n.fixedSize=="number"}function d6e(n,e){if(c2(n)!==c2(e))throw new K2(t6e);if(c2(n)&&c2(e)&&n.fixedSize!==e.fixedSize)throw new K2(n6e,{decoderFixedSize:e.fixedSize,encoderFixedSize:n.fixedSize});if(!c2(n)&&!c2(e)&&n.maxSize!==e.maxSize)throw new K2(r6e,{decoderMaxSize:e.maxSize,encoderMaxSize:n.maxSize});return{...e,...n,decode:e.decode,encode:n.encode,read:e.read,write:n.write}}function h6e(n,e,t=0){if(e.length-t<=0)throw new K2(JIe,{codecDescription:n})}function f6e(n,e,t,r=0){const i=t.length-r;if(i<e)throw new K2(e6e,{bytesLength:i,codecDescription:n,expected:e})}function p6e(n,e,t,r){if(r<e||r>t)throw new K2(i6e,{codecDescription:n,max:t,min:e,value:r})}function Nne(n){return(n==null?void 0:n.endian)!==1}function g6e(n){return l6e({fixedSize:n.size,write(e,t,r){n.range&&p6e(n.name,n.range[0],n.range[1],e);const i=new ArrayBuffer(n.size);return n.set(new DataView(i),e,Nne(n.config)),t.set(new Uint8Array(i),r),r+n.size}})}function m6e(n){return u6e({fixedSize:n.size,read(e,t=0){h6e(n.name,e,t),f6e(n.name,n.size,e,t);const r=new DataView(w6e(e,t,n.size));return[n.get(r,Nne(n.config)),t+n.size]}})}function w6e(n,e,t){const r=n.byteOffset+(e??0),i=t??n.byteLength;return n.buffer.slice(r,r+i)}var y6e=(n={})=>g6e({config:n,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,t,r)=>e.setBigUint64(0,BigInt(t),r),size:8}),b6e=(n={})=>m6e({config:n,get:(e,t)=>e.getBigUint64(0,t),name:"u64",size:8}),v6e=(n={})=>d6e(y6e(n),b6e(n));let x6e=class extends TypeError{constructor(e,t){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}};function E6e(n){return YC(n)&&typeof n[Symbol.iterator]=="function"}function YC(n){return typeof n=="object"&&n!=null}function vN(n){return YC(n)&&!Array.isArray(n)}function th(n){return typeof n=="symbol"?n.toString():typeof n=="string"?JSON.stringify(n):`${n}`}function A6e(n){const{done:e,value:t}=n.next();return e?void 0:t}function S6e(n,e,t,r){if(n===!0)return;n===!1?n={}:typeof n=="string"&&(n={message:n});const{path:i,branch:s}=e,{type:o}=t,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${th(r)}\``}=n;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...n,message:c}}function*jV(n,e,t,r){E6e(n)||(n=[n]);for(const i of n){const s=S6e(i,e,t,r);s&&(yield s)}}function*G$(n,e,t={}){const{path:r=[],branch:i=[n],coerce:s=!1,mask:o=!1}=t,a={path:r,branch:i,mask:o};s&&(n=e.coercer(n,a));let c="valid";for(const u of e.validator(n,a))u.explanation=t.message,c="not_val
997id",yield[u,void 0];for(let[u,d,f]of e.entries(n,a)){const m=G$(d,f,{path:u===void 0?r:[...r,u],branch:u===void 0?i:[...i,d],coerce:s,mask:o,message:t.message});for(const w of m)w[0]?(c=w[0].refinement!=null?"not_refined":"not_valid",yield[w[0],void 0]):s&&(d=w[1],u===void 0?n=d:n instanceof Map?n.set(u,d):n instanceof Set?n.add(d):YC(n)&&(d!==void 0||u in n)&&(n[u]=d))}if(c!=="not_valid")for(const u of e.refiner(n,a))u.explanation=t.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,n])}let qf=class{constructor(e){const{type:t,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const d=i(c,u);return jV(d,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const d=s(c,u);return jV(d,u,this,c)}:this.refiner=()=>[]}assert(e,t){return _6e(e,this,t)}create(e,t){return Vt(e,this,t)}is(e){return Rne(e,this)}mask(e,t){return C6e(e,this,t)}validate(e,t={}){return GC(e,this,t)}};function _6e(n,e,t){const r=GC(n,e,{message:t});if(r[0])throw r[0]}function Vt(n,e,t){const r=GC(n,e,{coerce:!0,message:t});if(r[0])throw r[0];return r[1]}function C6e(n,e,t){const r=GC(n,e,{coerce:!0,mask:!0,message:t});if(r[0])throw r[0];return r[1]}function Rne(n,e){return!GC(n,e)[0]}function GC(n,e,t={}){const r=G$(n,e,t),i=A6e(r);return i[0]?[new x6e(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function K1(n,e){return new qf({type:n,schema:null,validator:e})}function T6e(){return K1("any",()=>!0)}function Qt(n){return new qf({type:"array",schema:n,*entries(e){if(n&&Array.isArray(e))for(const[t,r]of e.entries())yield[t,r,n]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${th(e)}`}})}function jf(){return K1("boolean",n=>typeof n=="boolean")}function Z$(n){return K1("instance",e=>e instanceof n||`Expected a \`${n.name}\` instance, but received: ${th(e)}`)}function bs(n){const e=th(n),t=typeof n;return new qf({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?n:null,validator(r){return r===n||`Expected the literal \`${e}\`, but received: ${th(r)}`}})}function I6e(){return K1("never",()=>!1)}function en(n){return new qf({...n,validator:(e,t)=>e===null||n.validator(e,t),refiner:(e,t)=>e===null||n.refiner(e,t)})}function Ke(){return K1("number",n=>typeof n=="number"&&!isNaN(n)||`Expected a number, but received: ${th(n)}`)}function qn(n){return new qf({...n,validator:(e,t)=>e===void 0||n.validator(e,t),refiner:(e,t)=>e===void 0||n.refiner(e,t)})}function Mne(n,e){return new qf({type:"record",schema:null,*entries(t){if(YC(t))for(const r in t){const i=t[r];yield[r,r,n],yield[r,i,e]}},validator(t){return vN(t)||`Expected an object, but received: ${th(t)}`},coercer(t){return vN(t)?{...t}:t}})}function Lt(){return K1("string",n=>typeof n=="string"||`Expected a string, but received: ${th(n)}`)}function Q$(n){const e=I6e();return new qf({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const r=Math.max(n.length,t.length);for(let i=0;i<r;i++)yield[i,t[i],n[i]||e]}},validator(t){return Array.isArray(t)||`Expected an array, but received: ${th(t)}`},coercer(t){return Array.isArray(t)?t.slice():t}})}function Ct(n){const e=Object.keys(n);return new qf({type:"type",schema:n,*entries(t){if(YC(t))for(const r of e)yield[r,t[r],n[r]]},validator(t){return vN(t)||`Expected an object, but received: ${th(t)}`},coercer(t){return vN(t)?{...t}:t}})}function Sc(n){const e=n.map(t=>t.type).join(" | ");return new qf({type:"union",schema:null,coercer(t,r){for(const i of n){const[s,o]=i.validate(t,{coerce:!0,mask:r.mask});if(!s)return o}return t},validator(t,r){const i=[];for(const s of n){const[...o]=G$(t,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${th(t)}`,...i]}})}function tE(){return K1("unknown",()=>!0)}function ZC(n,e,t){return new qf({...n,coercer:(r,i)=>Rne(r,e)?n.coercer(t(r,i),i):n.coercer(r,i)})}var _I,N6e=new Uint8Array(16);function kne(){if(!_I&&(_I=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!_I))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _I(N6e)}const R6e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function sR(n){return typeof n=="string"&&R6e.test(n)}var Yo=[];for(var BO=0;BO<256;++BO)Yo.push((BO+256).toString(16).substr(1));function oR(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Yo[n[e+0]]+Yo[n[e+1]]+Yo[n[e+2]]+Yo[n[e+3]]+"-"+Yo[n[e+4]]+Yo[n[e+5]]+"-"+Yo[n[e+6]]+Yo[n[e+7]]+"-"+Yo[n[e+8]]+Yo[n[e+9]]+"-"+Yo[n[e+10]]+Yo[n[e+11]]+Yo[n[e+12]]+Yo[n[e+13]]+Yo[n[e+14]]+Yo[n[e+15]]).toLowerCase();
vendor: 10,070 bytes, line 997
997if(!sR(t))throw TypeError("Stringified UUID is invalid");return t}var zV,LO,$O=0,UO=0;function M6e(n,e,t){var r=e&&t||0,i=e||new Array(16);n=n||{};var s=n.node||zV,o=n.clockseq!==void 0?n.clockseq:LO;if(s==null||o==null){var a=n.random||(n.rng||kne)();s==null&&(s=zV=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=LO=(a[6]<<8|a[7])&16383)}var c=n.msecs!==void 0?n.msecs:Date.now(),u=n.nsecs!==void 0?n.nsecs:UO+1,d=c-$O+(u-UO)/1e4;if(d<0&&n.clockseq===void 0&&(o=o+1&16383),(d<0||c>$O)&&n.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");$O=c,UO=u,LO=o,c+=122192928e5;var f=((c&268435455)*1e4+u)%4294967296;i[r++]=f>>>24&255,i[r++]=f>>>16&255,i[r++]=f>>>8&255,i[r++]=f&255;var m=c/4294967296*1e4&268435455;i[r++]=m>>>8&255,i[r++]=m&255,i[r++]=m>>>24&15|16,i[r++]=m>>>16&255,i[r++]=o>>>8|128,i[r++]=o&255;for(var w=0;w<6;++w)i[r+w]=s[w];return e||oR(i)}function One(n){if(!sR(n))throw TypeError("Invalid UUID");var e,t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}function k6e(n){n=unescape(encodeURIComponent(n));for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}var O6e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",P6e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Pne(n,e,t){function r(i,s,o,a){if(typeof i=="string"&&(i=k6e(i)),typeof s=="string"&&(s=One(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+i.length);if(c.set(s),c.set(i,s.length),c=t(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,o){a=a||0;for(var u=0;u<16;++u)o[a+u]=c[u];return o}return oR(c)}try{r.name=n}catch{}return r.DNS=O6e,r.URL=P6e,r}function D6e(n){if(typeof n=="string"){var e=unescape(encodeURIComponent(n));n=new Uint8Array(e.length);for(var t=0;t<e.length;++t)n[t]=e.charCodeAt(t)}return B6e(L6e($6e(n),n.length*8))}function B6e(n){for(var e=[],t=n.length*32,r="0123456789abcdef",i=0;i<t;i+=8){var s=n[i>>5]>>>i%32&255,o=parseInt(r.charAt(s>>>4&15)+r.charAt(s&15),16);e.push(o)}return e}function Dne(n){return(n+64>>>9<<4)+14+1}function L6e(n,e){n[e>>5]|=128<<e%32,n[Dne(e)-1]=e;for(var t=1732584193,r=-271733879,i=-1732584194,s=271733878,o=0;o<n.length;o+=16){var a=t,c=r,u=i,d=s;t=La(t,r,i,s,n[o],7,-680876936),s=La(s,t,r,i,n[o+1],12,-389564586),i=La(i,s,t,r,n[o+2],17,606105819),r=La(r,i,s,t,n[o+3],22,-1044525330),t=La(t,r,i,s,n[o+4],7,-176418897),s=La(s,t,r,i,n[o+5],12,1200080426),i=La(i,s,t,r,n[o+6],17,-1473231341),r=La(r,i,s,t,n[o+7],22,-45705983),t=La(t,r,i,s,n[o+8],7,1770035416),s=La(s,t,r,i,n[o+9],12,-1958414417),i=La(i,s,t,r,n[o+10],17,-42063),r=La(r,i,s,t,n[o+11],22,-1990404162),t=La(t,r,i,s,n[o+12],7,1804603682),s=La(s,t,r,i,n[o+13],12,-40341101),i=La(i,s,t,r,n[o+14],17,-1502002290),r=La(r,i,s,t,n[o+15],22,1236535329),t=$a(t,r,i,s,n[o+1],5,-165796510),s=$a(s,t,r,i,n[o+6],9,-1069501632),i=$a(i,s,t,r,n[o+11],14,643717713),r=$a(r,i,s,t,n[o],20,-373897302),t=$a(t,r,i,s,n[o+5],5,-701558691),s=$a(s,t,r,i,n[o+10],9,38016083),i=$a(i,s,t,r,n[o+15],14,-660478335),r=$a(r,i,s,t,n[o+4],20,-405537848),t=$a(t,r,i,s,n[o+9],5,568446438),s=$a(s,t,r,i,n[o+14],9,-1019803690),i=$a(i,s,t,r,n[o+3],14,-187363961),r=$a(r,i,s,t,n[o+8],20,1163531501),t=$a(t,r,i,s,n[o+13],5,-1444681467),s=$a(s,t,r,i,n[o+2],9,-51403784),i=$a(i,s,t,r,n[o+7],14,1735328473),r=$a(r,i,s,t,n[o+12],20,-1926607734),t=Ua(t,r,i,s,n[o+5],4,-378558),s=Ua(s,t,r,i,n[o+8],11,-2022574463),i=Ua(i,s,t,r,n[o+11],16,1839030562),r=Ua(r,i,s,t,n[o+14],23,-35309556),t=Ua(t,r,i,s,n[o+1],4,-1530992060),s=Ua(s,t,r,i,n[o+4],11,1272893353),i=Ua(i,s,t,r,n[o+7],16,-155497632),r=Ua(r,i,s,t,n[o+10],23,-1094730640),t=Ua(t,r,i,s,n[o+13],4,681279174),s=Ua(s,t,r,i,n[o],11,-358537222),i=Ua(i,s,t,r,n[o+3],16,-722521979),r=Ua(r,i,s,t,n[o+6],23,76029189),t=Ua(t,r,i,s,n[o+9],4,-640364487),s=Ua(s,t,r,i,n[o+12],11,-421815835),i=Ua(i,s,t,r,n[o+15],16,530742520),r=Ua(r,i,s,t,n[o+2],23,-995338651),t=ja(t,r,i,s,n[o],6,-198630844),s=ja(s,t,r,i,n[o+7],10,1126891415),i=ja(i,s,t,r,n[o+14],15,-1416354905),r=ja(r,i,s,t,n[o+5],21,-57434055),t=ja(t,r,i,s,n[o+12],6,1700485571),s=ja(s,t,r,i,n[o+3],10,-1894986606),i=ja(i,s,t,r,n[o+10],15,-1051523),r=ja(r,i,s,t,n[o+1],21,-2054922799),t=ja(t,r,i,s,n[o+8],6,1873313359),s=ja(s,t,r,i,n[o+15],10,-30611744),i=ja(i,s,t,r,n[o+6],15,-1560198380),r=ja(r,i,s,t,n[o+13],21,1309151649),t=ja(t,r,i,s,n[o+4],6,-145523070),s=ja(s,t,r,i,n[o+11],10,-1120210379),i=ja(i,s,t,r,n[o+2],15,718787259),r=ja(r,i,s,t,n[o+9],21,-343485551),t=t0(t,a),r=t0(r,c),i=t0(i,u),s=t0(s,d)}return[t,r,i,s]}function $6e(n){if(n.length===0)return[];for(var e=n.length*8,t=new Uint32Array(Dne(e)),r=0;r<e;r+=8)t[r>>5]|=(n[r/8]&255)<<r%32;return t}function t0(n,e){var t=(n&65535)+(e&65535),r=(n>>16)+(e>>16)+(t>>16);return r<<16|t&65535}function U6e(n,e){return n<<e|n>>>32-e}function aR(n,e,t,r,i,s){return t0(U6e(t0(t0(e,n),t0(r,s)),i),t)}function La(n,e,t,r,i,s,o){return aR(e&t|~e&r,n,e,i,s,o)}function $a(n,e,t,r,i,s,o){return aR(e&r|t&~r,n,e,i,s,o)}function Ua(n,e,t,r,i,s,o){return aR(e^t^r,n,e,i,s,o)}function ja(n,e,t,r,i,s,o){return aR(t^(e|~r),n,e,i,s,o)}var j6e=Pne("v3",48,D6e);function z6e(n,e,t){n=n||{};var r=n.random||(n.rng||kne)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(var i=0;i<16;++i)e[t+i]=r[i];return e}return oR(r)}function F6e(n,e,t,r){switch(n){case 0:return e&t^~e&r;case 1:return e^t^r;case 2:return e&t^e&r^t&r;case 3:return e^t^r}}function jO(n,e){return n<<e|n>>>32-e}function W6e(n){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof n=="string"){var r=unescape(encodeURIComponent(n));n=[];for(var i=0;i<r.length;++i)n.push(r.charCodeAt(i))}else Array.isArray(n)||(n=Array.prototype.slice.call(n));n.push(128);for(var s=n.length/4+2,o=Math.ceil(s/16),a=new Array(o),c=0;c<o;++c){for(var u=new Uint32Array(16),d=0;d<16;++d)u[d]=n[c*64+d*4]<<24|n[c*64+d*4+1]<<16|n[c*64+d*4+2]<<8|n[c*64+d*4+3];a[c]=u}a[o-1][14]=(n.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(n.length-1)*8&4294967295;for(var f=0;f<o;++f){for(var m=new Uint32Array(80),w=0;w<16;++w)m[w]=a[f][w];for(var y=16;y<80;++y)m[y]=jO(m[y-3]^m[y-8]^m[y-14]^m[y-16],1);for(var b=t[0],E=t[1],T=t[2],N=t[3],I=t[4],H=0;H<80;++H){var L=Math.floor(H/20),U=jO(b,5)+F6e(L,E,T,N)+I+e[L]+m[H]>>>0;I=N,N=T,T=jO(E,30)>>>0,E=b,b=U}t[0]=t[0]+b>>>0,t[1]=t[1]+E>>>0,t[2]=t[2]+T>>>0,t[3]=t[3]+N>>>0,t[4]=t[4]+I>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var H6e=Pne("v5",80,W6e);const V6e="00000000-0000-0000-0000-000000000000";function q6e(n){if(!sR(n))throw TypeError("Invalid UUID");return parseInt(n.substr(14,1),16)}const K6e=Object.freeze(Object.defineProperty({__proto__:null,NIL:V6e,parse:One,stringify:oR,v1:M6e,v3:j6e,v4:z6e,v5:H6e,validate:sR,version:q6e},Symbol.toStringTag,{value:"Module"})),Bne=Vx(K6e);var zO,FV;function Y6e(){if(FV)return zO;FV=1;const n=Bne.v4;return zO=function(t,r,i,s){if(typeof t!="string")throw new TypeError(t+" must be a string");s=s||{};const o=typeof s.version=="number"?s.version:2;if(o!==1&&o!==2)throw new TypeError(o+" must be 1 or 2");const a={method:t};if(o===2&&(a.jsonrpc="2.0"),r){if(typeof r!="object"&&!Array.isArray(r))throw new TypeError(r+" must be an object, array or omitted");a.params=r}if(typeof i>"u"){const c=typeof s.generator=="function"?s.generator:function(){return n()};a.id=c(a,s)}else o===2&&i===null?s.notificationIdNull&&(a.id=null):a.id=i;return a},zO}var FO,WV;function G6e(){if(WV)return FO;WV=1;const n=Bne.v4,e=Y6e(),t=function(r,i){if(!(this instanceof t))return new t(r,i);i||(i={}),this.options={reviver:typeof i.reviver<"u"?i.reviver:null,replacer:typeof i.replacer<"u"?i.replacer:null,generator:typeof i.generator<"u"?i.generator:function(){return n()},version:typeof i.version<"u"?i.version:2,notificationIdNull:typeof i.notificationIdNull=="boolean"?i.notificationIdNull:!1},this.callServer=r};return FO=t,t.prototype.request=function(r,i,s,o){const a=this;let c=null;const u=Array.isArray(r)&&typeof i=="function";if(this.options.version===1&&u)throw new TypeError("JSON-RPC 1.0 does not support batching");if(u||!u&&r&&typeof r=="object"&&typeof i=="function")o=i,c=r;else{typeof s=="function"&&(o=s,s=void 0);const m=typeof o=="function";try{c=e(r,i,s,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(w){if(m)return o(w);throw w}if(!m)return c}let f;try{f=JSON.stringify(c,this.options.replacer)}catch(m){return o(m)}return this.callServer(f,function(m,w){a._parseResponse(m,w,o)}),c},t.prototype._parseResponse=function(r,i,s){if(r){s(r);return}if(!i)return s();let o;try{o=JSON.parse(i,this.options.reviver)}catch(a){return s(a)}if(s.length===3)if(Array.isArray(o)){const a=function(u){return typeof u.error<"u"},c=function(u){return!a(u)};return s(null,o.filter(a),o.filter(c))}else return s(null,o.error,o.result);s(null,o)},FO}var Z6e=G6e();const Lne=xo(Z6e);var WO={exports:{}},HV;function $ne(){return HV||(HV=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,f,m){if(typeof d!="function")throw new TypeError("The listener must be a function");var w=new i(d,f||c,m),y=t?t+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],w]:c._events[y].push(w):(c._events[y]=w,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function a(){this._events=new r,this._eventsCount=0}
vendor: 2,336 bytes, line 997
997a.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)e.call(d,f)&&u.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},a.prototype.listeners=function(u){var d=t?t+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,w=f.length,y=new Array(w);m<w;m++)y[m]=f[m].fn;return y},a.prototype.listenerCount=function(u){var d=t?t+u:u,f=this._events[d];return f?f.fn?1:f.length:0},a.prototype.emit=function(u,d,f,m,w,y){var b=t?t+u:u;if(!this._events[b])return!1;var E=this._events[b],T=arguments.length,N,I;if(E.fn){switch(E.once&&this.removeListener(u,E.fn,void 0,!0),T){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,d),!0;case 3:return E.fn.call(E.context,d,f),!0;case 4:return E.fn.call(E.context,d,f,m),!0;case 5:return E.fn.call(E.context,d,f,m,w),!0;case 6:return E.fn.call(E.context,d,f,m,w,y),!0}for(I=1,N=new Array(T-1);I<T;I++)N[I-1]=arguments[I];E.fn.apply(E.context,N)}else{var H=E.length,L;for(I=0;I<H;I++)switch(E[I].once&&this.removeListener(u,E[I].fn,void 0,!0),T){case 1:E[I].fn.call(E[I].context);break;case 2:E[I].fn.call(E[I].context,d);break;case 3:E[I].fn.call(E[I].context,d,f);break;case 4:E[I].fn.call(E[I].context,d,f,m);break;default:if(!N)for(L=1,N=new Array(T-1);L<T;L++)N[L-1]=arguments[L];E[I].fn.apply(E[I].context,N)}}return!0},a.prototype.on=function(u,d,f){return s(this,u,d,f,!1)},a.prototype.once=function(u,d,f){return s(this,u,d,f,!0)},a.prototype.removeListener=function(u,d,f,m){var w=t?t+u:u;if(!this._events[w])return this;if(!d)return o(this,w),this;var y=this._events[w];if(y.fn)y.fn===d&&(!m||y.once)&&(!f||y.context===f)&&o(this,w);else{for(var b=0,E=[],T=y.length;b<T;b++)(y[b].fn!==d||m&&!y[b].once||f&&y[b].context!==f)&&E.push(y[b]);E.length?this._events[w]=E.length===1?E[0]:E:o(this,w)}return this},a.prototype.removeAllListeners=function(u){var d;return u?(d=t?t+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a}(WO)),WO.exports}var Q6e=$ne();const X$=xo(Q6e);var X6e=class extends X${constructor(e,t,r){super();Ts(this,"socket");this.socket=new window.WebSocket(e,r),this.socket.onopen=()=>
vendor: 4,383 bytes, line 997
997this.emit("open"),this.socket.onmessage=i=>this.emit("message",i.data),this.socket.onerror=i=>this.emit("error",i),this.socket.onclose=i=>{this.emit("close",i.code,i.reason)}}send(e,t,r){const i=r||t;try{this.socket.send(e),i()}catch(s){i(s)}}close(e,t){this.socket.close(e,t)}addEventListener(e,t,r){this.socket.addEventListener(e,t,r)}};function Une(n,e){return new X6e(n,e)}var J6e=class{encode(n){return JSON.stringify(n)}decode(n){return JSON.parse(n)}},jne=class extends X${constructor(e,t="ws://localhost:8080",{autoconnect:r=!0,reconnect:i=!0,reconnect_interval:s=1e3,max_reconnects:o=5,...a}={},c,u){super();Ts(this,"address");Ts(this,"rpc_id");Ts(this,"queue");Ts(this,"options");Ts(this,"autoconnect");Ts(this,"ready");Ts(this,"reconnect");Ts(this,"reconnect_timer_id");Ts(this,"reconnect_interval");Ts(this,"max_reconnects");Ts(this,"rest_options");Ts(this,"current_reconnects");Ts(this,"generate_request_id");Ts(this,"socket");Ts(this,"webSocketFactory");Ts(this,"dataPack");this.webSocketFactory=e,this.queue={},this.rpc_id=0,this.address=t,this.autoconnect=r,this.ready=!1,this.reconnect=i,this.reconnect_timer_id=void 0,this.reconnect_interval=s,this.max_reconnects=o,this.rest_options=a,this.current_reconnects=0,this.generate_request_id=c||(()=>typeof this.rpc_id=="number"?++this.rpc_id:Number(this.rpc_id)+1),u?this.dataPack=u:this.dataPack=new J6e,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,t,r,i){return!i&&typeof r=="object"&&(i=r,r=null),new Promise((s,o)=>{if(!this.ready)return o(new Error("socket not ready"));const a=this.generate_request_id(e,t),c={jsonrpc:"2.0",method:e,params:t||void 0,id:a};this.socket.send(this.dataPack.encode(c),i,u=>{if(u)return o(u);this.queue[a]={promise:[s,o]},r&&(this.queue[a].timeout=setTimeout(()=>{delete this.queue[a],o(new Error("reply timeout"))},r))})})}async login(e){const t=await this.call("rpc.login",e);if(!t)throw new Error("authentication failed");return t}async listMethods(){return await this.call("__listMethods")}notify(e,t){return new Promise((r,i)=>{if(!this.ready)return i(new Error("socket not ready"));const s={jsonrpc:"2.0",method:e,params:t};this.socket.send(this.dataPack.encode(s),o=>{if(o)return i(o);r()})})}async subscribe(e){typeof e=="string"&&(e=[e]);const t=await this.call("rpc.on",e);if(typeof e=="string"&&t[e]!=="ok")throw new Error("Failed subscribing to an event '"+e+"' with: "+t[e]);return t}async unsubscribe(e){typeof e=="string"&&(e=[e]);const t=await this.call("rpc.off",e);if(typeof e=="string"&&t[e]!=="ok")throw new Error("Failed unsubscribing from an event with: "+t);return t}close(e,t){this.socket.close(e||1e3,t)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}_connect(e,t){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:r})=>{r instanceof ArrayBuffer&&(r=Ot.from(r).toString());try{r=this.dataPack.decode(r)}catch{return}if(r.notification&&this.listeners(r.notification).length){if(!Object.keys(r.params).length)return this.emit(r.notification);const i=[r.notification];if(r.params.constructor===Object)i.push(r.params);else for(let s=0;s<r.params.length;s++)i.push(r.params[s]);return Promise.resolve().then(()=>{this.emit.apply(this,i)})}if(!this.queue[r.id])return r.method?Promise.resolve().then(()=>{this.emit(r.method,r==null?void 0:r.params)}):void 0;"error"in r=="result"in r&&this.queue[r.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[r.id].timeout&&clearTimeout(this.queue[r.id].timeout),r.error?this.queue[r.id].promise[1](r.error):this.queue[r.id].promise[0](r.result),delete this.queue[r.id]}),this.socket.addEventListener("error",r=>this.emit("error",r)),this.socket.addEventListener("close",({code:r,reason:i})=>{this.ready&&setTimeout(()=>
997this.emit("close",r,i),0),this.ready=!1,this.socket=void 0,r!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(e,t),this.reconnect_interval)))})}};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function VV(n){n.lowS!==void 0&&g1("lowS",n.lowS),n.prehash!==void 0&&g1("prehash",n.prehash)}let eNe=class extends Error{constructor(e=""){super(e)}};const Hp={Err:eNe,_tlv:{encode:(n,e)=>{const{Err:t}=Hp;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");const r=e.length/2,i=AI(r);if(i.length/2&128)throw new t("tlv.encode: long form length too big");const s=r>127?AI(i.length/2|128):"";return AI(n)+s+i+e},decode(n,e){const{Err:t}=Hp;let r=0;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[r++]!==n)throw new t("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new t("tlv.decode(long): indefinite length not supported");if(c>4)throw new t("tlv.decode(long): byte length is too big");const u=e.subarray(r,r+c);if(u.length!==c)throw new t("tlv.decode: length bytes not complete");if(u[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const d of u)o=o<<8|d;if(r+=c,o<128)throw new t("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new t("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(n){const{Err:e}=Hp;if(n<TS)throw new e("integer: negative integers are not allowed");let t=AI(n);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return t},decode(n){const{Err:e}=Hp;if(n[0]&128)throw new e("invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return eR(n)}},toSig(n){const{Err:e,_int:t,_tlv:r}=Hp,i=Vs("signature",n),{v:s,l:o}=r.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:u,l:d}=r.decode(2,c);if(d.length)throw new e("invalid signature: left bytes after parsing");return{r:t.decode(a),s:t.decode(u)}},hexFromSig(n){const{_tlv:e,_int:t}=Hp,r=e.encode(2,t.encode(n.r)),i=e.encode(2,t.encode(n.s)),s=r+i;return e.encode(48,s)}},TS=BigInt(0),IS=BigInt(1),tNe=BigInt(2),CI=BigInt(3),nNe=BigInt(4);function rNe(n,e,t){function r(i){const s=n.sqr(i),o=n.mul(s,i);return n.add(n.add(o,n.mul(i,e)),t)}return r}function zne(n,e,t){const{BYTES:r}=n;function i(s){let o;if(typeof s=="bigint")o=s;else{let a=Vs("private key",s);if(e){if(!e.includes(a.length*2))throw new Error("invalid private key");const c=new Uint8Array(r);c.set(a,c.length-a.length),a=c}try{o=n.fromBytes(a)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof s}`)}}if(t&&(o=n.create(o)),!n.isValidNot0(o))throw new Error("invalid private key: out of range [1..N-1]");return o}return i}function iNe(n,e={}){const{Fp:t,Fn:r}=Cne("weierstrass",n,e),{h:i,n:s}=n;qC(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:o}=e;if(o&&(!t.is0(n.a)||typeof o.beta!="bigint"||typeof o.splitScalar!="function"))throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');function a(){if(!t.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function c(Y,k,j){const{x:V,y:W}=k.toAffine(),$=t.toBytes(V);if(g1("isCompressed",j),j){a();const A=!t.isOdd(W);return vo(Fne(A),$)}else return vo(Uint8Array.of(4),$,t.toBytes(W))}function u(Y){nu(Y);const k=t.BYTES,j=k+1,V=2*k+1,W=Y.length,$=Y[0],A=Y.subarray(1);if(W===j&&($===2||$===3)){const _=t.fromBytes(A);if(!t.isValid(_))throw new Error("bad point: is not on curve, wrong x");const R=m(_);let P;try{P=t.sqrt(R)}catch(z){const B=z instanceof Error?": "+z.message:"";throw new Error("bad point: is not on curve, sqrt error"+B)}a();const q=t.isOdd(P);return($&1)===1!==q&&(P=t.neg(P)),{x:_,y:P}}else if(W===V&&$===4){const _=t.fromBytes(A.subarray(k*0,k*1)),R=t.fromBytes(A.subarray(k*1,k*2));if(!w(_,R))throw new Error("bad point: is not on curve");return{x:_,y:R}}else throw new Error(`bad point: got length ${W}, expected compressed=${j} or uncompressed=${V}`)}const d=e.toBytes||c,f=e.fromBytes||u,m=rNe(t,n.a,n.b);function w(Y,k){const j=t.sqr(k),V=m(Y);return t.eql(j,V)}if(!w(n.Gx,n.Gy))throw new Error("bad curve params: generator point");const y=t.mul(t.pow(n.a,CI),nNe),b=t.mul(t.sqr(n.b),BigInt(27));if(t.is0(t.add(y,b)))throw new Error("bad curve params: a or b");function E(Y,k,j=!1){if(!t.isValid(k)||j&&t.is0(k))throw new Error(`bad point coordinate ${Y}`);return k}function T(Y){if(!(Y instanceof L))throw new Error("ProjectivePoint expected")}const N=pN((Y,k)=>{const{px:j,py:V,pz:W}=Y;if(t.eql(W,t.ONE))return{x:j,y:V};const $=Y.is0();k==null&&(k=$?t.ONE:t.inv(W));const A=t.mul(j,k),_=t.mul(V,k),R=t.mul(W,k);if($)return{x:t.ZERO,y:t.ZERO};
vendor: 6,638 bytes, line 997
997if(!t.eql(R,t.ONE))throw new Error("invZ was invalid");return{x:A,y:_}}),I=pN(Y=>{if(Y.is0()){if(e.allowInfinityPoint&&!t.is0(Y.py))return;throw new Error("bad point: ZERO")}const{x:k,y:j}=Y.toAffine();if(!t.isValid(k)||!t.isValid(j))throw new Error("bad point: x or y not field elements");if(!w(k,j))throw new Error("bad point: equation left != right");if(!Y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function H(Y,k,j,V,W){return j=new L(t.mul(j.px,Y),j.py,j.pz),k=CS(V,k),j=CS(W,j),k.add(j)}class L{constructor(k,j,V){this.px=E("x",k),this.py=E("y",j,!0),this.pz=E("z",V),Object.freeze(this)}static fromAffine(k){const{x:j,y:V}=k||{};if(!k||!t.isValid(j)||!t.isValid(V))throw new Error("invalid affine point");if(k instanceof L)throw new Error("projective point not allowed");return t.is0(j)&&t.is0(V)?L.ZERO:new L(j,V,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(k){return xne(L,"pz",k)}static fromBytes(k){return nu(k),L.fromHex(k)}static fromHex(k){const j=L.fromAffine(f(Vs("pointHex",k)));return j.assertValidity(),j}static fromPrivateKey(k){const j=zne(r,e.allowedPrivateKeyLengths,e.wrapPrivateKey);return L.BASE.multiply(j(k))}static msm(k,j){return _ne(L,r,k,j)}precompute(k=8,j=!0){return K.setWindowSize(this,k),j||this.multiply(CI),this}_setWindowSize(k){this.precompute(k)}assertValidity(){I(this)}hasEvenY(){const{y:k}=this.toAffine();if(!t.isOdd)throw new Error("Field doesn't support isOdd");return!t.isOdd(k)}equals(k){T(k);const{px:j,py:V,pz:W}=this,{px:$,py:A,pz:_}=k,R=t.eql(t.mul(j,_),t.mul($,W)),P=t.eql(t.mul(V,_),t.mul(A,W));return R&&P}negate(){return new L(this.px,t.neg(this.py),this.pz)}double(){const{a:k,b:j}=n,V=t.mul(j,CI),{px:W,py:$,pz:A}=this;let _=t.ZERO,R=t.ZERO,P=t.ZERO,q=t.mul(W,W),F=t.mul($,$),z=t.mul(A,A),B=t.mul(W,$);return B=t.add(B,B),P=t.mul(W,A),P=t.add(P,P),_=t.mul(k,P),R=t.mul(V,z),R=t.add(_,R),_=t.sub(F,R),R=t.add(F,R),R=t.mul(_,R),_=t.mul(B,_),P=t.mul(V,P),z=t.mul(k,z),B=t.sub(q,z),B=t.mul(k,B),B=t.add(B,P),P=t.add(q,q),q=t.add(P,q),q=t.add(q,z),q=t.mul(q,B),R=t.add(R,q),z=t.mul($,A),z=t.add(z,z),q=t.mul(z,B),_=t.sub(_,q),P=t.mul(z,F),P=t.add(P,P),P=t.add(P,P),new L(_,R,P)}add(k){T(k);const{px:j,py:V,pz:W}=this,{px:$,py:A,pz:_}=k;let R=t.ZERO,P=t.ZERO,q=t.ZERO;const F=n.a,z=t.mul(n.b,CI);let B=t.mul(j,$),C=t.mul(V,A),M=t.mul(W,_),Z=t.add(j,V),J=t.add($,A);Z=t.mul(Z,J),J=t.add(B,C),Z=t.sub(Z,J),J=t.add(j,W);let ae=t.add($,_);return J=t.mul(J,ae),ae=t.add(B,M),J=t.sub(J,ae),ae=t.add(V,W),R=t.add(A,_),ae=t.mul(ae,R),R=t.add(C,M),ae=t.sub(ae,R),q=t.mul(F,J),R=t.mul(z,M),q=t.add(R,q),R=t.sub(C,q),q=t.add(C,q),P=t.mul(R,q),C=t.add(B,B),C=t.add(C,B),M=t.mul(F,M),J=t.mul(z,J),C=t.add(C,M),M=t.sub(B,M),M=t.mul(F,M),J=t.add(J,M),B=t.mul(C,J),P=t.add(P,B),B=t.mul(ae,J),R=t.mul(Z,R),R=t.sub(R,B),B=t.mul(Z,C),q=t.mul(ae,q),q=t.add(q,B),new L(R,P,q)}subtract(k){return this.add(k.negate())}is0(){return this.equals(L.ZERO)}multiply(k){const{endo:j}=e;if(!r.isValidNot0(k))throw new Error("invalid scalar: out of range");let V,W;const $=A=>K.wNAFCached(this,A,L.normalizeZ);if(j){const{k1neg:A,k1:_,k2neg:R,k2:P}=j.splitScalar(k),{p:q,f:F}=$(_),{p:z,f:B}=$(P);W=F.add(B),V=H(j.beta,q,z,A,R)}else{const{p:A,f:_}=$(k);V=A,W=_}return L.normalizeZ([V,W])[0]}multiplyUnsafe(k){const{endo:j}=e,V=this;if(!r.isValid(k))throw new Error("invalid scalar: out of range");if(k===TS||V.is0())return L.ZERO;if(k===IS)return V;if(K.hasPrecomputes(this))return this.multiply(k);if(j){const{k1neg:W,k1:$,k2neg:A,k2:_}=j.splitScalar(k),{p1:R,p2:P}=xIe(L,V,$,_);return H(j.beta,R,P,W,A)}else return K.wNAFCachedUnsafe(V,k)}multiplyAndAddUnsafe(k,j,V){const W=this.multiplyUnsafe(j).add(k.multiplyUnsafe(V));return W.is0()?void 0:W}toAffine(k){return N(this,k)}isTorsionFree(){const{isTorsionFree:k}=e;return i===IS?!0:k?k(L,this):K.wNAFCachedUnsafe(this,s).is0()}clearCofactor(){const{clearCofactor:k}=e;return i===IS?this:k?k(L,this):this.multiplyUnsafe(i)}toBytes(k=!0){return g1("isCompressed",k),this.assertValidity(),d(L,this,k)}toRawBytes(k=!0){return this.toBytes(k)}toHex(k=!0){return Jl(this.toBytes(k))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}L.BASE=new L(n.Gx,n.Gy,t.ONE),L.ZERO=new L(t.ZERO,t.ONE,t.ZERO),L.Fp=t,L.Fn=r;const U=r.BITS,K=Sne(L,e.endo?Math.ceil(U/2):U);return L}function Fne(n){return Uint8Array.of(n?2:3)}function sNe(n,e,t={}){qC(e,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=e.randomBytes||MC,i=e.hmac||((V,...W)=>i$(e.hash,V,vo(...W))),{Fp:s,Fn:o}=n,{ORDER:a,BITS:c}=o;function u(V){const W=a>>IS;return V>W}function d(V){return u(V)?o.neg(V):V}function f(V,W){if(!o.isValidNot0(W))throw new Error(`invalid signature ${V}: out of range 1..CURVE.n`)}class m{constructor(W,$,A){f("r",W),f("s",$),this.r=W,this.s=$,A!=null&&(this.recovery=A),Object.freeze(this)}static fromCompact(W){const $=o.BYTES,A=Vs("compactSignature",W,$*2);return new m(o.fromBytes(A.subarray(0,$)),o.fromBytes(A.subarray($,$*2)))}static fromDER(W){const{r:$,s:A}=Hp.toSig(Vs("DER",W));return new m($,A)}assertValidity(){}addRecoveryBit(W){return new m(this.r,this.s,W)}recoverPublicKey(W){const $=s.ORDER,{r:A,s:_,recovery:R}=this;if(R==null||![0,1,2,3].includes(R))throw new Error("recovery id invalid");if(a*tNe<$&&R>1)throw new Error("recovery id is ambiguous for h>1 curve");const q=R===2||R===3?A+a:A;if(!s.isValid(q))throw new Error("recovery id 2 or 3 invalid");const F=s.toBytes(q),z=n.fromHex(vo(Fne((R&1)===0),F)),B=o.inv(q),C=I(Vs("msgHash",W)),M=o.create(-C*B),Z=o.create(_*B),J=n.BASE.multiplyUnsafe(M).add(z.multiplyUnsafe(Z));if(J.is0())throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return u(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,o.neg(this.s),this.recovery):this}toBytes(W){if(W==="compact")return vo(o.toBytes(this.r),o.toBytes(this.s));if(W==="der")return s1(Hp.hexFromSig(this));throw new Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Jl(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Jl(this.toBytes("compact"))}}const w=zne(o,t.allowedPrivateKeyLengths,t.wrapPrivateKey),y={isValidPrivateKey(V){try{return w(V),!0}catch{return!1}},normPrivateKeyToScalar:w,randomPrivateKey:()=>{const V=a;return yIe(r(vne(V)),V)},precompute(V=8,W=n.BASE){return W.precompute(V,!1)}};function b(V,W=!0){return n.fromPrivateKey(V).toBytes(W)}function E(V){if(typeof V=="bigint")return!1;if(V instanceof n)return!0;const $=Vs("key",V).length,A=s.BYTES,_=A+1,R=2*A+1;
997if(!(t.allowedPrivateKeyLengths||o.BYTES===_))return $===_||$===R}function T(V,W,$=!0){if(E(V)===!0)throw new Error("first arg must be private key");if(E(W)===!1)throw new Error("second arg must be public key");return n.fromHex(W).multiply(w(V)).toBytes($)}const N=e.bits2int||function(V){if(V.length>8192)throw new Error("input is too large");const W=eR(V),$=V.length*8-c;return $>0?W>>BigInt($):W},I=e.bits2int_modN||function(V){return o.create(N(V))},H=nR(c);function L(V){return T2("num < 2^"+c,V,TS,H),o.toBytes(V)}function U(V,W,$=K){if(["recovered","canonical"].some(Z=>Z in $))throw new Error("sign() legacy options not supported");const{hash:A}=e;let{lowS:_,prehash:R,extraEntropy:P}=$;_==null&&(_=!0),V=Vs("msgHash",V),VV($),R&&(V=Vs("prehashed msgHash",A(V)));const q=I(V),F=w(W),z=[L(F),L(q)];if(P!=null&&P!==!1){const Z=P===!0?r(s.BYTES):P;z.push(Vs("extraEntropy",Z))}const B=vo(...z),C=q;function M(Z){const J=N(Z);if(!o.isValidNot0(J))return;const ae=o.inv(J),we=n.BASE.multiply(J).toAffine(),he=o.create(we.x);if(he===TS)return;const xe=o.create(ae*o.create(C+he*F));if(xe===TS)return;let Se=(we.x===he?0:2)|Number(we.y&IS),Re=xe;return _&&u(xe)&&(Re=d(xe),Se^=1),new m(he,Re,Se)}return{seed:B,k2sig:M}}const K={lowS:e.lowS,prehash:!1},Y={lowS:e.lowS,prehash:!1};function k(V,W,$=K){const{seed:A,k2sig:_}=U(V,W,$);return cIe(e.hash.outputLen,o.BYTES,i)(A,_)}n.BASE.precompute(8);function j(V,W,$,A=Y){const _=V;W=Vs("msgHash",W),$=Vs("publicKey",$),VV(A);const{lowS:R,prehash:P,format:q}=A;if("strict"in A)throw new Error("options.strict was renamed to lowS");if(q!==void 0&&!["compact","der","js"].includes(q))throw new Error('format must be "compact", "der" or "js"');const F=typeof _=="string"||z1(_),z=!F&&!q&&typeof _=="object"&&_!==null&&typeof _.r=="bigint"&&typeof _.s=="bigint";if(!F&&!z)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let B,C;try{if(z)if(q===void 0||q==="js")B=new m(_.r,_.s);else throw new Error("invalid format");if(F){try{q!=="compact"&&(B=m.fromDER(_))}catch(Re){if(!(Re instanceof Hp.Err))throw Re}!B&&q!=="der"&&(B=m.fromCompact(_))}C=n.fromHex($)}catch{return!1}if(!B||R&&B.hasHighS())return!1;P&&(W=e.hash(W));const{r:M,s:Z}=B,J=I(W),ae=o.inv(Z),we=o.create(J*ae),he=o.create(M*ae),xe=n.BASE.multiplyUnsafe(we).add(C.multiplyUnsafe(he));return xe.is0()?!1:o.create(xe.x)===M}return Object.freeze({getPublicKey:b,getSharedSecret:T,sign:k,verify:j,utils:y,Point:n,Signature:m})}function oNe(n){const e={a:n.a,b:n.b,p:n.Fp.ORDER,n:n.n,h:n.h,Gx:n.Gx,Gy:n.Gy},t=n.Fp,r=eE(e.n,n.nBitLength),i={Fp:t,Fn:r,allowedPrivateKeyLengths:n.allowedPrivateKeyLengths,allowInfinityPoint:n.allowInfinityPoint,endo:n.endo,wrapPrivateKey:n.wrapPrivateKey,isTorsionFree:n.isTorsionFree,clearCofactor:n.clearCofactor,fromBytes:n.fromBytes,toBytes:n.toBytes};return{CURVE:e,curveOpts:i}}function aNe(n){const{CURVE:e,curveOpts:t}=oNe(n),r={hash:n.hash,hmac:n.hmac,randomBytes:n.randomBytes,lowS:n.lowS,bits2int:n.bits2int,bits2int_modN:n.bits2int_modN};return{CURVE:e,curveOpts:t,ecdsaOpts:r}}function cNe(n,e){return Object.assign({},e,{ProjectivePoint:e.Point,CURVE:n})}function lNe(n){const{CURVE:e,curveOpts:t,ecdsaOpts:r}=aNe(n),i=iNe(e,t),s=sNe(i,r,t);return cNe(n,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function uNe(n,e){const t=r=>lNe({...n,hash:r});return{...t(e),create:t}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const xN={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")};BigInt(0);const dNe=BigInt(1),z7=BigInt(2),qV=(n,e)=>(n+e/z7)/e;function hNe(n){const e=xN.p,t=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=n*n*n%e,d=u*u*n%e,f=Ns(d,t,e)*d%e,m=Ns(f,t,e)*d%e,w=Ns(m,z7,e)*u%e,y=Ns(w,i,e)*w%e,b=Ns(y,s,e)*y%e,E=Ns(b,a,e)*b%e,T=Ns(E,c,e)*E%e,N=Ns(T,a,e)*b%e,I=Ns(N,t,e)*d%e,H=Ns(I,o,e)*y%e,L=Ns(H,r,e)*u%e,U=Ns(L,z7,e);if(!F7.eql(F7.sqr(U),n))throw new Error("Cannot find square root");return U}const F7=eE(xN.p,void 0,void 0,{sqrt:hNe}),fNe=uNe({...xN,Fp:F7,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{const e=xN.n,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-dNe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=t,o=BigInt("0x100000000000000000000000000000000"),a=qV(s*n,e),c=qV(-r*n,e);let u=Ks(n-a*t-c*i,e),d=Ks(-a*r-c*s,e);const f=u>o,m=d>o;if(f&&(u=e-u),m&&(d=e-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:f,k1:u,k2neg:m,k2:d}}}},t$);KC.utils.randomPrivateKey;KC.getPublicKey;function KV(n){try{return KC.ExtendedPoint.fromHex(n),!0}catch{return!1}}const Wne=(n,e)=>KC.sign(n,e.slice(0,32)),pNe=KC.verify,Xo=n=>Ot.isBuffer(n)?n:n instanceof Uint8Array?Ot.from(n.buffer,n.byteOffset,n.byteLength):Ot.from(n);let gNe=class{constructor(e){Object.assign(this,e)}encode(){return Ot.from(q2.serialize(v6,this))}static decode(e){return q2.deserialize(v6,this,e)}
997static decodeUnchecked(e){return q2.deserializeUnchecked(v6,this,e)}};const v6=new Map;var Hne;const mNe=32,c0=32;function wNe(n){return n._bn!==void 0}let YV=1,Fn=class x2 extends gNe{constructor(e){if(super({}),this._bn=void 0,wNe(e))this._bn=e._bn;else{if(typeof e=="string"){const t=aa.decode(e);if(t.length!=c0)throw new Error("Invalid public key input");this._bn=new gN(t)}else this._bn=new gN(e);if(this._bn.byteLength()>c0)throw new Error("Invalid public key input")}}static unique(){const e=new x2(YV);return YV+=1,new x2(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return aa.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(Ot);if(e.length===c0)return e;const t=Ot.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const i=Ot.concat([e.toBuffer(),Ot.from(t),r.toBuffer()]),s=U6(i);return new x2(s)}static createProgramAddressSync(e,t){let r=Ot.alloc(0);e.forEach(function(s){if(s.length>mNe)throw new TypeError("Max seed length exceeded");r=Ot.concat([r,Xo(s)])}),r=Ot.concat([r,t.toBuffer(),Ot.from("ProgramDerivedAddress")]);const i=U6(r);if(KV(i))throw new Error("Invalid seeds, address must fall off the curve");return new x2(i)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r=255,i;for(;r!=0;){try{const s=e.concat(Ot.from([r]));i=this.createProgramAddressSync(s,t)}catch(s){if(s instanceof TypeError)throw s;r--;continue}return[i,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){const t=new x2(e);return KV(t.toBytes())}};Hne=Fn;Fn.default=new Hne("11111111111111111111111111111111");v6.set(Fn,{kind:"struct",fields:[["_bn","u256"]]});new Fn("BPFLoader1111111111111111111111111111111111");const Y2=1232,J$=127,EN=64;let Vne=class extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}};Object.defineProperty(Vne.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});let qne=class extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}};Object.defineProperty(qne.prototype,"name",{value:"TransactionExpiredTimeoutError"});let nS=class extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}};Object.defineProperty(nS.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});let AN=class{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e<t.length)return t[e];e-=t.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const r=new Map;this.keySegments().flat().forEach((s,o)=>{r.set(s.toBase58(),o)});const i=s=>{const o=r.get(s.toBase58());if(o===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return o};return e.map(s=>({programIdIndex:i(s.programId),accountKeyIndexes:s.keys.map(o=>i(o.pubkey)),data:s.data}))}};const Or=(n="publicKey")=>ie.blob(32,n),yNe=(n="signature")=>ie.blob(64,n),I2=(n="string")=>{const e=ie.struct([ie.u32("length"),ie.u32("lengthPadding"),ie.blob(ie.offset(ie.u32(),-8),"chars")],n),t=e.decode.bind(e),r=e.encode.bind(e),i=e;return i.decode=(s,o)=>t(s,o).chars.toString(),i.encode=(s,o,a)=>{const c={chars:Ot.from(s,"utf8")};return r(c,o,a)},i.alloc=s=>ie.u32().span+ie.u32().span+Ot.from(s,"utf8").length,i},bNe=(n="authorized")=>ie.struct([Or("staker"),Or("withdrawer")],n),vNe=(n="lockup")=>ie.struct([ie.ns64("unixTimestamp"),ie.ns64("epoch"),Or("custodian")],n),xNe=(n="voteInit")=>ie.struct([Or("nodePubkey"),Or("authorizedVoter"),Or("authorizedWithdrawer"),ie.u8("commission")],n),ENe=(n="voteAuthorizeWithSeedArgs")=>ie.struct([ie.u32("voteAuthorizationType"),Or("currentAuthorityDerivedKeyOwnerPubkey"),I2("currentAuthorityDerivedKeySeed"),Or("newAuthorized")],n);function Kne(n,e){const t=i=>{if(i.span>=0)return i.span;if(typeof i.alloc=="function")return i.alloc(e[i.property]);if("count"in i&&"elementLayout"in i){const s=e[i.property];if(Array.isArray(s))return s.length*t(i.elementLayout)}else if("fields"in i)return Kne({layout:i},e[i.property]);return 0};let r=0;return n.layout.fields.forEach(i=>
997{r+=t(i)}),r}function ql(n){let e=0,t=0;for(;;){let r=n.shift();if(e|=(r&127)<<t*7,t+=1,(r&128)===0)break}return e}function Kl(n,e){let t=e;for(;;){let r=t&127;if(t>>=7,t==0){n.push(r);break}else r|=128,n.push(r)}}function fs(n,e){if(!n)throw new Error(e||"Assertion failed")}let Yne=class Gne{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const r=new Map,i=o=>{const a=o.toBase58();let c=r.get(a);return c===void 0&&(c={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(a,c)),c},s=i(t);s.isSigner=!0,s.isWritable=!0;for(const o of e){i(o.programId).isInvoked=!0;for(const a of o.keys){const c=i(a.pubkey);c.isSigner||(c.isSigner=a.isSigner),c.isWritable||(c.isWritable=a.isWritable)}}return new Gne(t,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];fs(e.length<=256,"Max static account keys length exceeded");const t=e.filter(([,c])=>c.isSigner&&c.isWritable),r=e.filter(([,c])=>c.isSigner&&!c.isWritable),i=e.filter(([,c])=>!c.isSigner&&c.isWritable),s=e.filter(([,c])=>!c.isSigner&&!c.isWritable),o={numRequiredSignatures:t.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:s.length};{fs(t.length>0,"Expected at least one writable signer key");const[c]=t[0];fs(c===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...t.map(([c])=>new Fn(c)),...r.map(([c])=>new Fn(c)),...i.map(([c])=>new Fn(c)),...s.map(([c])=>new Fn(c))];return[o,a]}extractTableLookup(e){const[t,r]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&o.isWritable),[i,s]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&!o.isWritable);if(!(t.length===0&&i.length===0))return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:i},{writable:r,readonly:s}]}drainKeysFoundInLookupTable(e,t){const r=new Array,i=new Array;for(const[s,o]of this.keyMetaMap.entries())if(t(o)){const a=new Fn(s),c=e.findIndex(u=>u.equals(a));c>=0&&(fs(c<256,"Max lookup table index exceeded"),r.push(c),i.push(a),this.keyMetaMap.delete(s))}return[r,i]}};const Zne="Reached end of buffer unexpectedly";function Yp(n){if(n.length===0)throw new Error(Zne);return n.shift()}function Yl(n,...e){const[t]=e;if(e.length===2?t+(e[1]??0)>n.length:t>=n.length)throw new Error(Zne);return n.splice(...e)}let bx=class W7{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(t=>new Fn(t)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:aa.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new AN(this.staticAccountKeys)}static compile(e){const t=Yne.compile(e.instructions,e.payerKey),[r,i]=t.getMessageComponents(),o=new AN(i).compileInstructions(e.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:aa.encode(a.data)}));return new W7({header:r,accountKeys:i,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const r=e-t,s=this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts;return r<s}else{const r=t-this.header.numReadonlySignedAccounts;return e<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){const e=this.accountKeys.length;let t=[];Kl(t,e);const r=this.instructions.map(f=>{const{accounts:m,programIdIndex:w}=f,y=Array.from(aa.decode(f.data));let b=[];Kl(b,m.length);let E=[];return Kl(E,y.length),{programIdIndex:w,keyIndicesCount:Ot.from(b),keyIndices:m,dataLength:Ot.from(E),data:y}});let i=[];Kl(i,r.length);let s=Ot.alloc(Y2);Ot.from(i).copy(s);let o=i.length;r.forEach(f=>{const w=ie.struct([ie.u8("programIdIndex"),ie.blob(f.keyIndicesCount.length,"keyIndicesCount"),ie.seq(ie.u8("keyIndex"),f.keyIndices.length,"keyIndices"),ie.blob(f.dataLength.length,"dataLength"),ie.seq(ie.u8("userdatum"),f.data.length,"data")]).encode(f,s,o);o+=w}),s=s.slice(0,o);const a=ie.struct([ie.blob(1,"numRequiredSignatures"),ie.blob(1,"numReadonlySignedAccounts"),ie.blob(1,"numReadonlyUnsignedAccounts"),ie.blob(t.length,"keyCount"),ie.seq(Or("key"),e,"keys"),Or("recentBlockhash")]),c={numRequiredSignatures:Ot.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Ot.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Ot.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Ot.from(t),keys:this.accountKeys.map(f=>Xo(f.toBytes())),recentBlockhash:aa.decode(this.recentBlockhash)};let u=Ot.alloc(2048);const d=a.encode(c,u);return s.copy(u,d),u.slice(0,d+s.length)}static from(e){let t=[...e];const r=Yp(t);
997if(r!==(r&J$))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=Yp(t),s=Yp(t),o=ql(t);let a=[];for(let m=0;m<o;m++){const w=Yl(t,0,c0);a.push(new Fn(Ot.from(w)))}const c=Yl(t,0,c0),u=ql(t);let d=[];for(let m=0;m<u;m++){const w=Yp(t),y=ql(t),b=Yl(t,0,y),E=ql(t),T=Yl(t,0,E),N=aa.encode(Ot.from(T));d.push({programIdIndex:w,accounts:b,data:N})}const f={header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:s},recentBlockhash:aa.encode(Ot.from(c)),accountKeys:a,instructions:d};return new W7(f)}},Qne=class H7{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const t of this.addressTableLookups)e+=t.readonlyIndexes.length+t.writableIndexes.length;return e}getAccountKeys(e){let t;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new AN(this.staticAccountKeys,t)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r){const i=e-r,s=this.addressTableLookups.reduce((o,a)=>o+a.writableIndexes.length,0);return i<s}else if(e>=this.header.numRequiredSignatures){const i=e-t,o=r-t-this.header.numReadonlyUnsignedAccounts;return i<o}else{const i=t-this.header.numReadonlySignedAccounts;return e<i}}resolveAddressTableLookups(e){const t={writable:[],readonly:[]};for(const r of this.addressTableLookups){const i=e.find(s=>s.key.equals(r.accountKey));if(!i)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const s of r.writableIndexes)if(s<i.state.addresses.length)t.writable.push(i.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`);for(const s of r.readonlyIndexes)if(s<i.state.addresses.length)t.readonly.push(i.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`)}return t}static compile(e){const t=Yne.compile(e.instructions,e.payerKey),r=new Array,i={writable:new Array,readonly:new Array},s=e.addressLookupTableAccounts||[];for(const d of s){const f=t.extractTableLookup(d);if(f!==void 0){const[m,{writable:w,readonly:y}]=f;r.push(m),i.writable.push(...w),i.readonly.push(...y)}}const[o,a]=t.getMessageComponents(),u=new AN(a,i).compileInstructions(e.instructions);return new H7({header:o,staticAccountKeys:a,recentBlockhash:e.recentBlockhash,compiledInstructions:u,addressTableLookups:r})}serialize(){const e=Array();Kl(e,this.staticAccountKeys.length);const t=this.serializeInstructions(),r=Array();Kl(r,this.compiledInstructions.length);const i=this.serializeAddressTableLookups(),s=Array();Kl(s,this.addressTableLookups.length);const o=ie.struct([ie.u8("prefix"),ie.struct([ie.u8("numRequiredSignatures"),ie.u8("numReadonlySignedAccounts"),ie.u8("numReadonlyUnsignedAccounts")],"header"),ie.blob(e.length,"staticAccountKeysLength"),ie.seq(Or(),this.staticAccountKeys.length,"staticAccountKeys"),Or("recentBlockhash"),ie.blob(r.length,"instructionsLength"),ie.blob(t.length,"serializedInstructions"),ie.blob(s.length,"addressTableLookupsLength"),ie.blob(i.length,"serializedAddressTableLookups")]),a=new Uint8Array(Y2),u=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(d=>d.toBytes()),recentBlockhash:aa.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(s),serializedAddressTableLookups:i},a);return a.slice(0,u)}serializeInstructions(){let e=0;const t=new Uint8Array(Y2);for(const r of this.compiledInstructions){const i=Array();Kl(i,r.accountKeyIndexes.length);const s=Array();Kl(s,r.data.length);const o=ie.struct([ie.u8("programIdIndex"),ie.blob(i.length,"encodedAccountKeyIndexesLength"),ie.seq(ie.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),ie.blob(s.length,"encodedDataLength"),ie.blob(r.data.length,"data")]);e+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(i),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(s),data:r.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0;const t=new Uint8Array(Y2);for(const r of this.addressTableLookups){const i=Array();Kl(i,r.writableIndexes.length);const s=Array();Kl(s,r.readonlyIndexes.length);const o=ie.struct([Or("accountKey"),ie.blob(i.length,"encodedWritableIndexesLength"),ie.seq(ie.u8(),r.writableIndexes.length,"writableIndexes"),ie.blob(s.length,"encodedReadonlyIndexesLength"),ie.seq(ie.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(i),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(s),readonlyIndexes:r.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e];const r=Yp(t),i=r&J$;fs(r!==i,"Expected versioned message but received legacy message");const s=i;fs(s===0,`Expected versioned message with version 0 but found version ${s}`);const o={numRequiredSignatures:Yp(t),numReadonlySignedAccounts:Yp(t),numReadonlyUnsignedAccounts:Yp(t)},a=[],c=ql(t);for(let y=0;y<c;y++)a.push(new Fn(Yl(t,0,c0)));const u=aa.encode(Yl(t,0,c0)),d=ql(t),f=[];for(let y=0;y<d;y++){const b=Yp(t),E=ql(t),T=Yl(t,0,E),N=ql(t),I=new Uint8Array(Yl(t,0,N));f.push({programIdIndex:b,accountKeyIndexes:T,data:I})}const m=ql(t),w=[];for(let y=0;y<m;y++){const b=new Fn(Yl(t,0,c0)),E=ql(t),T=Yl(t,0,E),N=ql(t),I=Yl(t,0,N);w.push({accountKey:b,writableIndexes:T,readonlyIndexes:I})}return new H7({header:o,staticAccountKeys:a,recentBlockhash:u,compiledInstructions:f,addressTableLookups:w})}};const Xne={deserializeMessageVersion(n){const e=n[0],t=e&J$;return t===e?"legacy":t},deserialize:n=>{const e=Xne.deserializeMessageVersion(n);if(e==="legacy")return bx.from(n);if(e===0)return Qne.deserialize(n);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let Dm=function(n){return n[n.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",n[n.PROCESSED=1]="PROCESSED",n[n.TIMED_OUT=2]="TIMED_OUT",n[n.NONCE_INVALID=3]="NONCE_INVALID",n}({});const ANe=Ot.alloc(EN).fill(0);let wc=class{constructor(e){this.keys=void 0,this.programId=void 0,this.data=Ot.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}},cl=class V7{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:r}=e;this.minNonceContextSlot=t,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:r}=e;this.recentBlockhash=t,this.lastValidBlockHeight=r}else{const{recentBlockhash:t,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstru
vendor: 1,325 bytes, line 997
997ction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new wc(t))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?t=[this.nonceInfo.nonceInstruction,...this.instructions]:t=this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");t.length<1&&console.warn("No instructions provided");let r;if(this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let b=0;b<t.length;b++)if(t[b].programId===void 0)throw new Error(`Transaction instruction index ${b} has undefined program id`);const i=[],s=[];t.forEach(b=>{b.keys.forEach(T=>{s.push({...T})});const E=b.programId.toString();i.includes(E)||i.push(E)}
997),i.forEach(b=>{s.push({pubkey:new Fn(b),isSigner:!1,isWritable:!1})});const o=[];s.forEach(b=>{const E=b.pubkey.toString(),T=o.findIndex(N=>N.pubkey.toString()===E);T>-1?(o[T].isWritable=o[T].isWritable||b.isWritable,o[T].isSigner=o[T].isSigner||b.isSigner):o.push(b)}),o.sort(function(b,E){if(b.isSigner!==E.isSigner)return b.isSigner?-1:1;if(b.isWritable!==E.isWritable)return b.isWritable?-1:1;const T={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return b.pubkey.toBase58().localeCompare(E.pubkey.toBase58(),"en",T)});const a=o.findIndex(b=>b.pubkey.equals(r));if(a>-1){const[b]=o.splice(a,1);b.isSigner=!0,b.isWritable=!0,o.unshift(b)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const b of this.signatures){const E=o.findIndex(T=>T.pubkey.equals(b.publicKey));if(E>-1)o[E].isSigner||(o[E].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${b.publicKey.toString()}`)}let c=0,u=0,d=0;const f=[],m=[];o.forEach(({pubkey:b,isSigner:E,isWritable:T})=>{E?(f.push(b.toString()),c+=1,T||(u+=1)):(m.push(b.toString()),T||(d+=1))});const w=f.concat(m),y=t.map(b=>{const{data:E,programId:T}=b;return{programIdIndex:w.indexOf(T.toString()),accounts:b.keys.map(N=>w.indexOf(N.pubkey.toString())),data:aa.encode(E)}});return y.forEach(b=>{fs(b.programIdIndex>=0),b.accounts.forEach(E=>fs(E>=0))}),new bx({header:{numRequiredSignatures:c,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:d},accountKeys:w,recentBlockhash:e,instructions:y})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((i,s)=>t[s].equals(i.publicKey))||(this.signatures=t.map(r=>({signature:null,publicKey:r}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const t=new Set;this.signatures=e.filter(r=>{const i=r.toString();return t.has(i)?!1:(t.add(i),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,r=[];for(const s of e){const o=s.publicKey.toString();t.has(o)||(t.add(o),r.push(s))}this.signatures=r.map(s=>({signature:null,publicKey:s.publicKey}));const i=this._compile();this._partialSign(i,...r)}partialSign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,r=[];for(const s of e){const o=s.publicKey.toString();t.has(o)||(t.add(o),r.push(s))}const i=this._compile();this._partialSign(i,...r)}_partialSign(e,...t){const r=e.serialize();t.forEach(i=>{const s=Wne(r,i.secretKey);this._addSignature(i.publicKey,Xo(s))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){fs(t.length===64);const r=this.signatures.findIndex(i=>e.equals(i.publicKey));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=Ot.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const r={};for(const{signature:i,publicKey:s}of this.signatures)i===null?t&&(r.missing||(r.missing=[])).push(s):pNe(i,e,s.toBytes())||(r.invalid||(r.invalid=[])).push(s);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),i=this.serializeMessage();if(r){const s=this._getMessageSignednessErrors(i,t);if(s){let o="Signature verification failed.";throw s.invalid&&(o+=` 998Invalid signature for public key${s.invalid.length===1?"":"(s)"} [\`${s.invalid.map(a=>a.toBase58()).join("`, `")}\`].`),s.missing&&(o+=` 999Missing signature for public key${s.missing.length===1?"":"(s)"} [\`${s.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(o)}}return this._serialize(i)}_serialize(e){const{signatures:t}=this,r=[];Kl(r,t.length);const i=r.length+t.length*64+e.length,s=Ot.alloc(i);return fs(t.length<256),Ot.from(r).copy(s,0),t.forEach(({signature:o},a)=>
999{o!==null&&(fs(o.length===64,"signature has invalid length"),Ot.from(o).copy(s,r.length+a*64))}),e.copy(s,r.length+t.length*64),fs(s.length<=Y2,`Transaction too large: ${s.length} > ${Y2}`),s}get keys(){return fs(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return fs(this.instructions.length===1),this.instructions[0].programId}get data(){return fs(this.instructions.length===1),this.instructions[0].data}static from(e){let t=[...e];const r=ql(t);let i=[];for(let s=0;s<r;s++){const o=Yl(t,0,EN);i.push(aa.encode(Ot.from(o)))}return V7.populate(bx.from(t),i)}static populate(e,t=[]){const r=new V7;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach((i,s)=>{const o={signature:i==aa.encode(ANe)?null:aa.decode(i),publicKey:e.accountKeys[s]};r.signatures.push(o)}),e.instructions.forEach(i=>{const s=i.accounts.map(o=>{const a=e.accountKeys[o];return{pubkey:a,isSigner:r.signatures.some(c=>c.publicKey.toString()===a.toString())||e.isAccountSigner(o),isWritable:e.isAccountWritable(o)}});r.instructions.push(new wc({keys:s,programId:e.accountKeys[i.programIdIndex],data:aa.decode(i.data)}))}),r._message=e,r._json=r.toJSON(),r}},vx=class Jne{get version(){return this.message.version}constructor(e,t){if(this.signatures=void 0,this.message=void 0,t!==void 0)fs(t.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=t;else{const r=[];for(let i=0;i<e.header.numRequiredSignatures;i++)r.push(new Uint8Array(EN));this.signatures=r}this.message=e}serialize(){const e=this.message.serialize(),t=Array();Kl(t,this.signatures.length);const r=ie.struct([ie.blob(t.length,"encodedSignaturesLength"),ie.seq(yNe(),this.signatures.length,"signatures"),ie.blob(e.length,"serializedMessage")]),i=new Uint8Array(2048),s=r.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},i);return i.slice(0,s)}static deserialize(e){let t=[...e];const r=[],i=ql(t);for(let o=0;o<i;o++)r.push(new Uint8Array(Yl(t,0,EN)));const s=Xne.deserialize(new Uint8Array(t));return new Jne(s,r)}sign(e){const t=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const i of e){const s=r.findIndex(o=>o.equals(i.publicKey));fs(s>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[s]=Wne(t,i.secretKey)}}addSignature(e,t){fs(t.byteLength===64,"Signature must be 64 bytes long");const i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(s=>s.equals(e));fs(i>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[i]=t}};const SNe=160,_Ne=64,CNe=SNe/_Ne,TNe=1e3/CNe;new Fn("SysvarC1ock11111111111111111111111111111111");new Fn("SysvarEpochSchedu1e111111111111111111111111");new Fn("Sysvar1nstructions1111111111111111111111111");const HO=new Fn("SysvarRecentB1ockHashes11111111111111111111"),GV=new Fn("SysvarRent111111111111111111111111111111111");new Fn("SysvarRewards111111111111111111111111111111");new Fn("SysvarS1otHashes111111111111111111111111111");new Fn("SysvarS1otHistory11111111111111111111111111");new Fn("SysvarStakeHistory1111111111111111111111111");let ZV=class extends Error{constructor({action:e,signature:t,transactionMessage:r,logs:i}){const s=i?`Logs: 1000${JSON.stringify(i.slice(-10),null,2)}. `:"",o="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";let a;switch(e){case"send":a=`Transaction ${t} resulted in an error. 1001${r}. `+s+o;break;case"simulate":a=`Simulation failed. 1002Message: ${r}. 1003`+s+o;break;default:a=`Unknown action '${(c=>c)(e)}'`}super(a),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=t,this.transactionMessage=r,this.transactionLogs=i||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){const e=this.transactionLogs;if(!(e!=null&&typeof e=="object"&&"then"in e))return e}
vendor: 17,794 bytes, line 1003
1003async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((t,r)=>{e.getTransaction(this.signature).then(i=>{if(i&&i.meta&&i.meta.logMessages){const s=i.meta.logMessages;this.transactionLogs=s,t(s)}else r(new Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}},Mn=class extends Error{constructor({code:e,message:t,data:r},i){super(i!=null?`${i}: ${t}`:t),this.code=void 0,this.data=void 0,this.code=e,this.data=r,this.name="SolanaJSONRPCError"}};function E2(n){return new Promise(e=>setTimeout(e,n))}function Wa(n,e){const t=n.layout.span>=0?n.layout.span:Kne(n,e),r=Ot.alloc(t),i=Object.assign({instruction:n.index},e);return n.layout.encode(i,r),r}const INe=ie.nu64("lamportsPerSignature"),ere=ie.struct([ie.u32("version"),ie.u32("state"),Or("authorizedPubkey"),Or("nonce"),ie.struct([INe],"feeCalculator")]),QV=ere.span;let NNe=class tre{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const t=ere.decode(Xo(e),0);return new tre({authorizedPubkey:new Fn(t.authorizedPubkey),nonce:new Fn(t.nonce).toString(),feeCalculator:t.feeCalculator})}};function xx(n){const e=ie.blob(8,n),t=e.decode.bind(e),r=e.encode.bind(e),i=e,s=v6e();return i.decode=(o,a)=>{const c=t(o,a);return s.decode(c)},i.encode=(o,a,c)=>{const u=s.encode(o);return r(u,a,c)},i}const Tu=Object.freeze({Create:{index:0,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports"),ie.ns64("space"),Or("programId")])},Assign:{index:1,layout:ie.struct([ie.u32("instruction"),Or("programId")])},Transfer:{index:2,layout:ie.struct([ie.u32("instruction"),xx("lamports")])},CreateWithSeed:{index:3,layout:ie.struct([ie.u32("instruction"),Or("base"),I2("seed"),ie.ns64("lamports"),ie.ns64("space"),Or("programId")])},AdvanceNonceAccount:{index:4,layout:ie.struct([ie.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:ie.struct([ie.u32("instruction"),Or("authorized")])},AuthorizeNonceAccount:{index:7,layout:ie.struct([ie.u32("instruction"),Or("authorized")])},Allocate:{index:8,layout:ie.struct([ie.u32("instruction"),ie.ns64("space")])},AllocateWithSeed:{index:9,layout:ie.struct([ie.u32("instruction"),Or("base"),I2("seed"),ie.ns64("space"),Or("programId")])},AssignWithSeed:{index:10,layout:ie.struct([ie.u32("instruction"),Or("base"),I2("seed"),Or("programId")])},TransferWithSeed:{index:11,layout:ie.struct([ie.u32("instruction"),xx("lamports"),I2("seed"),Or("programId")])},UpgradeNonceAccount:{index:12,layout:ie.struct([ie.u32("instruction")])}});let nre=class q7{constructor(){}static createAccount(e){const t=Tu.Create,r=Wa(t,{lamports:e.lamports,space:e.space,programId:Xo(e.programId.toBuffer())});return new wc({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:r})}static transfer(e){let t,r;if("basePubkey"in e){const i=Tu.TransferWithSeed;t=Wa(i,{lamports:BigInt(e.lamports),seed:e.seed,programId:Xo(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{const i=Tu.Transfer;t=Wa(i,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new wc({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;if("basePubkey"in e){const i=Tu.AssignWithSeed;t=Wa(i,{base:Xo(e.basePubkey.toBuffer()),seed:e.seed,programId:Xo(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=Tu.Assign;t=Wa(i,{programId:Xo(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new wc({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=Tu.CreateWithSeed,r=Wa(t,{base:Xo(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:Xo(e.programId.toBuffer())});let i=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||i.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new wc({keys:i,programId:this.programId,data:r})}static createNonceAccount(e){const t=new cl;"basePubkey"in e&&"seed"in e?t.add(q7.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:QV,programId:this.programId})):t.add(q7.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:QV,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){const t=Tu.InitializeNonceAccount,r=Wa(t,{authorized:Xo(e.authorizedPubkey.toBuffer())}),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:HO,isSigner:!1,isWritable:!1},{pubkey:GV,isSigner:!1,isWritable:!1}],programId:this.programId,data:r};return new wc(i)}static nonceAdvance(e){const t=Tu.AdvanceNonceAccount,r=Wa(t),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:HO,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r};return new wc(i)}static nonceWithdraw(e){const t=Tu.WithdrawNonceAccount,r=Wa(t,{lamports:e.lamports});return new wc({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:HO,isSigner:!1,isWritable:!1},{pubkey:GV,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static nonceAuthorize(e){const t=Tu.AuthorizeNonceAccount,r=Wa(t,{authorized:Xo(e.newAuthorizedPubkey.toBuffer())});return new wc({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static allocate(e){let t,r;if("basePubkey"in e){const i=Tu.AllocateWithSeed;t=Wa(i,{base:Xo(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:Xo(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=Tu.Allocate;t=Wa(i,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new wc({keys:r,programId:this.programId,data:t})}};nre.programId=new Fn("11111111111111111111111111111111");new Fn("BPFLoader2111111111111111111111111111111111");function RNe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var VO,XV;function MNe(){if(XV)return VO;XV=1;var n=Object.prototype.toString,e=Object.keys||function(r){var i=[];for(var s in r)i.push(s);return i};function t(r,i){var s,o,a,c,u,d,f;if(r===!0)return"true";if(r===!1)return"false";switch(typeof r){case"object":if(r===null)return null;if(r.toJSON&&typeof r.toJSON=="function")return t(r.toJSON(),i);if(f=n.call(r),f==="[object Array]"){for(a="[",o=r.length-1,s=0;s<o;s++)a+=t(r[s],!0)+",";return o>-1&&(a+=t(r[s],!0)),a+"]"}else if(f==="[object Object]"){for(c=e(r).sort(),o=c.length,a="",s=0;s<o;)u=c[s],d=t(r[u],!1),d!==void 0&&(a&&(a+=","),a+=JSON.stringify(u)+":"+d),s++;return"{"+a+"}"}else return JSON.stringify(r);case"function":case"undefined":return i?null:void 0;case"string":return JSON.stringify(r);default:return isFinite(r)?r:null}}return VO=function(r){var i=t(r,!1);if(i!==void 0)return""+i},VO}var kNe=MNe(),JV=RNe(kNe);const IA=32;function qO(n){let e=0;for(;n>1;)n/=2,e++;return e}function ONe(n){return n===0?1:(n--,n|=n>>1,n|=n>>2,n|=n>>4,n|=n>>8,n|=n>>16,n|=n>>32,n+1)}let PNe=class{constructor(e,t,r,i,s){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=t,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=s}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const t=qO(ONe(e+IA+1))-qO(IA)-1,r=this.getSlotsInEpoch(t),i=e-(r-IA);return[t,i]}else{const t=e-this.firstNormalSlot,r=Math.floor(t/this.slotsPerEpoch),i=this.firstNormalEpoch+r,s=t%this.slotsPerEpoch;return[i,s]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*IA:(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+qO(IA)):this.slotsPerEpoch}};var DNe=globalThis.fetch;let BNe=class extends jne{constructor(e,t,r){const i=s=>{const o=Une(s,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return"socket"in o?this.underlyingSocket=o.socket:this.underlyingSocket=o,o};super(i,e,t,r),this.underlyingSocket=void 0}call(...e){var r;const t=(r=this.underlyingSocket)==null?void 0:r.readyState;return t===1?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}notify(...e){var r;const t=(r=this.underlyingSocket)==null?void 0:r.readyState;return t===1?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}};function LNe(n,e){let t;try{t=n.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(t.typeIndex!==n.index)throw new Error(`invalid account data; account type mismatch ${t.typeIndex} != ${n.index}`);return t}const eq=56;let tq=class{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const t=LNe($Ne,e),r=e.length-eq;fs(r>=0,"lookup table is invalid"),fs(r%32===0,"lookup table is invalid");const i=r/32,{addresses:s}=ie.struct([ie.seq(Or(),i,"addresses")]).decode(e.slice(eq));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:t.authority.length!==0?new Fn(t.authority[0]):void 0,addresses:s.map(o=>new Fn(o))}}};const $Ne={index:1,layout:ie.struct([ie.u32("typeIndex"),xx("deactivationSlot"),ie.nu64("lastExtendedSlot"),ie.u8("lastExtendedStartIndex"),ie.u8(),ie.seq(Or(),ie.offset(ie.u8(),-1),"authority")])},UNe=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function jNe(n){const e=n.match(UNe);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${n}\``);const[t,r,i,s]=e,o=n.startsWith("https:")?"wss:":"ws:",a=i==null?null:parseInt(i.slice(1),10),c=a==null?"":`:${a+1}`;return`${o}//${r}${c}${s}`}const Es=ZC(Z$(Fn),Lt(),n=>new Fn(n)),rre=Q$([Lt(),bs("base64")]),eU=ZC(Z$(Ot),rre,n=>Ot.from(n[0],"base64")),zNe=30*1e3;function FNe(n){if(/^https?:/.test(n)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return n}function Zi(n){let e,t;if(typeof n=="string")e=n;else if(n){const{commitment:r,...i}=n;e=r,t=i}return{commitment:e,config:t}}function nq(n){return n.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function ire(n){return Sc([Ct({jsonrpc:bs("2.0"),id:Lt(),result:n}),Ct({jsonrpc:bs("2.0"),id:Lt(),error:Ct({code:tE(),message:Lt(),data:qn(T6e())})})])}const WNe=ire(tE());function br(n){return ZC(ire(n),WNe,e=>"error"in e?e:{...e,result:Vt(e.result,n)})}function Ws(n){return br(Ct({context:Ct({slot:Ke()}),value:n}))}function cR(n){return Ct({context:Ct({slot:Ke()}),value:n})}function KO(n,e){return n===0?new Qne({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new Fn(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:aa.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new bx(e)}const HNe=Ct({foundation:Ke(),foundationTerm:Ke(),initial:Ke(),taper:Ke(),terminal:Ke()}),VNe=br(Qt(en(Ct({epoch:Ke(),effectiveSlot:Ke(),amount:Ke(),postBalance:Ke(),commission:qn(en(Ke()))})))),qNe=Qt(Ct({slot:Ke(),prioritizationFee:Ke()})),KNe=Ct({total:Ke(),validator:Ke(),foundation:Ke(),epoch:Ke()}),YNe=Ct({epoch:Ke(),slotIndex:Ke(),slotsInEpoch:Ke(),absoluteSlot:Ke(),blockHeight:qn(Ke()),transactionCount:qn(Ke())}),GNe=Ct({slotsPerEpoch:Ke(),leaderScheduleSlotOffset:Ke(),warmup:jf(),firstNormalEpoch:Ke(),firstNormalSlot:Ke()}),ZNe=Mne(Lt(),Qt(Ke())),Y1=en(Sc([Ct({}),Lt()])),QNe=Ct({err:Y1}),XNe=bs("receivedSignature"),JNe=Ct({"solana-core":Lt(),"feature-set":qn(Ke())}),e8e=Ct({program:Lt(),programId:Es,parsed:tE()}),t8e=Ct({programId:Es,accounts:Qt(Es),data:Lt()}),rq=Ws(Ct({err:en(Sc([Ct({}),Lt()])),logs:en(Qt(Lt())),accounts:qn(en(Qt(en(Ct({executable:jf(),owner:Lt(),lamports:Ke(),data:Qt(Lt()),rentEpoch:qn(Ke())}))))),unitsConsumed:qn(Ke()),returnData:qn(en(Ct({programId:Lt(),data:Q$([Lt(),bs("base64")])}))),innerInstructions:qn(en(Qt(Ct({index:Ke(),instructions:Qt(Sc([e8e,t8e]))}))))})),n8e=Ws(Ct({byIdentity:Mne(Lt(),Qt(Ke())),range:Ct({firstSlot:Ke(),lastSlot:Ke()})}));function r8e(n,e,t,r,i,s){const o=t||DNe;let a;s!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let c;return r&&(c=async(d,f)=>{const m=await new Promise((w,y)=>{try{r(d,f,(b,E)=>w([b,E]))}catch(b){y(b)}});return await o(...m)}),new Lne(async(d,f)=>{const m={method:"POST",body:d,agent:a,headers:Object.assign({"Content-Type":"application/json"},e||{},rRe)};try{let w=5,y,b=500;for(;c?y=await c(n,m):y=await o(n,m),!(y.status!==429||i===!0||(w-=1,w===0));)console.error(`Server responded with ${y.status} ${y.statusText}. Retrying after ${b}ms delay...`),await E2(b),b*=2;const E=await y.text();y.ok?f(null,E):f(new Error(`${y.status} ${y.statusText}: ${E}`))}catch(w){w instanceof Error&&f(w)}},{})}function i8e(n){return(e,t)=>new Promise((r,i)=>{n.request(e,t,(s,o)=>{if(s){i(s);return}r(o)})})}function s8e(n){return e=>new Promise((t,r)=>{e.length===0&&t([]);const i=e.map(s=>n.request(s.methodName,s.args));n.request(i,(s,o)=>{if(s){r(s);return}t(o)})})}const o8e=br(HNe),a8e=br(KNe),c8e=br(qNe),l8e=br(YNe),u8e=br(GNe),d8e=br(ZNe),h8e=br(Ke()),f8e=Ws(Ct({total:Ke(),circulating:Ke(),nonCirculating:Ke(),nonCirculatingAccounts:Qt(Es)})),K7=Ct({amount:Lt(),uiAmount:en(Ke()),decimals:Ke(),uiAmountString:qn(Lt())}),p8e=Ws(Qt(Ct({address:Es,amount:Lt(),uiAmount:en(Ke()),decimals:Ke(),uiAmountString:qn(Lt())}))),g8e=Ws(Qt(Ct({pubkey:Es,account:Ct({executable:jf(),owner:Es,lamports:Ke(),data:eU,rentEpoch:Ke()})}))),Y7=Ct({program:Lt(),parsed:tE(),space:Ke()}),m8e=Ws(Qt(Ct({pubkey:Es,account:Ct({executable:jf(),owner:Es,lamports:Ke(),data:Y7,rentEpoch:Ke()})}))),w8e=Ws(Qt(Ct({lamports:Ke(),address:Es}))),j_=Ct({executable:jf(),owner:Es,lamports:Ke(),data:eU,rentEpoch:Ke()}),y8e=Ct({pubkey:Es,account:j_}),b8e=ZC(Sc([Z$(Ot),Y7]),Sc([rre,Y7]),n=>Array.isArray(n)?Vt(n,eU):n),G7=Ct({executable:jf(),owner:Es,lamports:Ke(),data:b8e,rentEpoch:Ke()}),v8e=Ct({pubkey:Es,account:G7}),x8e=Ct({state:Sc([bs("active"),bs("inactive"),bs("activating"),bs("deactivating")]),active:Ke(),inactive:Ke()}),E8e=br(Qt(Ct({signature:Lt(),slot:Ke(),err:Y1,memo:en(Lt()),blockTime:qn(en(Ke()))}))),A8e=br(Qt(Ct({signature:Lt(),slot:Ke(),err:Y1,memo:en(Lt()),blockTime:qn(en(Ke()))}))),S8e=Ct({subscription:Ke(),result:cR(j_)}),_8e=Ct({pubkey:Es,account:j_}),C8e=Ct({subscription:Ke(),result:cR(_8e)}),T8e=Ct({parent:Ke(),slot:Ke(),root:Ke()}),I8e=Ct({subscription:Ke(),result:T8e}),N8e=Sc([Ct({type:Sc([bs("firstShredReceived"),bs("completed"),bs("optimisticConfirmation"),bs("root")]),slot:Ke(),timestamp:Ke()}),Ct({type:bs("createdBank"),parent:Ke(),slot:Ke(),timestamp:Ke()}),Ct({type:bs("frozen"),slot:Ke(),timestamp:Ke(),stats:Ct({numTransactionEntries:Ke(),numSuccessfulTransactions:Ke(),numFailedTransactions:Ke(),maxTransactionsPerEntry:Ke()})}),Ct({type:bs("dead"),slot:Ke(),timestamp:Ke(),err:Lt()})]),R8e=Ct({subscription:Ke(),result:N8e}),M8e=Ct({subscription:Ke(),result:cR(Sc([QNe,XNe]))}),k8e=Ct({subscription:Ke(),result:Ke()}),O8e=Ct({pubkey:Lt(),gossip:en(Lt()),tpu:en(Lt()),rpc:en(Lt()),version:en(Lt())}),iq=Ct({votePubkey:Lt(),nodePubkey:Lt(),activatedStake:Ke(),epochVoteAccount:jf(),epochCredits:Qt(Q$([Ke(),Ke(),Ke()])),commission:Ke(),lastVote:Ke(),rootSlot:en(Ke())}),P8e=br(Ct({current:Qt(iq),delinquent:Qt(iq)})),D8e=Sc([bs("processed"),bs("confirmed"),bs("finalized")]),B8e=Ct({slot:Ke(),confirmations:en(Ke()),err:Y1,confirmationStatus:qn(D8e)}),L8e=Ws(Qt(en(B8e))),$8e=br(Ke()),sre=Ct({accountKey:Es,writableIndexes:Qt(Ke()),readonlyIndexes:Qt(Ke())}),tU=Ct({signatures:Qt(Lt()),message:Ct({accountKeys:Qt(Lt()),header:Ct({numRequiredSignatures:Ke(),numReadonlySignedAccounts:Ke(),numReadonlyUnsignedAccounts:Ke()}),instructions:Qt(Ct({accounts:Qt(Ke()),data:Lt(),programIdIndex:Ke()})),recentBlockhash:Lt(),addressTableLookups:qn(Qt(sre))})}),ore=Ct({pubkey:Es,signer:jf(),writable:jf(),source:qn(Sc([bs("transaction"),bs("lookupTable")]))}),are=Ct({accountKeys:Qt(ore),signatures:Qt(Lt())}),cre=Ct({parsed:tE(),program:Lt(),programId:Es}),lre=Ct({accounts:Qt(Es),data:Lt(),programId:Es}),U8e=Sc([lre,cre]),j8e=Sc([Ct({parsed:tE(),program:Lt(),programId:Lt()}),Ct({accounts:Qt(Lt()),data:Lt(),programId:Lt()})]),ure=ZC(U8e,j8e,n=>"accounts"in n?Vt(n,lre):Vt(n,cre)),dre=Ct({signatures:Qt(Lt()),message:Ct({accountKeys:Qt(ore),instructions:Qt(ure),recentBlockhash:Lt(),addressTableLookups:qn(e
vendor: 2,050 bytes, line 1003
1003n(Qt(sre)))})}),SN=Ct({accountIndex:Ke(),mint:Lt(),owner:qn(Lt()),programId:qn(Lt()),uiTokenAmount:K7}),hre=Ct({writable:Qt(Es),readonly:Qt(Es)}),lR=Ct({err:Y1,fee:Ke(),innerInstructions:qn(en(Qt(Ct({index:Ke(),instructions:Qt(Ct({accounts:Qt(Ke()),data:Lt(),programIdIndex:Ke()}))})))),preBalances:Qt(Ke()),postBalances:Qt(Ke()),logMessages:qn(en(Qt(Lt()))),preTokenBalances:qn(en(Qt(SN))),postTokenBalances:qn(en(Qt(SN))),loadedAddresses:qn(hre),computeUnitsConsumed:qn(Ke())}),nU=Ct({err:Y1,fee:Ke(),innerInstructions:qn(en(Qt(Ct({index:Ke(),instructions:Qt(ure)})))),preBalances:Qt(Ke()),postBalances:Qt(Ke()),logMessages:qn(en(Qt(Lt()))),preTokenBalances:qn(en(Qt(SN))),postTokenBalances:qn(en(Qt(SN))),loadedAddresses:qn(hre),computeUnitsConsumed:qn(Ke())}),nE=Sc([bs(0),bs("legacy")]),G1=Ct({pubkey:Lt(),lamports:Ke(),postBalance:en(Ke()),rewardType:en(Lt()),commission:qn(en(Ke()))}),z8e=br(en(Ct({blockhash:Lt(),previousBlockhash:Lt(),parentSlot:Ke(),transactions:Qt(Ct({transaction:tU,meta:en(lR),version:qn(nE)})),rewards:qn(Qt(G1)),blockTime:en(Ke()),blockHeight:en(Ke())}))),F8e=br(en(Ct({blockhash:Lt(),previousBlockhash:Lt(),parentSlot:Ke(),rewards:qn(Qt(G1)),blockTime:en(Ke()),blockHeight:en(Ke())}))),W8e=br(en(Ct({blockhash:Lt(),previousBlockhash:Lt(),parentSlot:Ke(),transactions:Qt(Ct({transaction:are,meta:en(lR),version:qn(nE)})),rewards:qn(Qt(G1)),blockTime:en(Ke()),blockHeight:en(Ke())}))),H8e=br(en(Ct({blockhash:Lt(),previousBlockhash:Lt(),parentSlot:Ke(),transactions:Qt(Ct({transaction:dre,meta:en(nU),version:qn(nE)})),rewards:qn(Qt(G1)),blockTime:en(Ke()),blockHeight:en(Ke())}))),V8e=br(en(Ct({blockhash:Lt(),previousBlockhash:Lt(),parentSlot:Ke(),transactions:Qt(Ct({transaction:are,meta:en(nU),version:qn(nE)})),rewards:qn(Qt(G1)),blockTime:en(Ke()),blockHeight:en(Ke())}))),q8e=br(en(Ct({blockhash:Lt(),previousBlockhash:Lt(),parentSlot:Ke(),rewards:qn(Qt(G1)),blockTime:en(Ke()),blockHeight:en(Ke())}))),K8e=br(en(Ct({blockhash:Lt(),previousBlockhash:Lt(),parentSlot:Ke(),transactions:Qt(Ct({transaction:tU,meta:e
vendor: 5,079 bytes, line 1003
1003n(lR)})),rewards:qn(Qt(G1)),blockTime:en(Ke())}))),sq=br(en(Ct({blockhash:Lt(),previousBlockhash:Lt(),parentSlot:Ke(),signatures:Qt(Lt()),blockTime:en(Ke())}))),YO=br(en(Ct({slot:Ke(),meta:en(lR),blockTime:qn(en(Ke())),transaction:tU,version:qn(nE)}))),TI=br(en(Ct({slot:Ke(),transaction:dre,meta:en(nU),blockTime:qn(en(Ke())),version:qn(nE)}))),Y8e=Ws(Ct({blockhash:Lt(),lastValidBlockHeight:Ke()})),G8e=Ws(jf()),Z8e=Ct({slot:Ke(),numTransactions:Ke(),numSlots:Ke(),samplePeriodSecs:Ke()}),Q8e=br(Qt(Z8e)),X8e=Ws(en(Ct({feeCalculator:Ct({lamportsPerSignature:Ke()})}))),J8e=br(Lt()),eRe=br(Lt()),tRe=Ct({err:Y1,logs:Qt(Lt()),signature:Lt()}),nRe=Ct({result:cR(tRe),subscription:Ke()}),rRe={"solana-client":"js/1.0.0-maintenance"};let NA=class{constructor(e,t){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const u={};return async d=>{const{commitment:f,config:m}=Zi(d),w=this._buildArgs([],f,void 0,m),y=JV(w);return u[y]=u[y]??(async()=>{try{const b=await this._rpcRequest("getBlockHeight",w),E=Vt(b,br(Ke()));if("error"in E)throw new Mn(E.error,"failed to get block height information");return E.result}finally{delete u[y]}})(),await u[y]}})();let r,i,s,o,a,c;t&&typeof t=="string"?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,r=t.wsEndpoint,i=t.httpHeaders,s=t.fetch,o=t.fetchMiddleware,a=t.disableRetryOnRateLimit,c=t.httpAgent),this._rpcEndpoint=FNe(e),this._rpcWsEndpoint=r||jNe(e),this._rpcClient=r8e(e,i,s,o,a,c),this._rpcRequest=i8e(this._rpcClient),this._rpcBatchRequest=s8e(this._rpcClient),this._rpcWebSocket=new BNe(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,t){const{commitment:r,config:i}=Zi(t),s=this._buildArgs([e.toBase58()],r,void 0,i),o=await this._rpcRequest("getBalance",s),a=Vt(o,Ws(Ke()));if("error"in a)throw new Mn(a.error,`failed to get balance for ${e.toBase58()}`);return a.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then(r=>r.value).catch(r=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+r)})}async getBlockTime(e){const t=await this._rpcRequest("getBlockTime",[e]),r=Vt(t,br(en(Ke())));if("error"in r)throw new Mn(r.error,`failed to get block time for slot ${e}`);return r.result}async getMinimumLedgerSlot(){const e=await this._rpcRequest("minimumLedgerSlot",[]),t=Vt(e,br(Ke()));if("error"in t)throw new Mn(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){const e=await this._rpcRequest("getFirstAvailableBlock",[]),t=Vt(e,h8e);if("error"in t)throw new Mn(t.error,"failed to get first available block");return t.result}async getSupply(e){let t={};typeof e=="string"?t={commitment:e}:e?t={...e,commitment:e&&e.commitment||this.commitment}:t={commitment:this.commitment};const r=await this._rpcRequest("getSupply",[t]),i=Vt(r,f8e);if("error"in i)throw new Mn(i.error,"failed to get supply");return i.result}async getTokenSupply(e,t){const r=this._buildArgs([e.toBase58()],t),i=await this._rpcRequest("getTokenSupply",r),s=Vt(i,Ws(K7));if("error"in s)throw new Mn(s.error,"failed to get token supply");return s.result}async getTokenAccountBalance(e,t){const r=this._buildArgs([e.toBase58()],t),i=await this._rpcRequest("getTokenAccountBalance",r),s=Vt(i,Ws(K7));if("error"in s)throw new Mn(s.error,"failed to get token account balance");return s.result}
1003async getTokenAccountsByOwner(e,t,r){const{commitment:i,config:s}=Zi(r);let o=[e.toBase58()];"mint"in t?o.push({mint:t.mint.toBase58()}):o.push({programId:t.programId.toBase58()});const a=this._buildArgs(o,i,"base64",s),c=await this._rpcRequest("getTokenAccountsByOwner",a),u=Vt(c,g8e);if("error"in u)throw new Mn(u.error,`failed to get token accounts owned by account ${e.toBase58()}`);return u.result}async getParsedTokenAccountsByOwner(e,t,r){let i=[e.toBase58()];"mint"in t?i.push({mint:t.mint.toBase58()}):i.push({programId:t.programId.toBase58()});const s=this._buildArgs(i,r,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",s),a=Vt(o,m8e);if("error"in a)throw new Mn(a.error,`failed to get token accounts owned by account ${e.toBase58()}`);return a.result}async getLargestAccounts(e){const t={...e,commitment:e&&e.commitment||this.commitment},r=t.filter||t.commitment?[t]:[],i=await this._rpcRequest("getLargestAccounts",r),s=Vt(i,w8e);if("error"in s)throw new Mn(s.error,"failed to get largest accounts");return s.result}async getTokenLargestAccounts(e,t){const r=this._buildArgs([e.toBase58()],t),i=await this._rpcRequest("getTokenLargestAccounts",r),s=Vt(i,p8e);if("error"in s)throw new Mn(s.error,"failed to get token largest accounts");return s.result}async getAccountInfoAndContext(e,t){const{commitment:r,config:i}=Zi(t),s=this._buildArgs([e.toBase58()],r,"base64",i),o=await this._rpcRequest("getAccountInfo",s),a=Vt(o,Ws(en(j_)));if("error"in a)throw new Mn(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getParsedAccountInfo(e,t){const{commitment:r,config:i}=Zi(t),s=this._buildArgs([e.toBase58()],r,"jsonParsed",i),o=await this._rpcRequest("getAccountInfo",s),a=Vt(o,Ws(en(G7)));if("error"in a)throw new Mn(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(r){throw new Error("failed to get info about account "+e.toBase58()+": "+r)}}async getMultipleParsedAccounts(e,t){const{commitment:r,config:i}=Zi(t),s=e.map(u=>u.toBase58()),o=this._buildArgs([s],r,"jsonParsed",i),a=await this._rpcRequest("getMultipleAccounts",o),c=Vt(a,Ws(Qt(en(G7))));if("error"in c)throw new Mn(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfoAndContext(e,t){const{commitment:r,config:i}=Zi(t),s=e.map(u=>u.toBase58()),o=this._buildArgs([s],r,"base64",i),a=await this._rpcRequest("getMultipleAccounts",o),c=Vt(a,Ws(Qt(en(j_))));if("error"in c)throw new Mn(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,r){const{commitment:i,config:s}=Zi(t),o=this._buildArgs([e.toBase58()],i,void 0,{...s,epoch:r??(s==null?void 0:s.epoch)}),a=await this._rpcRequest("getStakeActivation",o),c=Vt(a,br(x8e));if("error"in c)throw new Mn(c.error,`failed to get Stake Activation ${e.toBase58()}`);return c.result}async getProgramAccounts(e,t){const{commitment:r,config:i}=Zi(t),{encoding:s,...o}=i||{},a=this._buildArgs([e.toBase58()],r,s||"base64",{...o,...o.filters?{filters:nq(o.filters)}:null}),c=await this._rpcRequest("getProgramAccounts",a),u=Qt(y8e),d=o.withContext===!0?Vt(c,Ws(u)):Vt(c,br(u));if("error"in d)throw new Mn(d.error,`failed to get accounts owned by program ${e.toBase58()}`);return d.result}async getParsedProgramAccounts(e,t){const{commitment:r,config:i}=Zi(t),s=this._buildArgs([e.toBase58()],r,"jsonParsed",i),o=await this._rpcRequest("getProgramAccounts",s),a=Vt(o,br(Qt(v8e)));if("error"in a)throw new Mn(a.error,`failed to get accounts owned by program ${e.toBase58()}`);return a.result}async confirmTransaction(e,t){var s;let r;if(typeof e=="string")r=e;else{const o=e;if((s=o.abortSignal)!=null&&s.aborted)return Promise.reject(o.abortSignal.reason);r=o.signature}let i;try{i=aa.decode(r)}catch{throw new Error("signature must be base58 encoded: "+r)}return fs(i.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:t||this.commitment,signature:r}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:t||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((t,r)=>{e!=null&&(e.aborted?r(e.reason):e.addEventListener("abort",()=>{r(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:t}){let r,i,s=!1;const o=new Promise((c,u)=>{try{r=this.onSignature(t,(f,m)=>{r=void 0;const w={context:m,value:f};c({__type:Dm.PROCESSED,response:w})},e);const d=new Promise(f=>{r==null?f():i=this._onSubscriptionStateChange(r,m=>{m==="subscribed"&&f()})});(async()=>
1003{if(await d,s)return;const f=await this.getSignatureStatus(t);if(s||f==null)return;const{context:m,value:w}=f;if(w!=null)if(w!=null&&w.err)u(w.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(w.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(w.confirmationStatus==="processed"||w.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}s=!0,c({__type:Dm.PROCESSED,response:{context:m,value:w}})}})()}catch(d){u(d)}});return{abortConfirmation:()=>{i&&(i(),i=void 0),r!=null&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:t,lastValidBlockHeight:r,signature:i}}){let s=!1;const o=new Promise(f=>{const m=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let w=await m();if(!s){for(;w<=r;)if(await E2(1e3),s||(w=await m(),s))return;f({__type:Dm.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:e,signature:i}),u=this.getCancellationPromise(t);let d;try{const f=await Promise.race([u,c,o]);if(f.__type===Dm.PROCESSED)d=f.response;else throw new Vne(i)}finally{s=!0,a()}return d}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:t,minContextSlot:r,nonceAccountPubkey:i,nonceValue:s,signature:o}}){let a=!1;const c=new Promise(w=>{let y=s,b=null;const E=async()=>{try{const{context:T,value:N}=await this.getNonceAndContext(i,{commitment:e,minContextSlot:r});return b=T.slot,N==null?void 0:N.nonce}catch{return y}};(async()=>{if(y=await E(),!a)for(;;){if(s!==y){w({__type:Dm.NONCE_INVALID,slotInWhichNonceDidAdvance:b});return}if(await E2(2e3),a||(y=await E(),a))return}})()}),{abortConfirmation:u,confirmationPromise:d}=this.getTransactionConfirmationPromise({commitment:e,signature:o}),f=this.getCancellationPromise(t);let m;try{const w=await Promise.race([f,d,c]);if(w.__type===Dm.PROCESSED)m=w.response;else{let y;for(;;
1003){const b=await this.getSignatureStatus(o);if(b==null)break;if(b.context.slot<(w.slotInWhichNonceDidAdvance??r)){await E2(400);continue}y=b;break}if(y!=null&&y.value){const b=e||"finalized",{confirmationStatus:E}=y.value;switch(b){case"processed":case"recent":if(E!=="processed"&&E!=="confirmed"&&E!=="finalized")throw new nS(o);break;case"confirmed":case"single":case"singleGossip":if(E!=="confirmed"&&E!=="finalized")throw new nS(o);break;case"finalized":case"max":case"root":if(E!=="finalized")throw new nS(o);break;default:}m={context:y.context,value:{err:y.value.err}}}else throw new nS(o)}}finally{a=!0,u()}return m}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:t}){let r;const i=new Promise(c=>{let u=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{u=this._confirmTransactionInitialTimeout||3e4;break}}r=setTimeout(()=>c({__type:Dm.TIMED_OUT,timeoutMs:u}),u)}),{abortConfirmation:s,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:e,signature:t});let a;try{const c=await Promise.race([o,i]);if(c.__type===Dm.PROCESSED)a=c.response;else throw new qne(t,c.timeoutMs/1e3)}finally{clearTimeout(r),s()}return a}async getClusterNodes(){const e=await this._rpcRequest("getClusterNodes",[]),t=Vt(e,br(Qt(O8e)));if("error"in t)throw new Mn(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getVoteAccounts",t),i=Vt(r,P8e);if("error"in i)throw new Mn(i.error,"failed to get vote accounts");return i.result}async getSlot(e){const{commitment:t,config:r}=Zi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getSlot",i),o=Vt(s,br(Ke()));if("error"in o)throw new Mn(o.error,"failed to get slot");return o.result}async getSlotLeader(e){const{commitment:t,config:r}=Zi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getSlotLeader",i),o=Vt(s,br(Lt()));if("error"in o)throw new Mn(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(e,t){const r=[e,t],i=await this._rpcRequest("getSlotLeaders",r),s=Vt(i,br(Qt(Es)));if("error"in s)throw new Mn(s.error,"failed to get slot leaders");return s.result}async getSignatureStatus(e,t){const{context:r,value:i}
1003=await this.getSignatureStatuses([e],t);fs(i.length===1);const s=i[0];return{context:r,value:s}}async getSignatureStatuses(e,t){const r=[e];t&&r.push(t);const i=await this._rpcRequest("getSignatureStatuses",r),s=Vt(i,L8e);if("error"in s)throw new Mn(s.error,"failed to get signature status");return s.result}async getTransactionCount(e){const{commitment:t,config:r}=Zi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getTransactionCount",i),o=Vt(s,br(Ke()));if("error"in o)throw new Mn(o.error,"failed to get transaction count");return o.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getInflationGovernor",t),i=Vt(r,o8e);if("error"in i)throw new Mn(i.error,"failed to get inflation");return i.result}async getInflationReward(e,t,r){const{commitment:i,config:s}=Zi(r),o=this._buildArgs([e.map(u=>u.toBase58())],i,void 0,{...s,epoch:t??(s==null?void 0:s.epoch)}),a=await this._rpcRequest("getInflationReward",o),c=Vt(a,VNe);if("error"in c)throw new Mn(c.error,"failed to get inflation reward");return c.result}async getInflationRate(){const e=await this._rpcRequest("getInflationRate",[]),t=Vt(e,a8e);if("error"in t)throw new Mn(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(e){const{commitment:t,config:r}=Zi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getEpochInfo",i),o=Vt(s,l8e);if("error"in o)throw new Mn(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const e=await this._rpcRequest("getEpochSchedule",[]),t=Vt(e,u8e);if("error"in t)throw new Mn(t.error,"failed to get epoch schedule");const r=t.result;return new PNe(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot)}async getLeaderSchedule(){const e=await this._rpcRequest("getLeaderSchedule",[]),t=Vt(e,d8e);if("error"in t)throw new Mn(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(e,t){const r=this._buildArgs([e],t),i=await this._rpcRequest("getMinimumBalanceForRentExemption",r),s=Vt(i,$8e);return"error"in s?(console.warn("Unable to fetch minimum balance for rent exemption"),0):s.result}async getRecentBlockhashAndContext(e){const{context:t,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(e);return{context:t,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON(){return{}}}}}}async getRecentPerformanceSamples(e){const t=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),r=Vt(t,Q8e);if("error"in r)throw new Mn(r.error,"failed to get recent performance samples");return r.result}async getFeeCalculatorForBlockhash(e,t){const r=this._buildArgs([e],t),i=await this._rpcRequest("getFeeCalculatorForBlockhash",r),s=Vt(i,X8e);if("error"in s)throw new Mn(s.error,"failed to get fee calculator");const{context:o,value:a}=s.result;return{context:o,value:a!==null?a.feeCalculator:null}}async getFeeForMessage(e,t){const r=Xo(e.serialize()).toString("base64"),i=this._buildArgs([r],t),s=await this._rpcRequest("getFeeForMessage",i),o=Vt(s,Ws(en(Ke())));if("error"in o)throw new Mn(o.error,"failed to get fee for message");if(o.result===null)throw new Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(e){var o;const t=(o=e==null?void 0:e.lockedWritableAccounts)==null?void 0:o.map(a=>a.toBase58()),r=t!=null&&t.length?[t]:[],i=await this._rpcRequest("getRecentPrioritizationFees",r),s=Vt(i,c8e);if("error"in s)throw new Mn(s.error,"failed to get recent prioritization fees");return s.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(e){const{commitment:t,config:r}=Zi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getLatestBlockhash",i),o=Vt(s,Y8e);if("error"in o)throw new Mn(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(e,t){const{commitment:r,config:i}=Zi(t),s=this._buildArgs([e],r,void 0,i),o=await this._rpcRequest("isBlockhashValid",s),a=Vt(o,G8e);if("error"in a)throw new Mn(a.error,"failed to determine if the blockhash `"+e+"`is valid");return a.result}async getVersion(){const e=await this._rpcRequest("getVersion",[]),t=Vt(e,br(JNe));if("error"in t)throw new Mn(t.error,"failed to get version");return t.result}async getGenesisHash(){const e=await this._rpcRequest("getGenesisHash",[]),t=Vt(e,br(Lt()));if("error"in t)throw new Mn(t.error,"failed to get genesis hash");return t.result}async getBlock(e,t){const{commitment:r,config:i}=Zi(t),s=this._buildArgsAtLeastConfirmed([e],r,void 0,i),o=await this._rpcRequest("getBlock",s);
1003try{switch(i==null?void 0:i.transactionDetails){case"accounts":{const a=Vt(o,W8e);if("error"in a)throw a.error;return a.result}case"none":{const a=Vt(o,F8e);if("error"in a)throw a.error;return a.result}default:{const a=Vt(o,z8e);if("error"in a)throw a.error;const{result:c}=a;return c?{...c,transactions:c.transactions.map(({transaction:u,meta:d,version:f})=>({meta:d,transaction:{...u,message:KO(f,u.message)},version:f}))}:null}}}catch(a){throw new Mn(a,"failed to get confirmed block")}}async getParsedBlock(e,t){const{commitment:r,config:i}=Zi(t),s=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",i),o=await this._rpcRequest("getBlock",s);try{switch(i==null?void 0:i.transactionDetails){case"accounts":{const a=Vt(o,V8e);if("error"in a)throw a.error;return a.result}case"none":{const a=Vt(o,q8e);if("error"in a)throw a.error;return a.result}default:{const a=Vt(o,H8e);if("error"in a)throw a.error;return a.result}}}catch(a){throw new Mn(a,"failed to get block")}}async getBlockProduction(e){let t,r;if(typeof e=="string")r=e;else if(e){const{commitment:a,...c}=e;r=a,t=c}const i=this._buildArgs([],r,"base64",t),s=await this._rpcRequest("getBlockProduction",i),o=Vt(s,n8e);if("error"in o)throw new Mn(o.error,"failed to get block production information");return o.result}async getTransaction(e,t){const{commitment:r,config:i}=Zi(t),s=this._buildArgsAtLeastConfirmed([e],r,void 0,i),o=await this._rpcRequest("getTransaction",s),a=Vt(o,YO);if("error"in a)throw new Mn(a.error,"failed to get transaction");const c=a.result;return c&&{...c,transaction:{...c.transaction,message:KO(c.version,c.transaction.message)}}}async getParsedTransaction(e,t){const{commitment:r,config:i}=Zi(t),s=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",i),o=await this._rpcRequest("getTransaction",s),a=Vt(o,TI);if("error"in a)throw new Mn(a.error,"failed to get transaction");return a.result}async getParsedTransactions(e,t){const{commitment:r,config:i}=Zi(t),s=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],r,"jsonParsed",i)}));return(await this._rpcBatchRequest(s)).map(c=>{const u=Vt(c,TI);if("error"in u)throw new Mn(u.error,"failed to get transactions");return u.result})}async getTransactions(e,t){const{commitment:r,config:i}=Zi(t),s=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],r,void 0,i)}));return(await this._rpcBatchRequest(s)).map(c=>{const u=Vt(c,YO);if("error"in u)throw new Mn(u.error,"failed to get transactions");const d=u.result;return d&&{...d,transaction:{...d.transaction,message:KO(d.version,d.transaction.message)}}})}async getConfirmedBlock(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),i=await this._rpcRequest("getBlock",r),s=Vt(i,K8e);if("error"in s)throw new Mn(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+e+" not found");const a={...o,transactions:o.transactions.map(({transaction:c,meta:u})=>{const d=new bx(c.message);return{meta:u,transaction:{...c,message:d}}})};return{...a,transactions:a.transactions.map(({transaction:c,meta:u})=>({meta:u,transaction:cl.populate(c.message,c.signatures)}))}}async getBlocks(e,t,r){const i=this._buildArgsAtLeastConfirmed(t!==void 0?[e,t]:[e],r),s=await this._rpcRequest("getBlocks",i),o=Vt(s,br(Qt(Ke())));if("error"in o)throw new Mn(o.error,"failed to get blocks");return o.result}async getBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getBlock",r),s=Vt(i,sq);if("error"in s)throw new Mn(s.error,"failed to get block");const o=s.result;if(!o)throw new Error("Block "+e+" not found");return o}async getConfirmedBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getBlock",r),s=Vt(i,sq);if("error"in s)throw new Mn(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+e+" not found");return o}async getConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),i=await this._rpcRequest("getTransaction",r),s=Vt(i,YO);if("error"in s)throw new Mn(s.error,"failed to get transaction");const o=s.result;if(!o)return o;const a=new bx(o.transaction.message),c=o.transaction.signatures;return{...o,transaction:cl.populate(a,c)}}async getParsedConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),i=await this._rpcRequest("getTransaction",r),s=Vt(i,TI);if("error"in s)throw new Mn(s.error,"failed to get confirmed transaction");return s.result}async getParsedConfirmedTransactions(e,t){const r=e.map(o=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([o],t,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(o=>
vendor: 14,179 bytes, lines 1003-1004
1003{const a=Vt(o,TI);if("error"in a)throw new Mn(a.error,"failed to get confirmed transactions");return a.result})}async getConfirmedSignaturesForAddress(e,t,r){let i={},s=await this.getFirstAvailableBlock();for(;!("until"in i)&&(t--,!(t<=0||t<s));)try{const c=await this.getConfirmedBlockSignatures(t,"finalized");c.signatures.length>0&&(i.until=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}let o=await this.getSlot("finalized");for(;!("before"in i)&&(r++,!(r>o));)try{const c=await this.getConfirmedBlockSignatures(r);c.signatures.length>0&&(i.before=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}return(await this.getConfirmedSignaturesForAddress2(e,i)).map(c=>c.signature)}async getConfirmedSignaturesForAddress2(e,t,r){const i=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),s=await this._rpcRequest("getConfirmedSignaturesForAddress2",i),o=Vt(s,E8e);if("error"in o)throw new Mn(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(e,t,r){const i=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),s=await this._rpcRequest("getSignaturesForAddress",i),o=Vt(s,A8e);if("error"in o)throw new Mn(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(e,t){const{context:r,value:i}=await this.getAccountInfoAndContext(e,t);let s=null;return i!==null&&(s=new tq({key:e,state:tq.deserialize(i.data)})),{context:r,value:s}}async getNonceAndContext(e,t){const{context:r,value:i}=await this.getAccountInfoAndContext(e,t);let s=null;return i!==null&&(s=NNe.fromAccountData(i.data)),{context:r,value:s}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then(r=>r.value).catch(r=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+r)})}async requestAirdrop(e,t){const r=await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),i=Vt(r,J8e);if("error"in i)throw new Mn(i.error,`airdrop to ${e.toBase58()} failed`);return i.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await E2(100);const r=Date.now()-this._blockhashInfo.lastFetch>=zNe;if(this._blockhashInfo.latestBlockhash!==null&&!r)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),t=this._blockhashInfo.latestBlockhash,r=t?t.blockhash:null;for(let i=0;i<50;i++){const s=await this.getLatestBlockhash("finalized");if(r!==s.blockhash)return this._blockhashInfo={latestBlockhash:s,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},s;await E2(TNe/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:t,config:r}=Zi(e),i=this._buildArgs([],t,"base64",r),s=await this._rpcRequest("getStakeMinimumDelegation",i),o=Vt(s,Ws(Ke()));if("error"in o)throw new Mn(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(e,t,r){if("message"in e){const b=e.serialize(),E=Ot.from(b).toString("base64");if(Array.isArray(t)||r!==void 0)throw new Error("Invalid arguments");const T=t||{};T.encoding="base64","commitment"in T||(T.commitment=this.commitment),t&&typeof t=="object"&&"innerInstructions"in t&&(T.innerInstructions=t.innerInstructions);const N=[E,T],I=await this._rpcRequest("simulateTransaction",N),H=Vt(I,rq);if("error"in H)throw new Error("failed to simulate transaction: "+H.error.message);return H.result}let i;if(e instanceof cl){let y=e;i=new cl,i.feePayer=y.feePayer,i.instructions=e.instructions,i.nonceInfo=y.nonceInfo,i.signatures=y.signatures}else i=cl.populate(e),i._message=i._json=void 0;if(t!==void 0&&!Array.isArray(t))throw new Error("Invalid arguments");const s=t;if(i.nonceInfo&&s)i.sign(...s);else{let y=this._disableBlockhashCaching;for(;;){const b=await this._blockhashWithExpiryBlockHeight(y);if(i.lastValidBlockHeight=b.lastValidBlockHeight,i.recentBlockhash=b.blockhash,!s)break;if(i.sign(...s),!i.signature)throw new Error("!signature");const E=i.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(E)&&!this._blockhashInfo.transactionSignatures.includes(E)){this._blockhashInfo.simulatedSignatures.push(E);break}else y=!0}}const o=i._compile(),a=o.serialize(),u=i._serialize(a).toString("base64"),d={encoding:"base64",commitment:this.commitment};if(r){const y=(Array.isArray(r)?r:o.nonProgramIds()).map(b=>b.toBase58());d.accounts={encoding:"base64",addresses:y}}s&&(d.sigVerify=!0),t&&typeof t=="object"&&"innerInstructions"in t&&(d.innerInstructions=t.innerInstructions);const f=[u,d],m=await this._rpcRequest("simulateTransaction",f),w=Vt(m,rq);if("error"in w){let y;if("data"in w.error&&(y=w.error.data.logs,y&&Array.isArray(y))){const b=` 1004 `,E=b+y.join(b);console.error(w.error.message,E)}throw new ZV({action:"simulate",signature:"",transactionMessage:w.error.message,logs:y})}return w.result}async sendTransaction(e,t,r){if("version"in e){if(t&&Array.isArray(t))throw new Error("Invalid arguments");const o=e.serialize();return await this.sendRawTransaction(o,t)}if(t===void 0||!Array.isArray(t))throw new Error("Invalid arguments");const i=t;if(e.nonceInfo)e.sign(...i);else{let o=this._disableBlockhashCaching;for(;;){const a=await this._blockhashWithExpiryBlockHeight(o);if(e.lastValidBlockHeight=a.lastValidBlockHeight,e.recentBlockhash=a.blockhash,e.sign(...i),!e.signature)throw new Error("!signature");const c=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(c))o=!0;else{this._blockhashInfo.transactionSignatures.push(c);break}}}const s=e.serialize();return await this.sendRawTransaction(s,r)}async sendRawTransaction(e,t){const r=Xo(e).toString("base64");return await this.sendEncodedTransaction(r,t)}async sendEncodedTransaction(e,t){const r={encoding:"base64"},i=t&&t.skipPreflight,s=i===!0?"processed":t&&t.preflightCommitment||this.commitment;t&&t.maxRetries!=null&&(r.maxRetries=t.maxRetries),t&&t.minContextSlot!=null&&(r.minContextSlot=t.minContextSlot),i&&(r.skipPreflight=i),s&&(r.preflightCommitment=s);const o=[e,r],a=await this._rpcRequest("sendTransaction",o),c=Vt(a,eRe);if("error"in c){let u;throw"data"in c.error&&(u=c.error.data.logs),new ZV({action:i?"send":"simulate",signature:"",transactionMessage:c.error.message,logs:u})}return c.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([t,r])=>{this._setSubscription(t,{...r,state:"pending"})})}_setSubscription(e,t){var i;const r=(i=this._subscriptionsByHash[e])==null?void 0:i.state;if(this._subscriptionsByHash[e]=t,r!==t.state){const s=this._subscriptionStateChangeCallbacksByHash[e];s&&s.forEach(o=>{try{o(t.state)}catch{}})}}_onSubscriptionStateChange(e,t){var s;const r=this._subscriptionHashByClientSubscriptionId[e];if(r==null)return()=>{};const i=(s=this._subscriptionStateChangeCallbacksByHash)[r]||(s[r]=new Set);return i.add(t),()=>{i.delete(t),i.size===0&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(r){r instanceof Error&&console.log(`Error when closing socket connection: ${r.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async r=>{const i=this._subscriptionsByHash[r];if(i!==void 0)switch(i.state){case"pending":case"unsubscribed":if(i.callbacks.size===0){delete this._subscriptionsByHash[r],i.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:s,method:o}=i;try{this._setSubscription(r,{...i,state:"subscribing"});const a=await this._rpcWebSocket.call(o,s);this._setSubscription(r,{...i,serverSubscriptionId:a,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[a]=i.callbacks,await this._updateSubscriptions()}catch(a){if(console.error(`Received ${a instanceof Error?"":"JSON-RPC "}error calling \`${o}\``,{args:s,error:a}),!t())return;this._setSubscription(r,{...i,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":i.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:s,unsubscribeMethod:o}=i;if(this._subscriptionsAutoDisposedByRpc.has(s))this._subscriptionsAutoDisposedByRpc.delete(s);else{this._setSubscription(r,{...i,state:"unsubscribing"}),this._setSubscription(r,{...i,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[s])}catch(a){if(a instanceof Error&&console.error(`${o} error:`,a.message),!t())return;this._setSubscription(r,{...i,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(r,{...i,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,t){const r=this._subscriptionCallbacksByServerSubscriptionId[e];r!==void 0&&r.forEach(i=>{try{i(...t)}catch(s){console.error(s)}})}_wsOnAccountNotification(e){const{result:t,subscription:r}=Vt(e,S8e);this._handleServerNotification(r,[t.value,t.context])}_makeSubscription(e,t){const r=this._nextClientSubscriptionId++,i=JV([e.method,t]),s=this._subscriptionsByHash[i];return s===void 0?this._subscriptionsByHash[i]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}:s.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const o=this._subscriptionsByHash[i];fs(o!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),o.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,t,r){const{commitment:i,config:s}=Zi(r),o=this._buildArgs([e.toBase58()],i||this._commitment||"finalized","base64",s);return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:t,subscription:r}=Vt(e,C8e);this._handleServerNotification(r,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,r,i){const{commitment:s,config:o}=Zi(r),a=this._buildArgs([e.toBase58()],s||this._commitment||"finalized","base64",o||(i?{filters:nq(i)}:void 0));return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},a)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,r){const i=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},i)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:t,subscription:r}=Vt(e,nRe);this._handleServerNotification(r,[t.value,t.context])}_wsOnSlotNotification(e){const{result:t,subscription:r}=Vt(e,I8e);this._handleServerNotification(r,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:t,subscription:r}=Vt(e,R8e);this._handleServerNotification(r,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${t}' events could not be found.`)}_buildArgs(e,t,r,i){const s=t||this._commitment;if(s||r||i){let o={};r&&(o.encoding=r),s&&(o.commitment=s),i&&(o=Object.assign(o,i)),e.push(o)}return e}_buildArgsAtLeastConfirmed(e,t,r,i){const s=t||this._commitment;if(s&&!["confirmed","finalized"].includes(s))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,r,i)}_wsOnSignatureNotification(e){const{result:t,subscription:r}=Vt(e,M8e);t.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,t.value==="receivedSignature"?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,r){const i=this._buildArgs([e],r||this._commitment||"finalized"),s=this._makeSubscription({callback:(o,a)=>
1004{if(o.type==="status"){t(o.result,a);try{this.removeSignatureListener(s)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return s}onSignatureWithOptions(e,t,r){const{commitment:i,...s}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([e],i,void 0,s),a=this._makeSubscription({callback:(c,u)=>{t(c,u);try{this.removeSignatureListener(a)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return a}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:t,subscription:r}=Vt(e,k8e);this._handleServerNotification(r,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}};Object.freeze({CreateLookupTable:{index:0,layout:ie.struct([ie.u32("instruction"),xx("recentSlot"),ie.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:ie.struct([ie.u32("instruction")])},ExtendLookupTable:{index:2,layout:ie.struct([ie.u32("instruction"),xx(),ie.seq(Or(),ie.offset(ie.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:ie.struct([ie.u32("instruction")])},CloseLookupTable:{index:4,layout:ie.struct([ie.u32("instruction")])}});new Fn("AddressLookupTab1e1111111111111111111111111");const II=Object.freeze({RequestUnits:{index:0,layout:ie.struct([ie.u8("instruction"),ie.u32("units"),ie.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:ie.struct([ie.u8("instruction"),ie.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:ie.struct([ie.u8("instruction"),ie.u32("units")])},SetComputeUnitPrice:{index:3,layout:ie.struct([ie.u8("instruction"),xx("microLamports")])}});let z_=class{constructor(){}static requestUnits(e){const t=II.RequestUnits,r=Wa(t,e);return new wc({keys:[],programId:this.programId,data:r})}static requestHeapFrame(e){const t=II.RequestHeapFrame,r=Wa(t,e);return new wc({keys:[],programId:this.programId,data:r})}static setComputeUnitLimit(e){const t=II.SetComputeUnitLimit,r=Wa(t,e);return new wc({keys:[],programId:this.programId,data:r})}static setComputeUnitPrice(e){const t=II.SetComputeUnitPrice,r=Wa(t,{microLamports:BigInt(e.microLamports)});return new wc({keys:[],programId:this.programId,data:r})}};z_.programId=new Fn("ComputeBudget111111111111111111111111111111");ie.struct([ie.u8("numSignatures"),ie.u8("padding"),ie.u16("signatureOffset"),ie.u16("signatureInstructionIndex"),ie.u16("publicKeyOffset"),ie.u16("publicKeyInstructionIndex"),ie.u16("messageDataOffset"),ie.u16("messageDataSize"),ie.u16("messageInstructionIndex")]);new Fn("Ed25519SigVerify111111111111111111111111111");fNe.utils.isValidPrivateKey;ie.struct([ie.u8("numSignatures"),ie.u16("signatureOffset"),ie.u8("signatureInstructionIndex"),ie.u16("ethAddressOffset"),ie.u8("ethAddressInstructionIndex"),ie.u16("messageDataOffset"),ie.u16("messageDataSize"),ie.u8("messageInstructionIndex"),ie.blob(20,"ethAddress"),ie.blob(64,"signature"),ie.u8("recoveryId")]);new Fn("KeccakSecp256k11111111111111111111111111111");var fre;new Fn("StakeConfig11111111111111111111111111111111");let pre=class{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}};fre=pre;pre.default=new fre(0,0,Fn.default);Object.freeze({Initialize:{index:0,layout:ie.struct([ie.u32("instruction"),bNe(),vNe()])},Authorize:{index:1,layout:ie.struct([ie.u32("instruction"),Or("newAuthorized"),ie.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:ie.struct([ie.u32("instruction")])},Split:{index:3,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports")])},Withdraw:{index:4,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports")])},Deactivate:{index:5,layout:ie.struct([ie.u32("instruction")])},Merge:{index:7,layout:ie.struct([ie.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:ie.struct([ie.u32("instruction"),Or("newAuthorized"),ie.u32("stakeAuthorizationType"),I2("authoritySeed"),Or("authorityOwner")])}});new Fn("Stake11111111111111111111111111111111111111");Object.freeze({InitializeAccount:{index:0,layout:ie.struct([ie.u32("instruction"),xNe()])},Authorize:{index:1,layout:ie.struct([ie.u32("instruction"),Or("newAuthorized"),ie.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:ie.struct([ie.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:ie.struct([ie.u32("instruction"),ENe()])}});new Fn("Vote111111111111111111111111111111111111111");new Fn("Va1idator1nfo111111111111111111111111111111");Ct({name:Lt(),website:qn(Lt()),details:qn(Lt()),iconUrl:qn(Lt()),keybaseUsername:qn(Lt())});new Fn("Vote111111111111111111111111111111111111111");ie.struct([Or("nodePubkey"),Or("authorizedWithdrawer"),ie.u8("commission"),ie.nu64(),ie.seq(ie.struct([ie.nu64("slot"),ie.u32("confirmationCount")]),ie.offset(ie.u32(),-8),"votes"),ie.u8("rootSlotValid"),ie.nu64("rootSlot"),ie.nu64(),ie.seq(ie.struct([ie.nu64("epoch"),Or("authorizedVoter")]),ie.offset(ie.u32(),-8),"authorizedVoters"),ie.struct([ie.seq(ie.struct([Or("authorizedPubkey"),ie.nu64("epochOfLastAuthorizedSwitch"),ie.nu64("targetEpoch")]),32,"buf"),ie.nu64("idx"),ie.u8("isEmpty")],"priorVoters"),ie.nu64(),ie.seq(ie.struct([ie.nu64("epoch"),ie.nu64("credits"),ie.nu64("prevCredits")]),ie.offset(ie.u32(),-8),"epochCredits"),ie.struct([ie.nu64("slot"),ie.nu64("timestamp")],"lastTimestamp")]);const iRe=1e9;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const dl=BigInt(0),ua=BigInt(1),Py=BigInt(2),gre=BigInt(3),mre=BigInt(4),wre=BigInt(5),sRe=BigInt(7),yre=BigInt(8),oRe=BigInt(9),bre=BigInt(16);function lo(n,e){const t=n%e;return t>=dl?t:e+t}function Rs(n,e,t){let r=n;for(;e-- >dl;)r*=r,r%=t;return r}function oq(n,e){if(n===dl)throw new Error("invert: expected non-zero number");if(e<=dl)throw new Error("invert: expected positive modulus, got "+e);let t=lo(n,e),r=e,i=dl,s=ua;for(;t!==dl;){const a=r/t,c=r%t,u=i-s*a;r=t,t=c,i=s,s=u}if(r!==ua)throw new Error("invert: does not exist");return lo(i,e)}function rU(n,e,t){if(!n.eql(n.sqr(e),t))throw new Error("Cannot find square root")}function vre(n,e){const t=(n.ORDER+ua)/mre,r=n.pow(e,t);return rU(n,r,e),r}function aRe(n,e){const t=(n.ORDER-wre)/yre,r=n.mul(e,Py),i=n.pow(r,t),s=n.mul(e,i),o=n.mul(n.mul(s,Py),i),a=n.mul(s,n.sub(o,n.ONE));return rU(n,a,e),a}function cRe(n){const e=Z1(n),t=xre(n),r=t(e,e.neg(e.ONE)),i=t(e,r),s=t(e,e.neg(r)),o=(n+sRe)/bre;return(a,c)=>{let u=a.pow(c,o),d=a.mul(u,r);
vendor: 9,572 bytes, line 1004
1004const f=a.mul(u,i),m=a.mul(u,s),w=a.eql(a.sqr(d),c),y=a.eql(a.sqr(f),c);u=a.cmov(u,d,w),d=a.cmov(m,f,y);const b=a.eql(a.sqr(d),c),E=a.cmov(u,d,b);return rU(a,E,c),E}}function xre(n){if(n<gre)throw new Error("sqrt is not defined for small field");let e=n-ua,t=0;for(;e%Py===dl;)e/=Py,t++;let r=Py;const i=Z1(n);for(;aq(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(t===1)return vre;let s=i.pow(r,e);const o=(e+ua)/Py;return function(c,u){if(c.is0(u))return u;if(aq(c,u)!==1)throw new Error("Cannot find square root");let d=t,f=c.mul(c.ONE,s),m=c.pow(u,e),w=c.pow(u,o);for(;!c.eql(m,c.ONE);){if(c.is0(m))return c.ZERO;let y=1,b=c.sqr(m);for(;!c.eql(b,c.ONE);)if(y++,b=c.sqr(b),y===d)throw new Error("Cannot find square root");const E=ua<<BigInt(d-y-1),T=c.pow(f,E);d=y,f=c.sqr(T),m=c.mul(m,f),w=c.mul(w,T)}return w}}function lRe(n){return n%mre===gre?vre:n%yre===wre?aRe:n%bre===oRe?cRe(n):xre(n)}const uRe=(n,e)=>(lo(n,e)&ua)===ua,dRe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function hRe(n){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},t=dRe.reduce((r,i)=>(r[i]="function",r),e);return OC(n,t),n}function fRe(n,e,t){if(t<dl)throw new Error("invalid exponent, negatives unsupported");if(t===dl)return n.ONE;if(t===ua)return e;let r=n.ONE,i=e;for(;t>dl;)t&ua&&(r=n.mul(r,i)),i=n.sqr(i),t>>=ua;return r}function Ere(n,e,t=!1){const r=new Array(e.length).fill(t?n.ZERO:void 0),i=e.reduce((o,a,c)=>n.is0(a)?o:(r[c]=o,n.mul(o,a)),n.ONE),s=n.inv(i);return e.reduceRight((o,a,c)=>n.is0(a)?o:(r[c]=n.mul(o,r[c]),n.mul(o,a)),s),r}function aq(n,e){const t=(n.ORDER-ua)/Py,r=n.pow(e,t),i=n.eql(r,n.ONE),s=n.eql(r,n.ZERO),o=n.eql(r,n.neg(n.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function Are(n,e){e!==void 0&&ax(e);const t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function Z1(n,e,t=!1,r={}){if(n<=dl)throw new Error("invalid field: expected ORDER > 0, got "+n);let i,s,o=!1,a;if(typeof e=="object"&&e!=null){if(r.sqrt||t)throw new Error("cannot specify opts in two arguments");const m=e;m.BITS&&(i=m.BITS),m.sqrt&&(s=m.sqrt),typeof m.isLE=="boolean"&&(t=m.isLE),typeof m.modFromBytes=="boolean"&&(o=m.modFromBytes),a=m.allowedLengths}else typeof e=="number"&&(i=e),r.sqrt&&(s=r.sqrt);const{nBitLength:c,nByteLength:u}=Are(n,i);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let d;const f=Object.freeze({ORDER:n,isLE:t,BITS:c,BYTES:u,MASK:kC(c),ZERO:dl,ONE:ua,allowedLengths:a,create:m=>lo(m,n),isValid:m=>{if(typeof m!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof m);return dl<=m&&m<n},is0:m=>m===dl,isValidNot0:m=>!f.is0(m)&&f.isValid(m),isOdd:m=>(m&ua)===ua,neg:m=>lo(-m,n),eql:(m,w)=>m===w,sqr:m=>lo(m*m,n),add:(m,w)=>lo(m+w,n),sub:(m,w)=>lo(m-w,n),mul:(m,w)=>lo(m*w,n),pow:(m,w)=>fRe(f,m,w),div:(m,w)=>lo(m*oq(w,n),n),sqrN:m=>m*m,addN:(m,w)=>m+w,subN:(m,w)=>m-w,mulN:(m,w)=>m*w,inv:m=>oq(m,n),sqrt:s||(m=>(d||(d=lRe(n)),d(f,m))),toBytes:m=>t?sJ(m,u):r$(m,u),fromBytes:(m,w=!0)=>{if(a){if(!a.includes(m.length)||m.length>u)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+m.length);const b=new Uint8Array(u);b.set(m,t?0:b.length-m.length),m=b}if(m.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+m.length);let y=t?m_(m):M8(m);if(o&&(y=lo(y,n)),!w&&!f.isValid(y))throw new Error("invalid field element: outside of range 0..ORDER");return y},invertBatch:m=>Ere(f,m),cmov:(m,w,y)=>y?w:m});return Object.freeze(f)}function Sre(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function _re(n){const e=Sre(n);return e+Math.ceil(e/2)}function pRe(n,e,t=!1){const r=n.length,i=Sre(e),s=_re(e);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=t?m_(n):M8(n),a=lo(o,e-ua)+ua;return t?sJ(a,i):r$(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ex=BigInt(0),Dy=BigInt(1);function _N(n,e){const t=e.negate();return n?t:e}function By(n,e){const t=Ere(n.Fp,e.map(r=>r.Z));return e.map((r,i)=>n.fromAffine(r.toAffine(t[i])))}function Cre(n,e){if(!Number.isSafeInteger(n)||n<=0||n>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+n)}function GO(n,e){Cre(n,e);const t=Math.ceil(e/n)+1,r=2**(n-1),i=2**n,s=kC(n),o=BigInt(n);return{windows:t,windowSize:r,mask:s,maxNumber:i,shiftBy:o}}function cq(n,e,t){const{windowSize:r,mask:i,maxNumber:s,shiftBy:o}=t;let a=Number(n&i),c=n>>o;a>r&&(a-=s,c+=Dy);const u=e*r,d=u+Math.abs(a)-1,f=a===0,m=a<0,w=e%2!==0;return{nextN:c,offset:d,isZero:f,isNeg:m,isNegF:w,offsetF:u}}function gRe(n,e){if(!Array.isArray(n))throw new Error("array expected");n.forEach((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)})}function mRe(n,e){if(!Array.isArray(n))throw new Error("array of scalars expected");n.forEach((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)})}const ZO=new WeakMap,Tre=new WeakMap;function QO(n){return Tre.get(n)||1}function lq(n){if(n!==Ex)throw new Error("invalid wNAF")}class Ire{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let i=e;for(;t>Ex;)t&Dy&&(r=r.add(i)),i=i.double(),t>>=Dy;return r}precomputeWindow(e,t){const{windows:r,windowSize:i}=GO(t,this.bits),s=[];let o=e,a=o;for(let c=0;c<r;c++){a=o,s.push(a);for(let u=1;u<i;u++)a=a.add(o),s.push(a);o=a.double()}return s}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let i=this.ZERO,s=this.BASE;const o=GO(e,this.bits);for(let a=0;a<o.windows;a++){const{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:m,offsetF:w}=cq(r,a,o);r=c,d?s=s.add(_N(m,t[w])):i=i.add(_N(f,t[u]))}return lq(r),{p:i,f:s}}wNAFUnsafe(e,t,r,i=this.ZERO){const s=GO(e,this.bits);for(let o=0;o<s.windows&&r!==Ex;o++){const{nextN:a,offset:c,isZero:u,isNeg:d}=cq(r,o,s);if(r=a,!u){const f=t[c];i=i.add(d?f.negate():f)}}return lq(r),i}getPrecomputes(e,t,r){let i=ZO.get(t);return i||(i=this.precomputeWindow(t,e),e!==1&&(typeof r=="function"&&(i=r(i)),ZO.set(t,i))),i}cached(e,t,r){const i=QO(e);return this.wNAF(i,this.getPrecomputes(i,e,r),t)}unsafe(e,t,r,i){const s=QO(e);return s===1?this._unsafeLadder(e,t,i):this.wNAFUnsafe(s,this.getPrecomputes(s,e,r),t,i)}createCache(e,t){Cre(t,this.bits),Tre.set(e,t),ZO.delete(e)}hasCache(e){return QO(e)!==1}}function wRe(n,e,t,r){let i=e,s=n.ZERO,o=n.ZERO;for(;t>Ex||r>Ex;)t&Dy&&(s=s.add(i)),r&Dy&&(o=o.add(i)),i=i.double(),t>>=Dy,r>>=Dy;return{p1:s,p2:o}}function Nre(n,e,t,r){gRe(t,n),mRe(r,e);const i=t.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=n.ZERO,a=oJ(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=kC(c),d=new Array(Number(u)+1).fill(o),f=Math.floor((e.BITS-1)/c)*c;let m=o;for(let w=f;w>=0;w-=c){d.fill(o);for(let b=0;b<s;b++){const E=r[b],T=Number(E>>BigInt(w)&u);d[T]=d[T].add(t[b])}let y=o;for(let b=d.length-1,E=o;b>0;b--)E=E.add(d[b]),y=y.add(E);if(m=m.add(y),w!==0)for(let b=0;b<c;b++)m=m.double()}return m}function uq(n,e,t){if(e){if(e.ORDER!==n)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return hRe(e),e}else return Z1(n,{isLE:t})}function Rre(n,e,t={},r){if(r===void 0&&(r=n==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${n} CURVE object`);for(const c of["p","n","h"]){const u=e[c];if(!(typeof u=="bigint"&&u>Ex))throw new Error(`CURVE.${c} must be positive bigint`)}const i=uq(e.p,t.Fp,r),s=uq(e.n,t.Fn,r),a=["Gx","Gy","a",n==="weierstrass"?"b":"d"];for(const c of a)if(!i.isValid(e[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:i,Fn:s}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Bm=BigInt(0),Mo=BigInt(1),XO=BigInt(2),yRe=BigInt(8);function bRe(n,e,t,r){const i=n.sqr(t),s=n.sqr(r),o=n.add(n.mul(e.a,i),s),a=n.add(n.ONE,n.mul(e.d,n.mul(i,s)));return n.eql(o,a)}function vRe(n,e={}){const t=Rre("edwards",n,e,e.FpFnLE),{Fp:r,Fn:i}=t;let s=t.CURVE;const{h:o}=s;OC(e,{},{uvRatio:"function"});const a=XO<<BigInt(i.BYTES*8)-Mo,c=E=>r.create(E),u=e.uvRatio||((E,T)=>{try{return{isValid:!0,value:r.sqrt(r.div(E,T))}}catch{return{isValid:!1,value:Bm}}});if(!bRe(r,s,s.Gx,s.Gy))throw new Error("bad curve params: generator point");function d(E,T,N=!1){const I=N?Mo:Bm;return BD("coordinate "+E,T,I,a),T}function f(E){if(!(E instanceof y))throw new Error("ExtendedPoint expected")}const m=j6((E,T)=>{const{X:N,Y:I,Z:H}=E,L=E.is0();T==null&&(T=L?yRe:r.inv(H));const U=c(N*T),K=c(I*T),Y=r.mul(H,T);if(L)return{x:Bm,y:Mo};if(Y!==Mo)throw new Error("invZ was invalid");return{x:U,y:K}}),w=j6(E=>{const{a:T,d:N}=s;if(E.is0())throw new Error("bad point: ZERO");const{X:I,Y:H,Z:L,T:U}=E,K=c(I*I),Y=c(H*H),k=c(L*L),j=c(k*k),V=c(K*T),W=c(k*c(V+Y)),$=c(j+c(N*c(K*Y)));if(W!==$)throw new Error("bad point: equation left != right (1)");const A=c(I*H),_=c(L*U);if(A!==_)throw new Error("bad point: equation left != right (2)");return!0});class y{constructor(T,N,I,H){this.X=d("x",T),this.Y=d("y",N),this.Z=d("z",I,!0),this.T=d("t",H),Object.freeze(this)}static CURVE(){return s}static fromAffine(T){if(T instanceof y)throw new Error("extended point not allowed");const{x:N,y:I}=T||{};return d("x",N),d("y",I),new y(N,I,Mo,c(N*I))}static fromBytes(T,N=!1){const I=r.BYTES,{a:H,d:L}=s;T=Qz(Hd(T,I,"point")),o1(N,"zip215");
1004const U=Qz(T),K=T[I-1];U[I-1]=K&-129;const Y=m_(U),k=N?a:r.ORDER;BD("point.y",Y,Bm,k);const j=c(Y*Y),V=c(j-Mo),W=c(L*j-H);let{isValid:$,value:A}=u(V,W);if(!$)throw new Error("bad point: invalid y coordinate");const _=(A&Mo)===Mo,R=(K&128)!==0;if(!N&&A===Bm&&R)throw new Error("bad point: x=0 and x_0=1");return R!==_&&(A=c(-A)),y.fromAffine({x:A,y:Y})}static fromHex(T,N=!1){return y.fromBytes(Ms("point",T),N)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(T=8,N=!0){return b.createCache(this,T),N||this.multiply(XO),this}assertValidity(){w(this)}equals(T){f(T);const{X:N,Y:I,Z:H}=this,{X:L,Y:U,Z:K}=T,Y=c(N*K),k=c(L*H),j=c(I*K),V=c(U*H);return Y===k&&j===V}is0(){return this.equals(y.ZERO)}negate(){return new y(c(-this.X),this.Y,this.Z,c(-this.T))}double(){const{a:T}=s,{X:N,Y:I,Z:H}=this,L=c(N*N),U=c(I*I),K=c(XO*c(H*H)),Y=c(T*L),k=N+I,j=c(c(k*k)-L-U),V=Y+U,W=V-K,$=Y-U,A=c(j*W),_=c(V*$),R=c(j*$),P=c(W*V);return new y(A,_,P,R)}add(T){f(T);const{a:N,d:I}=s,{X:H,Y:L,Z:U,T:K}=this,{X:Y,Y:k,Z:j,T:V}=T,W=c(H*Y),$=c(L*k),A=c(K*I*V),_=c(U*j),R=c((H+L)*(Y+k)-W-$),P=_-A,q=_+A,F=c($-N*W),z=c(R*P),B=c(q*F),C=c(R*F),M=c(P*q);return new y(z,B,M,C)}subtract(T){return this.add(T.negate())}multiply(T){if(!i.isValidNot0(T))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:N,f:I}=b.cached(this,T,H=>By(y,H));return By(y,[N,I])[0]}multiplyUnsafe(T,N=y.ZERO){if(!i.isValid(T))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return T===Bm?y.ZERO:this.is0()||T===Mo?this:b.unsafe(this,T,I=>By(y,I),N)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}isTorsionFree(){return b.unsafe(this,s.n).is0()}toAffine(T){return m(this,T)}clearCofactor(){return o===Mo?this:this.multiplyUnsafe(o)}toBytes(){const{x:T,y:N}=this.toAffine(),I=r.toBytes(N);return I[I.length-1]|=T&Mo?128:0,I}toHex(){return Jl(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(T){return By(y,T)}static msm(T,N){return Nre(y,i,T,N)}_setWindowSize(T){this.precompute(T)}toRawBytes(){return this.toBytes()}}y.BASE=new y(s.Gx,s.Gy,Mo,c(s.Gx*s.Gy)),y.ZERO=new y(Bm,Mo,Mo,Bm),y.Fp=r,y.Fn=i;const b=new Ire(y,i.BITS);return y.BASE.precompute(8),y}function xRe(n,e,t={}){if(typeof e!="function")throw new Error('"hash" function param is required');OC(t,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:r}=t,{BASE:i,Fp:s,Fn:o}=n,a=t.randomBytes||MC,c=t.adjustScalarBytes||(k=>k),u=t.domain||((k,j,V)=>{if(o1(V,"phflag"),j.length||V)throw new Error("Contexts/pre-hash are not supported");return k});function d(k){return o.create(m_(k))}function f(k){const j=I.secretKey;k=Ms("private key",k,j);const V=Ms("hashed private key",e(k),2*j),W=c(V.slice(0,j)),$=V.slice(j,2*j),A=d(W);return{head:W,prefix:$,scalar:A}}function m(k){const{head:j,prefix:V,scalar:W}=f(k),$=i.multiply(W),A=$.toBytes();return{head:j,prefix:V,scalar:W,point:$,pointBytes:A}}function w(k){return m(k).pointBytes}function y(k=Uint8Array.of(),...j){const V=vo(...j);return d(e(u(V,Ms("context",k),!!r)))}function b(k,j,V={}){k=Ms("message",k),r&&(k=r(k));const{prefix:W,scalar:$,pointBytes:A}=m(j),_=y(V.context,W,k),R=i.multiply(_).toBytes(),P=y(V.context,R,A,k),q=o.create(_+P*$);if(!o.isValid(q))throw new Error("sign failed: invalid s");const F=vo(R,o.toBytes(q));return Hd(F,I.signature,"result")}const E={zip215:!0};function T(k,j,V,W=E){const{context:$,zip215:A}=W,_=I.signature;k=Ms("signature",k,_),j=Ms("message",j),V=Ms("publicKey",V,I.publicKey),A!==void 0&&o1(A,"zip215"),r&&(j=r(j));const R=_/2,P=k.subarray(0,R),q=m_(k.subarray(R,_));let F,z,B;try{F=n.fromBytes(V,A),z=n.fromBytes(P,A),B=i.multiplyUnsafe(q)}catch{return!1}if(!A&&F.isSmallOrder())return!1;const C=y($,z.toBytes(),F.toBytes(),j);return z.add(F.multiplyUnsafe(C)).subtract(B).clearCofactor().is0()}const N=s.BYTES,I={secretKey:N,publicKey:N,signature:2*N,seed:N};function H(k=a(I.seed)){return Hd(k,I.seed,"seed")}function L(k){const j=Y.randomSecretKey(k);return{secretKey:j,publicKey:w(j)}}function U(k){return z1(k)&&k.length===o.BYTES}function K(k,j){try{return!!n.fromBytes(k,j)}catch{return!1}}const Y={getExtendedPublicKey:m,randomSecretKey:H,isValidSecretKey:U,isValidPublicKey:K,toMontgomery(k){const{y:j}=n.fromBytes(k),V=I.publicKey,W=V===32;if(!W&&V!==57)throw new Error("only defined for 25519 and 448");const $=W?s.div(Mo+j,Mo-j):s.div(j-Mo,j+Mo);return s.toBytes($)},toMontgomeryPriv(k){const j=I.secretKey;Hd(k,j);const V=e(k.subarray(0,j));return c(V).subarray(0,j)},randomPrivateKey:H,precompute(k=8,j=n.BASE){return j.precompute(k,!1)}};return Object.freeze({keygen:L,getPublicKey:w,sign:b,verify:T,utils:Y,Point:n,lengths:I})}function ERe(n){const e={a:n.a,d:n.d,p:n.Fp.ORDER,n:n.n,h:n.h,Gx:n.Gx,Gy:n.Gy},t=n.Fp,r=Z1(e.n,n.nBitLength,!0),i={Fp:t,Fn:r,uvRatio:n.uvRatio},s={randomBytes:n.randomBytes,adjustScalarBytes:n.adjustScalarBytes,domain:n.domain,prehash:n.prehash,mapToCurve:n.mapToCurve};return{CURVE:e,curveOpts:i,hash:n.hash,eddsaOpts:s}}function ARe(n,e){const t=e.Point;return Object.assign({},e,{ExtendedPoint:t,CURVE:n,nBitLength:t.Fn.BITS,nByteLength:t.Fn.BYTES})}function SRe(n){const{CURVE:e,curveOpts:t,hash:r,eddsaOpts:i}=ERe(n),s=vRe(e,t),o=xRe(s,r,i);return ARe(n,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _Re=BigInt(1),dq=BigInt(2);BigInt(3);const CRe=BigInt(5),TRe=BigInt(8),iU=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Mre={p:iU,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:TRe,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function IRe(n){const e=BigInt(10),t=BigInt(20),r=BigInt(40),i=BigInt(80),s=iU,a=n*n%s*n%s,c=Rs(a,dq,s)*a%s,u=Rs(c,_Re,s)*n%s,d=Rs(u,CRe,s)*u%s,f=Rs(d,e,s)*d%s,m=Rs(f,t,s)*f%s,w=Rs(m,r,s)*m%s,y=Rs(w,i,s)*w%s,b=Rs(y,i,s)*w%s,E=Rs(b,e,s)*d%s;return{pow_p_5_8:Rs(E,dq,s)*n%s,b2:a}}function NRe(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}const hq=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function RRe(n,e){const t=iU,r=lo(e*e*e,t),i=lo(r*r*e,t),s=IRe(n*i).pow_p_5_8;let o=lo(n*r*s,t);const a=lo(e*o*o,t),c=o,u=lo(o*hq,t),d=a===n,f=a===lo(-n,t),m=a===lo(-n*hq,t);return d&&(o=c),(f||m)&&(o=u),uRe(o,t)&&(o=lo(-o,t)),{isValid:d||f,value:o}}const MRe=Z1(Mre.p,{isLE:!0}),kRe={...Mre,Fp:MRe,hash:rJ,adjustScalarBytes:NRe,uvRatio:RRe},rE=SRe(kRe);var JO,fq;function ORe(){if(fq)return JO;fq=1;var n=K$().Buffer;function e(t){if(t.length>=255)throw new TypeError("Alphabet too long");
vendor: 4,339 bytes, line 1004
1004for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var s=0;s<t.length;s++){var o=t.charAt(s),a=o.charCodeAt(0);if(r[a]!==255)throw new TypeError(o+" is ambiguous");r[a]=s}var c=t.length,u=t.charAt(0),d=Math.log(c)/Math.log(256),f=Math.log(256)/Math.log(c);function m(b){if((Array.isArray(b)||b instanceof Uint8Array)&&(b=n.from(b)),!n.isBuffer(b))throw new TypeError("Expected Buffer");if(b.length===0)return"";for(var E=0,T=0,N=0,I=b.length;N!==I&&b[N]===0;)N++,E++;for(var H=(I-N)*f+1>>>0,L=new Uint8Array(H);N!==I;){for(var U=b[N],K=0,Y=H-1;(U!==0||K<T)&&Y!==-1;Y--,K++)U+=256*L[Y]>>>0,L[Y]=U%c>>>0,U=U/c>>>0;if(U!==0)throw new Error("Non-zero carry");T=K,N++}for(var k=H-T;k!==H&&L[k]===0;)k++;for(var j=u.repeat(E);k<H;++k)j+=t.charAt(L[k]);return j}function w(b){if(typeof b!="string")throw new TypeError("Expected String");if(b.length===0)return n.alloc(0);for(var E=0,T=0,N=0;b[E]===u;)T++,E++;for(var I=(b.length-E)*d+1>>>0,H=new Uint8Array(I);E<b.length;){var L=b.charCodeAt(E);if(L>255)return;var U=r[L];if(U===255)return;for(var K=0,Y=I-1;(U!==0||K<N)&&Y!==-1;Y--,K++)U+=c*H[Y]>>>0,H[Y]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");N=K,E++}for(var k=I-N;k!==I&&H[k]===0;)k++;var j=n.allocUnsafe(T+(I-k));j.fill(0,0,T);for(var V=T;k!==I;)j[V++]=H[k++];return j}function y(b){var E=w(b);if(E)return E;throw new Error("Non-base"+c+" character")}return{encode:m,decodeUnsafe:w,decode:y}}return JO=e,JO}var eP,pq;function PRe(){if(pq)return eP;pq=1;var n=ORe(),e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return eP=n(e),eP}var DRe=PRe();const ca=xo(DRe);var BRe=8078e3,LRe=8078001,$Re=8078004,URe=8078005,jRe=8078006,zRe=8078011;function kre(n){return Array.isArray(n)?"%5B"+n.map(kre).join("%2C%20")+"%5D":typeof n=="bigint"?`${n}n`:encodeURIComponent(String(n!=null&&Object.getPrototypeOf(n)===null?{...n}:n))}function FRe([n,e]){return`${n}=${kre(e)}`}function WRe(n){const e=Object.entries(n).map(FRe).join("&");return btoa(e)}function HRe(n,e={}){{let t=`Solana error #${n}; Decode this error by running \`npx @solana/errors decode -- ${n}`;return Object.keys(e).length&&(t+=` '${WRe(e)}'`),`${t}\``}}var G2=class extends Error{constructor(...[e,t]){let r,i;if(t){const{cause:o,...a}=t;o&&(i={cause:o}),Object.keys(a).length>0&&(r=a)}const s=HRe(e,r);super(s,i);Ts(this,"cause",this.cause);Ts(this,"context");this.context={__code:e,...r},this.name="SolanaError"}};function VRe(n,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(n)}function qRe(n){return Object.freeze({...n,encode:e=>{const t=new Uint8Array(VRe(e,n));return n.write(e,t,0),t}})}function KRe(n){return Object.freeze({...n,decode:(e,t=0)=>n.read(e,t)[0]})}function l2(n){return"fixedSize"in n&&typeof n.fixedSize=="number"}function YRe(n,e){if(l2(n)!==l2(e))throw new G2($Re);if(l2(n)&&l2(e)&&n.fixedSize!==e.fixedSize)throw new G2(URe,{decoderFixedSize:e.fixedSize,encoderFixedSize:n.fixedSize});if(!l2(n)&&!l2(e)&&n.maxSize!==e.maxSize)throw new G2(jRe,{decoderMaxSize:e.maxSize,encoderMaxSize:n.maxSize});return{...e,...n,decode:e.decode,encode:n.encode,read:e.read,write:n.write}}function GRe(n,e,t=0){if(e.length-t<=0)throw new G2(BRe,{codecDescription:n})}function ZRe(n,e,t,r=0){const i=t.length-r;if(i<e)throw new G2(LRe,{bytesLength:i,codecDescription:n,expected:e})}function QRe(n,e,t,r){if(r<e||r>t)throw new G2(zRe,{codecDescription:n,max:t,min:e,value:r})}function Ore(n){return(n==null?void 0:n.endian)!==1}function XRe(n){return qRe({fixedSize:n.size,write(e,t,r){n.range&&QRe(n.name,n.range[0],n.range[1],e);const i=new ArrayBuffer(n.size);return n.set(new DataView(i),e,Ore(n.config)),t.set(new Uint8Array(i),r),r+n.size}})}function JRe(n){return KRe({fixedSize:n.size,read(e,t=0){GRe(n.name,e,t),ZRe(n.name,n.size,e,t);const r=new DataView(eMe(e,t,n.size));return[n.get(r,Ore(n.config)),t+n.size]}})}function eMe(n,e,t){const r=n.byteOffset+(e??0),i=t??n.byteLength;return n.buffer.slice(r,r+i)}var Pre=(n={})=>XRe({config:n,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,t,r)=>e.setBigUint64(0,BigInt(t),r),size:8}),tMe=(n={})=>JRe({config:n,get:(e,t)=>e.getBigUint64(0,t),name:"u64",size:8}),nMe=(n={})=>YRe(Pre(n),tMe(n));class rMe extends TypeError{constructor(e,t){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;
vendor: 1,210 bytes, line 1004
1004super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function iMe(n){return QC(n)&&typeof n[Symbol.iterator]=="function"}function QC(n){return typeof n=="object"&&n!=null}function CN(n){return QC(n)&&!Array.isArray(n)}function nh(n){return typeof n=="symbol"?n.toString():typeof n=="string"?JSON.stringify(n):`${n}`}function sMe(n){const{done:e,value:t}=n.next();return e?void 0:t}function oMe(n,e,t,r){if(n===!0)return;n===!1?n={}:typeof n=="string"&&(n={message:n});const{path:i,branch:s}=e,{type:o}=t,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${nh(r)}\``}=n;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...n,message:c}}function*gq(n,e,t,r){iMe(n)||(n=[n]);for(const i of n){const s=oMe(i,e,t,r);s&&(yield s)}}function*sU(n,e,t={}){const{path:r=[],branch:i=[n],coerce:s=!1,mask:o=!1}=t,a={path:r,branch:i,mask:o};s&&(n=e.coercer(n,a));let c="valid";for(const u of e.validator(n,a))u.explanation=t.message,c="not_valid",yield[u,void 0];for(let[u,d,f]of e.entries(n,a)){const m=sU(d,f,{path:u===void 0?r:[...r,u],branch:u===void 0?i:[...i,d],c
1004oerce:s,mask:o,message:t.message});for(const w of m)w[0]?(c=w[0].refinement!=null?"not_refined":"not_valid",yield[w[0],void 0]):s&&(d=w[1],u===void 0?n=d:n instanceof Map?n.set(u,d):n instanceof Set?n.add(d):QC(n)&&(d!==void 0||u in n)&&(n[u]=d))}if(c!=="not_valid")for(const u of e.refiner(n,a))u.explanation=t.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,n])}let Kf=class{constructor(e){const{type:t,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const d=i(c,u);return gq(d,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const d=s(c,u);return gq(d,u,this,c)}:this.refiner=()=>[]}assert(e,t){return Dre(e,this,t)}create(e,t){return qt(e,this,t)}is(e){return Bre(e,this)}mask(e,t){return aMe(e,this,t)}validate(e,t={}){return XC(e,this,t)}};function Dre(n,e,t){const r=XC(n,e,{message:t});if(r[0])throw r[0]}function qt(n,e,t){const r=XC(n,e,{coerce:!0,message:t});if(r[0])throw r[0];return r[1]}function aMe(n,e,t){const r=XC(n,e,{coerce:!0,mask:!0,message:t});if(r[0])throw r[0];return r[1]}function Bre(n,e){return!XC(n,e)[0]}function XC(n,e,t={}){const r=sU(n,e,t),i=sMe(r);return i[0]?[new rMe(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function Q1(n,e){return new Kf({type:n,schema:null,validator:e})}function cMe(){return Q1("any",()=>!0)}function Xt(n){return new Kf({type:"array",schema:n,*entries(e){if(n&&Array.isArray(e))for(const[t,r]of e.entries())yield[t,r,n]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${nh(e)}`}})}function zf(){return Q1("boolean",n=>typeof n=="boolean")}function oU(n){return Q1("instance",e=>e instanceof n||`Expected a \`${n.name}\` instance, but received: ${nh(e)}`)}function vs(n){const e=nh(n),t=typeof n;return new Kf({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?n:null,validator(r){return r===n||`Expected the literal \`${e}\`, but received: ${nh(r)}`}})}function lMe(){return Q1("never",()=>!1)}function tn(n){return new Kf({...n,validator:(e,t)=>e===null||n.validator(e,t),refiner:(e,t)=>e===null||n.refiner(e,t)})}function Ve(){return Q1("number",n=>typeof n=="number"&&!isNaN(n)||`Expected a number, but received: ${nh(n)}`)}function Ln(n){return new Kf({...n,validator:(e,t)=>e===void 0||n.validator(e,t),refiner:(e,t)=>e===void 0||n.refiner(e,t)})}function Lre(n,e){return new Kf({type:"record",schema:null,*entries(t){if(QC(t))for(const r in t){const i=t[r];yield[r,r,n],yield[r,i,e]}},validator(t){return CN(t)||`Expected an object, but received: ${nh(t)}`},coercer(t){return CN(t)?{...t}:t}})}function $t(){return Q1("string",n=>typeof n=="string"||`Expected a string, but received: ${nh(n)}`)}function aU(n){const e=lMe();return new Kf({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const r=Math.max(n.length,t.length);for(let i=0;i<r;i++)yield[i,t[i],n[i]||e]}},validator(t){return Array.isArray(t)||`Expected an array, but received: ${nh(t)}`},coercer(t){return Array.isArray(t)?t.slice():t}})}function Tt(n){const e=Object.keys(n);return new Kf({type:"type",schema:n,*entries(t){if(QC(t))for(const r of e)yield[r,t[r],n[r]]},validator(t){return CN(t)||`Expected an object, but received: ${nh(t)}`},coercer(t){return CN(t)?{...t}:t}})}function _c(n){const e=n.map(t=>t.type).join(" | ");return new Kf({type:"union",schema:null,coercer(t,r){for(const i of n){const[s,o]=i.validate(t,{coerce:!0,mask:r.mask});if(!s)return o}return t},validator(t,r){const i=[];for(const s of n){const[...o]=sU(t,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${nh(t)}`,...i]}})}function iE(){return Q1("unknown",()=>!0)}function JC(n,e,t){return new Kf({...n,coercer:(r,i)=>Bre(r,e)?n.coercer(t(r,i),i):n.coercer(r,i)})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const mq=(n,e)=>(n+(n>=0?e:-e)/$re)/e;function uMe(n,e,t){const[[r,i],[s,o]]=e,a=mq(o*n,t),c=mq(-i*n,t);let u=n-a*r-c*s,d=-a*i-c*o;const f=u<Jp,m=d<Jp;f&&(u=-u),m&&(d=-d);const w=kC(Math.ceil(oJ(t)/2))+Z2;if(u<Jp||u>=w||d<Jp||d>=w)throw new Error("splitScalar (endomorphism): failed, k="+n);return{k1neg:f,k1:u,k2neg:m,k2:d}}function Z7(n){if(!["compact","recovered","der"].includes(n))throw new Error('Signature format must be "compact", "recovered", or "der"');return n}function tP(n,e){const t={};for(let r of Object.keys(e))t[r]=n[r]===void 0?e[r]:n[r];return o1(t.lowS,"lowS"),o1(t.prehash,"prehash"),t.format!==void 0&&Z7(t.format),t}
vendor: 17,942 bytes, line 1004
1004class dMe extends Error{constructor(e=""){super(e)}}const Vp={Err:dMe,_tlv:{encode:(n,e)=>{const{Err:t}=Vp;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length&1)throw new t("tlv.encode: unpadded data");const r=e.length/2,i=QT(r);if(i.length/2&128)throw new t("tlv.encode: long form length too big");const s=r>127?QT(i.length/2|128):"";return QT(n)+s+i+e},decode(n,e){const{Err:t}=Vp;let r=0;if(n<0||n>256)throw new t("tlv.encode: wrong tag");if(e.length<2||e[r++]!==n)throw new t("tlv.decode: wrong tlv");const i=e[r++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new t("tlv.decode(long): indefinite length not supported");if(c>4)throw new t("tlv.decode(long): byte length is too big");const u=e.subarray(r,r+c);if(u.length!==c)throw new t("tlv.decode: length bytes not complete");if(u[0]===0)throw new t("tlv.decode(long): zero leftmost byte");for(const d of u)o=o<<8|d;if(r+=c,o<128)throw new t("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new t("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(n){const{Err:e}=Vp;if(n<Jp)throw new e("integer: negative integers are not allowed");let t=QT(n);if(Number.parseInt(t[0],16)&8&&(t="00"+t),t.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return t},decode(n){const{Err:e}=Vp;if(n[0]&128)throw new e("invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return M8(n)}},toSig(n){const{Err:e,_int:t,_tlv:r}=Vp,i=Ms("signature",n),{v:s,l:o}=r.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:u,l:d}=r.decode(2,c);if(d.length)throw new e("invalid signature: left bytes after parsing");return{r:t.decode(a),s:t.decode(u)}},hexFromSig(n){const{_tlv:e,_int:t}=Vp,r=e.encode(2,t.encode(n.r)),i=e.encode(2,t.encode(n.s)),s=r+i;return e.encode(48,s)}},Jp=BigInt(0),Z2=BigInt(1),$re=BigInt(2),NI=BigInt(3),hMe=BigInt(4);function N2(n,e){const{BYTES:t}=n;let r;if(typeof e=="bigint")r=e;else{let i=Ms("private key",e);try{r=n.fromBytes(i)}catch{throw new Error(`invalid private key: expected ui8a of size ${t}, got ${typeof e}`)}}if(!n.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function fMe(n,e={}){const t=Rre("weierstrass",n,e),{Fp:r,Fn:i}=t;let s=t.CURVE;const{h:o,n:a}=s;OC(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=e;if(c&&(!r.is0(s.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const u=jre(r,i);function d(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function f(W,$,A){const{x:_,y:R}=$.toAffine(),P=r.toBytes(_);if(o1(A,"isCompressed"),A){d();const q=!r.isOdd(R);return vo(Ure(q),P)}else return vo(Uint8Array.of(4),P,r.toBytes(R))}function m(W){Hd(W,void 0,"Point");const{publicKey:$,publicKeyUncompressed:A}=u,_=W.length,R=W[0],P=W.subarray(1);if(_===$&&(R===2||R===3)){const q=r.fromBytes(P);if(!r.isValid(q))throw new Error("bad point: is not on curve, wrong x");const F=b(q);let z;try{z=r.sqrt(F)}catch(M){const Z=M instanceof Error?": "+M.message:"";throw new Error("bad point: is not on curve, sqrt error"+Z)}d();const B=r.isOdd(z);return(R&1)===1!==B&&(z=r.neg(z)),{x:q,y:z}}else if(_===A&&R===4){const q=r.BYTES,F=r.fromBytes(P.subarray(0,q)),z=r.fromBytes(P.subarray(q,q*2));if(!E(F,z))throw new Error("bad point: is not on curve");return{x:F,y:z}}else throw new Error(`bad point: got length ${_}, expected compressed=${$} or uncompressed=${A}`)}const w=e.toBytes||f,y=e.fromBytes||m;function b(W){const $=r.sqr(W),A=r.mul($,W);return r.add(r.add(A,r.mul(W,s.a)),s.b)}function E(W,$){const A=r.sqr($),_=b(W);return r.eql(A,_)}if(!E(s.Gx,s.Gy))throw new Error("bad curve params: generator point");const T=r.mul(r.pow(s.a,NI),hMe),N=r.mul(r.sqr(s.b),BigInt(27));if(r.is0(r.add(T,N)))throw new Error("bad curve params: a or b");function I(W,$,A=!1){if(!r.isValid($)||A&&r.is0($))throw new Error(`bad point coordinate ${W}`);return $}function H(W){if(!(W instanceof k))throw new Error("ProjectivePoint expected")}function L(W){if(!c||!c.basises)throw new Error("no endo");return uMe(W,c.basises,i.ORDER)}const U=j6((W,$)=>{const{X:A,Y:_,Z:R}=W;if(r.eql(R,r.ONE))return{x:A,y:_};const P=W.is0();$==null&&($=P?r.ONE:r.inv(R));const q=r.mul(A,$),F=r.mul(_,$),z=r.mul(R,$);if(P)return{x:r.ZERO,y:r.ZERO};if(!r.eql(z,r.ONE))throw new Error("invZ was invalid");return{x:q,y:F}}),K=j6(W=>{if(W.is0()){if(e.allowInfinityPoint&&!r.is0(W.Y))return;throw new Error("bad point: ZERO")}const{x:$,y:A}=W.toAffine();if(!r.isValid($)||!r.isValid(A))throw new Error("bad point: x or y not field elements");if(!E($,A))throw new Error("bad point: equation left != right");if(!W.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function Y(W,$,A,_,R){return A=new k(r.mul(A.X,W),A.Y,A.Z),$=_N(_,$),A=_N(R,A),$.add(A)}class k{constructor($,A,_){this.X=I("x",$),this.Y=I("y",A,!0),this.Z=I("z",_),Object.freeze(this)}static CURVE(){return s}static fromAffine($){const{x:A,y:_}=$||{};if(!$||!r.isValid(A)||!r.isValid(_))throw new Error("invalid affine point");if($ instanceof k)throw new Error("projective point not allowed");return r.is0(A)&&r.is0(_)?k.ZERO:new k(A,_,r.ONE)}static fromBytes($){const A=k.fromAffine(y(Hd($,void 0,"point")));return A.assertValidity(),A}static fromHex($){return k.fromBytes(Ms("pointHex",$))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute($=8,A=!0){return V.createCache(this,$),A||this.multiply(NI),this}assertValidity(){K(this)}hasEvenY(){const{y:$}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd($)}equals($){H($);const{X:A,Y:_,Z:R}=this,{X:P,Y:q,Z:F}=$,z=r.eql(r.mul(A,F),r.mul(P,R)),B=r.eql(r.mul(_,F),r.mul(q,R));return z&&B}negate(){return new k(this.X,r.neg(this.Y),this.Z)}double(){const{a:$,b:A}=s,_=r.mul(A,NI),{X:R,Y:P,Z:q}=this;let F=r.ZERO,z=r.ZERO,B=r.ZERO,C=r.mul(R,R),M=r.mul(P,P),Z=r.mul(q,q),J=r.mul(R,P);return J=r.add(J,J),B=r.mul(R,q),B=r.add(B,B),F=r.mul($,B),z=r.mul(_,Z),z=r.add(F,z),F=r.sub(M,z),z=r.add(M,z),z=r.mul(F,z),F=r.mul(J,F),B=r.mul(_,B),Z=r.mul($,Z),J=r.sub(C,Z),J=r.mul($,J),J=r.add(J,B),B=r.add(C,C),C=r.add(B,C),C=r.add(C,Z),C=r.mul(C,J),z=r.add(z,C),Z=r.mul(P,q),Z=r.add(Z,Z),C=r.mul(Z,J),F=r.sub(F,C),B=r.mul(Z,M),B=r.add(B,B),B=r.add(B,B),new k(F,z,B)}add($){H($);const{X:A,Y:_,Z:R}=this,{X:P,Y:q,Z:F}=$;let z=r.ZERO,B=r.ZERO,C=r.ZERO;const M=s.a,Z=r.mul(s.b,NI);let J=r.mul(A,P),ae=r.mul(_,q),we=r.mul(R,F),he=r.add(A,_),xe=r.add(P,q);he=r.mul(he,xe),xe=r.add(J,ae),he=r.sub(he,xe),xe=r.add(A,R);let Se=r.add(P,F);return xe=r.mul(xe,Se),Se=r.add(J,we),xe=r.sub(xe,Se),Se=r.add(_,R),z=r.add(q,F),Se=r.mul(Se,z),z=r.add(ae,we),Se=r.sub(Se,z),C=r.mul(M,xe),z=r.mul(Z,we),C=r.add(z,C),z=r.sub(ae,C),C=r.add(ae,C),B=r.mul(z,C),ae=r.add(J,J),ae=r.add(ae,J),we=r.mul(M,we),xe=r.mul(Z,xe),ae=r.add(ae,we),we=r.sub(J,we),we=r.mul(M,we),xe=r.add(xe,we),J=r.mul(ae,xe),B=r.add(B,J),J=r.mul(Se,xe),z=r.mul(he,z),z=r.sub(z,J),J=r.mul(he,ae),C=r.mul(Se,C),C=r.add(C,J),new k(z,B,C)}subtract($){return this.add($.negate())}is0(){return this.equals(k.ZERO)}multiply($){const{endo:A}=e;if(!i.isValidNot0($))throw new Error("invalid scalar: out of range");let _,R;const P=q=>V.cached(this,q,F=>By(k,F));if(A){const{k1neg:q,k1:F,k2neg:z,k2:B}=L($),{p:C,f:M}=P(F),{p:Z,f:J}=P(B);R=M.add(J),_=Y(A.beta,C,Z,q,z)}else{const{p:q,f:F}=P($);_=q,R=F}return By(k,[_,R])[0]}multiplyUnsafe($){const{endo:A}=e,_=this;if(!i.isValid($))throw new Error("invalid scalar: out of range");if($===Jp||_.is0())return k.ZERO;if($===Z2)return _;if(V.hasCache(this))return this.multiply($);if(A){const{k1neg:R,k1:P,k2neg:q,k2:F}=L($),{p1:z,p2:B}=wRe(k,_,P,F);return Y(A.beta,z,B,R,q)}else return V.unsafe(_,$)}multiplyAndAddUnsafe($,A,_){const R=this.multiplyUnsafe(A).add($.multiplyUnsafe(_));return R.is0()?void 0:R}toAffine($){return U(this,$)}isTorsionFree(){const{isTorsionFree:$}=e;return o===Z2?!0:$?$(k,this):V.unsafe(this,a).is0()}clearCofactor(){const{clearCofactor:$}=e;return o===Z2?this:$?$(k,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes($=!0){return o1($,"isCompressed"),this.assertValidity(),w(k,this,$)}toHex($=!0){return Jl(this.toBytes($))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes($=!0){return this.toBytes($)}_setWindowSize($){this.precompute($)}static normalizeZ($){return By(k,$)}static msm($,A){return Nre(k,i,$,A)}static fromPrivateKey($){return k.BASE.multiply(N2(i,$))}}k.BASE=new k(s.Gx,s.Gy,r.ONE),k.ZERO=new k(r.ZERO,r.ONE,r.ZERO),k.Fp=r,k.Fn=i;const j=i.BITS,V=new Ire(k,e.endo?Math.ceil(j/2):j);return k.BASE.precompute(8),k}function Ure(n){return Uint8Array.of(n?2:3)}function jre(n,e){return{secretKey:e.BYTES,publicKey:1+n.BYTES,publicKeyUncompressed:1+2*n.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function pMe(n,e={}){const{Fn:t}=n,r=e.randomBytes||MC,i=Object.assign(jre(n.Fp,t),{seed:_re(t.ORDER)});function s(w){try{return!!N2(t,w)}catch{return!1}}function o(w,y){const{publicKey:b,publicKeyUncompressed:E}=i;try{const T=w.length;return y===!0&&T!==b||y===!1&&T!==E?!1:!!n.fromBytes(w)}catch{return!1}}function a(w=r(i.seed)){return pRe(Hd(w,i.seed,"seed"),t.ORDER)}function c(w,y=!0){return n.BASE.multiply(N2(t,w)).toBytes(y)}function u(w){const y=a(w);return{secretKey:y,publicKey:c(y)}}function d(w){if(typeof w=="bigint")return!1;if(w instanceof n)return!0;const{secretKey:y,publicKey:b,publicKeyUncompressed:E}=i;if(t.allowedLengths||y===b)return;const T=Ms("key",w).length;return T===b||T===E}function f(w,y,b=!0){if(d(w)===!0)throw new Error("first arg must be private key");if(d(y)===!1)throw new Error("second arg must be public key");const E=N2(t,w);return n.fromHex(y).multiply(E).toBytes(b)}return Object.freeze({getPublicKey:c,getSharedSecret:f,keygen:u,Point:n,utils:{isValidSecretKey:s,isValidPublicKey:o,randomSecretKey:a,isValidPrivateKey:s,randomPrivateKey:a,normPrivateKeyToScalar:w=>N2(t,w),precompute(w=8,y=n.BASE){return y.precompute(w,!1)}},lengths:i})}function gMe(n,e,t={}){KX(e),OC(t,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=t.randomBytes||MC,i=t.hmac||((A,..._)=>i$(e,A,vo(..._))),{Fp:s,Fn:o}=n,{ORDER:a,BITS:c}=o,{keygen:u,getPublicKey:d,getSharedSecret:f,utils:m,lengths:w}=pMe(n,t),y={prehash:!1,lowS:typeof t.lowS=="boolean"?t.lowS:!1,format:void 0,extraEntropy:!1},b="compact";function E(A){const _=a>>Z2;return A>_}function T(A,_){if(!o.isValidNot0(_))throw new Error(`invalid signature ${A}: out of range 1..Point.Fn.ORDER`);return _}function N(A,_){Z7(_);const R=w.signature,P=_==="compact"?R:_==="recovered"?R+1:void 0;return Hd(A,P,`${_} signature`)}class I{constructor(_,R,P){this.r=T("r",_),this.s=T("s",R),P!=null&&(this.recovery=P),Object.freeze(this)}static fromBytes(_,R=b){N(_,R);let P;if(R==="der"){const{r:B,s:C}=Vp.toSig(Hd(_));return new I(B,C)}R==="recovered"&&(P=_[0],R="compact",_=_.subarray(1));const q=o.BYTES,F=_.subarray(0,q),z=_.subarray(q,q*2);return new I(o.fromBytes(F),o.fromBytes(z),P)}static fromHex(_,R){return this.fromBytes(s1(_),R)}addRecoveryBit(_){return new I(this.r,this.s,_)}recoverPublicKey(_){const R=s.ORDER,{r:P,s:q,recovery:F}=this;if(F==null||![0,1,2,3].includes(F))throw new Error("recovery id invalid");if(a*$re<R&&F>1)throw new Error("recovery id is ambiguous for h>1 curve");const B=F===2||F===3?P+a:P;if(!s.isValid(B))throw new Error("recovery id 2 or 3 invalid");const C=s.toBytes(B),M=n.fromBytes(vo(Ure((F&1)===0),C)),Z=o.inv(B),J=L(Ms("msgHash",_)),ae=o.create(-J*Z),we=o.create(q*Z),he=n.BASE.multiplyUnsafe(ae).add(M.multiplyUnsafe(we));if(he.is0())throw new Error("point at infinify");return he.assertValidity(),he}hasHighS(){return E(this.s)}toBytes(_=b){if(Z7(_),_==="der")return s1(Vp.hexFromSig(this));const R=o.toBytes(this.r),P=o.toBytes(this.s);if(_==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return vo(Uint8Array.of(this.recovery),R,P)}return vo(R,P)}toHex(_){return Jl(this.toBytes(_))}assertValidity(){}static fromCompact(_){return I.fromBytes(Ms("sig",_),"compact")}static fromDER(_){return I.fromBytes(Ms("sig",_),"der")}normalizeS(){return this.hasHighS()?new I(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Jl(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Jl(this.toBytes("compact"))}}const H=t.bits2int||function(_){if(_.length>8192)throw new Error("input is too large");const R=M8(_),P=_.length*8-c;return P>0?R>>BigInt(P):R},L=t.bits2int_modN||function(_){return o.create(H(_))},U=kC(c);function K(A){return BD("num < 2^"+c,A,Jp,U),o.toBytes(A)}function Y(A,_){return Hd(A,void 0,"message"),_?Hd(e(A),void 0,"prehashed message"):A}function k(A,_,R){if(["recovered","canonical"].some(ae=>ae in R))throw new Error("sign() legacy options not supported");const{lowS:P,prehash:q,extraEntropy:F}=tP(R,y);A=Y(A,q);const z=L(A),B=N2(o,_),C=[K(B),K(z)];if(F!=null&&F!==!1){const ae=F===!0?r(w.secretKey):F;C.push(Ms("extraEntropy",ae))}const M=vo(...C),Z=z;function J(ae){const we=H(ae);if(!o.isValidNot0(we))return;const he=o.inv(we),xe=n.BASE.multiply(we).toAffine(),Se=o.create(xe.x);if(Se===Jp)return;const Re=o.create(he*o.create(Z+Se*B));if(Re===Jp)return;let et=(xe.x===Se?0:2)|Number(xe.y&Z2),Me=Re;return P&&E(Re)&&(Me=o.neg(Re),et^=1),new I(Se,Me,et)}return{seed:M,k2sig:J}}function j(A,_,R={}){A=Ms("message",A);const{seed:P,k2sig:q}=k(A,_,R);return yhe(e.outputLen,o.BYTES,i)(P,q)}function V(A){let _;const R=typeof A=="string"||z1(A),P=!R&&A!==null&&typeof A=="object"&&typeof A.r=="bigint"&&typeof A.s=="bigint";if(!R&&!P)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(P)_=new I(A.r,A.s);else if(R){try{_=I.fromBytes(Ms("sig",A),"der")}catch(q){if(!(q instanceof Vp.Err))throw q}if(!_)try{_=I.fromBytes(Ms("sig",A),"compact")}catch{return!1}}return _||!1}function W(A,_,R,P={}){const{lowS:q,prehash:F,format:z}=tP(P,y);if(R=Ms("publicKey",R),_=Y(Ms("message",_),F),"strict"in P)throw new Error("options.strict was renamed to lowS");const B=z===void 0?V(A):I.fromBytes(Ms("sig",A),z);if(B===!1)return!1;try{const C=n.fromBytes(R);if(q&&B.hasHighS())return!1;const{r:M,s:Z}=B,J=L(_),ae=o.inv(Z),we=o.create(J*ae),he=o.create(M*ae),xe=n.BASE.multiplyUnsafe(we).add(C.multiplyUnsafe(he));return xe.is0()?!1:o.create(xe.x)===M}catch{return!1}}function $(A,_,R={}){const{prehash:P}=tP(R,y);return _=Y(_,P),I.fromBytes(A,"recovered").recoverPublicKey(_).toBytes()}return Object.freeze({keygen:u,getPublicKey:d,getSharedSecret:f,utils:m,lengths:w,Point:n,sign:j,verify:W,recoverPublicKey:$,Signature:I,hash:e})}function mMe(n){const e={a:n.a,b:n.b,p:n.Fp.ORDER,n:n.n,h:n.h,Gx:n.Gx,Gy:n.Gy},t=n.Fp;let r=n.allowedPrivateKeyLengths?Array.from(new Set(n.allowedPrivateKeyLengths.map(o=>Math.ceil(o/2)))):void 0;const i=Z1(e.n,{BITS:n.nBitLength,allowedLengths:r,modFromBytes:n.wrapPrivateKey}),s={Fp:t,Fn:i,allowInfinityPoint:n.allowInfinityPoint,endo:n.endo,isTorsionFree:n.isTorsionFree,clearCofactor:n.clearCofactor,fromBytes:n.fromBytes,toBytes:n.toBytes};return{CURVE:e,curveOpts:s}}function wMe(n){const{CURVE:e,curveOpts:t}=mMe(n),r={hmac:n.hmac,randomBytes:n.randomBytes,lowS:n.lowS,bits2int:n.bits2int,bits2int_modN:n.bits2int_modN};return{CURVE:e,curveOpts:t,hash:n.hash,ecdsaOpts:r}}function yMe(n,e){const t=e.Point;return Object.assign({},e,{ProjectivePoint:t,CURVE:Object.assign({},n,Are(t.Fn.ORDER,t.Fn.BITS))})}function bMe(n){const{CURVE:e,curveOpts:t,hash:r,ecdsaOpts:i}=wMe(n),s=fMe(e,t),o=gMe(s,r,i);return yMe(n,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function vMe(n,e){const t=r=>bMe({...n,hash:r});return{...t(e),create:t}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const cU={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},xMe={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},wq=BigInt(2);function EMe(n){const e=cU.p,t=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=n*n*n%e,d=u*u*n%e,f=Rs(d,t,e)*d%e,m=Rs(f,t,e)*d%e,w=Rs(m,wq,e)*u%e,y=Rs(w,i,e)*w%e,b=Rs(y,s,e)*y%e,E=Rs(b,a,e)*b%e,T=Rs(E,c,e)*E%e,N=Rs(T,a,e)*b%e,I=Rs(N,t,e)*d%e,H=Rs(I,o,e)*y%e,L=Rs(H,r,e)*u%e,U=Rs(L,wq,e);if(!Q7.eql(Q7.sqr(U),n))throw new Error("Cannot find square root");return U}const Q7=Z1(cU.p,{sqrt:EMe}),lU=vMe({...cU,Fp:Q7,lowS:!0,endo:xMe},t$),AMe=rE.utils.randomPrivateKey,yq=()=>{const n=rE.utils.randomPrivateKey(),e=TN(n),t=new Uint8Array(64);return t.set(n),t.set(e,32),{publicKey:e,secretKey:t}},TN=rE.getPublicKey;function bq(n){try{return rE.ExtendedPoint.fromHex(n),!0}catch{return!1}}const uU=(n,e)=>rE.sign(n,e.slice(0,32)),SMe=rE.verify,xr=n=>Ot.isBuffer(n)?n:n instanceof Uint8Array?Ot.from(n.buffer,n.byteOffset,n.byteLength):Ot.from(n);class dU{constructor(e){Object.assign(this,e)}encode(){return Ot.from(q2.serialize(NS,this))}static decode(e){return q2.deserialize(NS,this,e)}
1004static decodeUnchecked(e){return q2.deserializeUnchecked(NS,this,e)}}class _Me extends dU{constructor(e){if(super(e),this.enum="",Object.keys(e).length!==1)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this.enum=t})}}const NS=new Map;var zre;const Fre=32,Rf=32;function CMe(n){return n._bn!==void 0}let vq=1;class bt extends dU{constructor(e){if(super({}),this._bn=void 0,CMe(e))this._bn=e._bn;else{if(typeof e=="string"){const t=ca.decode(e);if(t.length!=Rf)throw new Error("Invalid public key input");this._bn=new gN(t)}else this._bn=new gN(e);if(this._bn.byteLength()>Rf)throw new Error("Invalid public key input")}}static unique(){const e=new bt(vq);return vq+=1,new bt(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return ca.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(Ot);if(e.length===Rf)return e;const t=Ot.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const i=Ot.concat([e.toBuffer(),Ot.from(t),r.toBuffer()]),s=U6(i);return new bt(s)}static createProgramAddressSync(e,t){let r=Ot.alloc(0);e.forEach(function(s){if(s.length>Fre)throw new TypeError("Max seed length exceeded");r=Ot.concat([r,xr(s)])}),r=Ot.concat([r,t.toBuffer(),Ot.from("ProgramDerivedAddress")]);const i=U6(r);if(bq(i))throw new Error("Invalid seeds, address must fall off the curve");return new bt(i)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r=255,i;for(;r!=0;){try{const s=e.concat(Ot.from([r]));i=this.createProgramAddressSync(s,t)}catch(s){if(s instanceof TypeError)throw s;r--;continue}return[i,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){const t=new bt(e);return bq(t.toBytes())}}zre=bt;bt.default=new zre("11111111111111111111111111111111");NS.set(bt,{kind:"struct",fields:[["_bn","u256"]]});class TMe{constructor(e){if(this._publicKey=void 0,this._secretKey=void 0,e){const t=xr(e);if(e.length!==64)throw new Error("bad secret key size");this._publicKey=t.slice(32,64),this._secretKey=t.slice(0,32)}else this._secretKey=xr(AMe()),this._publicKey=xr(TN(this._secretKey))}get publicKey(){return new bt(this._publicKey)}get secretKey(){return Ot.concat([this._secretKey,this._publicKey],64)}}const IMe=new bt("BPFLoader1111111111111111111111111111111111"),l0=1232,uR=127,Ax=64;class hU extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(hU.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class fU extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(fU.prototype,"name",{value:"TransactionExpiredTimeoutError"});class R2 extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(R2.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class F_{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e<t.length)return t[e];e-=t.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const r=new Map;this.keySegments().flat().forEach((s,o)=>{r.set(s.toBase58(),o)});const i=s=>
1004{const o=r.get(s.toBase58());if(o===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return o};return e.map(s=>({programIdIndex:i(s.programId),accountKeyIndexes:s.keys.map(o=>i(o.pubkey)),data:s.data}))}}const Pr=(n="publicKey")=>ie.blob(32,n),NMe=(n="signature")=>ie.blob(64,n),Ly=(n="string")=>{const e=ie.struct([ie.u32("length"),ie.u32("lengthPadding"),ie.blob(ie.offset(ie.u32(),-8),"chars")],n),t=e.decode.bind(e),r=e.encode.bind(e),i=e;return i.decode=(s,o)=>t(s,o).chars.toString(),i.encode=(s,o,a)=>{const c={chars:Ot.from(s,"utf8")};return r(c,o,a)},i.alloc=s=>ie.u32().span+ie.u32().span+Ot.from(s,"utf8").length,i},RMe=(n="authorized")=>ie.struct([Pr("staker"),Pr("withdrawer")],n),MMe=(n="lockup")=>ie.struct([ie.ns64("unixTimestamp"),ie.ns64("epoch"),Pr("custodian")],n),kMe=(n="voteInit")=>ie.struct([Pr("nodePubkey"),Pr("authorizedVoter"),Pr("authorizedWithdrawer"),ie.u8("commission")],n),OMe=(n="voteAuthorizeWithSeedArgs")=>ie.struct([ie.u32("voteAuthorizationType"),Pr("currentAuthorityDerivedKeyOwnerPubkey"),Ly("currentAuthorityDerivedKeySeed"),Pr("newAuthorized")],n);function Wre(n,e){const t=i=>{if(i.span>=0)return i.span;if(typeof i.alloc=="function")return i.alloc(e[i.property]);if("count"in i&&"elementLayout"in i){const s=e[i.property];if(Array.isArray(s))return s.length*t(i.elementLayout)}else if("fields"in i)return Wre({layout:i},e[i.property]);return 0};let r=0;return n.layout.fields.forEach(i=>{r+=t(i)}),r}function sl(n){let e=0,t=0;for(;;){let r=n.shift();if(e|=(r&127)<<t*7,t+=1,(r&128)===0)break}return e}function Gl(n,e){let t=e;for(;;){let r=t&127;if(t>>=7,t==0){n.push(r);break}else r|=128,n.push(r)}}function oi(n,e){if(!n)throw new Error(e||"Assertion failed")}class dR{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const r=new Map,i=o=>{const a=o.toBase58();let c=r.get(a);return c===void 0&&(c={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(a,c)),c},s=i(t);s.isSigner=!0,s.isWritable=!0;for(const o of e){i(o.programId).isInvoked=!0;for(const a of o.keys){const c=i(a.pubkey);c.isSigner||(c.isSigner=a.isSigner),c.isWritable||(c.isWritable=a.isWritable)}}return new dR(t,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];oi(e.length<=256,"Max static account keys length exceeded");const t=e.filter(([,c])=>c.isSigner&&c.isWritable),r=e.filter(([,c])=>c.isSigner&&!c.isWritable),i=e.filter(([,c])=>!c.isSigner&&c.isWritable),s=e.filter(([,c])=>!c.isSigner&&!c.isWritable),o={numRequiredSignatures:t.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:s.length};{oi(t.length>0,"Expected at least one writable signer key");const[c]=t[0];oi(c===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...t.map(([c])=>new bt(c)),...r.map(([c])=>new bt(c)),...i.map(([c])=>new bt(c)),...s.map(([c])=>new bt(c))];return[o,a]}extractTableLookup(e){const[t,r]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&o.isWritable),[i,s]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&!o.isWritable);if(!(t.length===0&&i.length===0))return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:i},{writable:r,readonly:s}]}drainKeysFoundInLookupTable(e,t){const r=new Array,i=new Array;for(const[s,o]of this.keyMetaMap.entries())if(t(o)){const a=new bt(s),c=e.findIndex(u=>u.equals(a));c>=0&&(oi(c<256,"Max lookup table index exceeded"),r.push(c),i.push(a),this.keyMetaMap.delete(s))}return[r,i]}}const Hre="Reached end of buffer unexpectedly";function xf(n){if(n.length===0)throw new Error(Hre);return n.shift()}function ol(n,...e){const[t]=e;if(e.length===2?t+(e[1]??0)>n.length:t>=n.length)throw new Error(Hre);return n.splice(...e)}class rh{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(t=>new bt(t)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:ca.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new F_(this.staticAccountKeys)}static compile(e){const t=dR.compile(e.instructions,e.payerKey),[r,i]=t.getMe
1004ssageComponents(),o=new F_(i).compileInstructions(e.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:ca.encode(a.data)}));return new rh({header:r,accountKeys:i,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const r=e-t,s=this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts;return r<s}else{const r=t-this.header.numReadonlySignedAccounts;return e<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){const e=this.accountKeys.length;let t=[];Gl(t,e);const r=this.instructions.map(f=>{const{accounts:m,programIdIndex:w}=f,y=Array.from(ca.decode(f.data));let b=[];Gl(b,m.length);let E=[];return Gl(E,y.length),{programIdIndex:w,keyIndicesCount:Ot.from(b),keyIndices:m,dataLength:Ot.from(E),data:y}});let i=[];Gl(i,r.length);let s=Ot.alloc(l0);Ot.from(i).copy(s);let o=i.length;r.forEach(f=>{const w=ie.struct([ie.u8("programIdIndex"),ie.blob(f.keyIndicesCount.length,"keyIndicesCount"),ie.seq(ie.u8("keyIndex"),f.keyIndices.length,"keyIndices"),ie.blob(f.dataLength.length,"dataLength"),ie.seq(ie.u8("userdatum"),f.data.length,"data")]).encode(f,s,o);o+=w}),s=s.slice(0,o);const a=ie.struct([ie.blob(1,"numRequiredSignatures"),ie.blob(1,"numReadonlySignedAccounts"),ie.blob(1,"numReadonlyUnsignedAccounts"),ie.blob(t.length,"keyCount"),ie.seq(Pr("key"),e,"keys"),Pr("recentBlockhash")]),c={numRequiredSignatures:Ot.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Ot.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Ot.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Ot.from(t),keys:this.accountKeys.map(f=>xr(f.toBytes())),recentBlockhash:ca.decode(this.recentBlockhash)};let u=Ot.alloc(2048);const d=a.encode(c,u);return s.copy(u,d),u.slice(0,d+s.length)}static from(e){let t=[...e];const r=xf(t);if(r!==(r&uR))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=xf(t),s=xf(t),o=sl(t);let a=[];for(let m=0;m<o;m++){const w=ol(t,0,Rf);a.push(new bt(Ot.from(w)))}const c=ol(t,0,Rf),u=sl(t);let d=[];for(let m=0;m<u;m++){const w=xf(t),y=sl(t),b=ol(t,0,y),E=sl(t),T=ol(t,0,E),N=ca.encode(Ot.from(T));d.push({programIdIndex:w,accounts:b,data:N})}const f={header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:s},recentBlockhash:ca.encode(Ot.from(c)),accountKeys:a,instructions:d};return new rh(f)}}class m1{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const t of this.addressTableLookups)e+=t.readonlyIndexes.length+t.writableIndexes.length;return e}getAccountKeys(e){let t;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new F_(this.staticAccountKeys,t)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r){const i=e-r,s=this.addressTableLookups.reduce((o,a)=>o+a.writableIndexes.length,0);return i<s}else if(e>=this.header.numRequiredSignatures){const i=e-t,o=r-t-this.header.numReadonlyUnsignedAccounts;return i<o}else{const i=t-this.header.numReadonlySignedAccounts;return e<i}}resolveAddressTableLookups(e){const t={writable:[],readonly:[]};for(const r of this.addressTableLookups){const i=e.find(s=>
1004s.key.equals(r.accountKey));if(!i)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const s of r.writableIndexes)if(s<i.state.addresses.length)t.writable.push(i.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`);for(const s of r.readonlyIndexes)if(s<i.state.addresses.length)t.readonly.push(i.state.addresses[s]);else throw new Error(`Failed to find address for index ${s} in address lookup table ${r.accountKey.toBase58()}`)}return t}static compile(e){const t=dR.compile(e.instructions,e.payerKey),r=new Array,i={writable:new Array,readonly:new Array},s=e.addressLookupTableAccounts||[];for(const d of s){const f=t.extractTableLookup(d);if(f!==void 0){const[m,{writable:w,readonly:y}]=f;r.push(m),i.writable.push(...w),i.readonly.push(...y)}}const[o,a]=t.getMessageComponents(),u=new F_(a,i).compileInstructions(e.instructions);return new m1({header:o,staticAccountKeys:a,recentBlockhash:e.recentBlockhash,compiledInstructions:u,addressTableLookups:r})}serialize(){const e=Array();Gl(e,this.staticAccountKeys.length);const t=this.serializeInstructions(),r=Array();Gl(r,this.compiledInstructions.length);const i=this.serializeAddressTableLookups(),s=Array();Gl(s,this.addressTableLookups.length);const o=ie.struct([ie.u8("prefix"),ie.struct([ie.u8("numRequiredSignatures"),ie.u8("numReadonlySignedAccounts"),ie.u8("numReadonlyUnsignedAccounts")],"header"),ie.blob(e.length,"staticAccountKeysLength"),ie.seq(Pr(),this.staticAccountKeys.length,"staticAccountKeys"),Pr("recentBlockhash"),ie.blob(r.length,"instructionsLength"),ie.blob(t.length,"serializedInstructions"),ie.blob(s.length,"addressTableLookupsLength"),ie.blob(i.length,"serializedAddressTableLookups")]),a=new Uint8Array(l0),u=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(d=>d.toBytes()),recentBlockhash:ca.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(s),serializedAddressTableLookups:i},a);return a.slice(0,u)}serializeInstructions(){let e=0;const t=new Uint8Array(l0);for(const r of this.compiledInstructions){const i=Array();Gl(i,r.accountKeyIndexes.length);const s=Array();Gl(s,r.data.length);const o=ie.struct([ie.u8("programIdIndex"),ie.blob(i.length,"encodedAccountKeyIndexesLength"),ie.seq(ie.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),ie.blob(s.length,"encodedDataLength"),ie.blob(r.data.length,"data")]);e+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(i),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(s),data:r.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0;const t=new Uint8Array(l0);for(const r of this.addressTableLookups){const i=Array();Gl(i,r.writableIndexes.length);const s=Array();Gl(s,r.readonlyIndexes.length);const o=ie.struct([Pr("accountKey"),ie.blob(i.length,"encodedWritableIndexesLength"),ie.seq(ie.u8(),r.writableIndexes.length,"writableIndexes"),ie.blob(s.length,"encodedReadonlyIndexesLength"),ie.seq(ie.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(i),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(s),readonlyIndexes:r.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e];const r=xf(t),i=r&uR;oi(r!==i,"Expected versioned message but received legacy message");const s=i;oi(s===0,`Expected versioned message with version 0 but found version ${s}`);const o={numRequiredSignatures:xf(t),numReadonlySignedAccounts:xf(t),numReadonlyUnsignedAccounts:xf(t)},a=[],c=sl(t);for(let y=0;y<c;y++)a.push(new bt(ol(t,0,Rf)));const u=ca.encode(ol(t,0,Rf)),d=sl(t),f=[];for(let y=0;y<d;y++){const b=xf(t),E=sl(t),T=ol(t,0,E),N=sl(t),I=new Uint8Array(ol(t,0,N));f.push({programIdIndex:b,accountKeyIndexes:T,data:I})}const m=sl(t),w=[];for(let y=0;y<m;y++){const b=new bt(ol(t,0,Rf)),E=sl(t),T=ol(t,0,E),N=sl(t),I=ol(t,0,N);w.push({accountKey:b,writableIndexes:T,readonlyIndexes:I})}return new m1({header:o,staticAccountKeys:a,recentBlockhash:u,compiledInstructions:f,addressTableLookups:w})}}const hR={deserializeMessageVersion(n){const e=n[0],t=e&uR;return t===e?"legacy":t},deserialize:n=>{const e=hR.deserializeMessageVersion(n);if(e==="legacy")return rh.from(n);if(e===0)return m1.deserialize(n);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let Fp=function(n){return n[n.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",n[n.PROCESSED=1]="PROCESSED",n[n.TIMED_OUT=2]="TIMED_OUT",n[n.NONCE_INVALID=3]="NONCE_INVALID",n}({});const PMe=Ot.alloc(Ax).fill(0);class Ni{constructor(e){this.keys=void 0,this.programId=void 0,this.data=Ot.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class Wr{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:r}=e;this.minNonceContextSlot=t,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:r}=e;this.recentBlockhash=t,this.lastValidBlockHeight=r}else{const{recentBlockhash:t,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstru
vendor: 1,325 bytes, line 1004
1004ction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new Ni(t))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?t=[this.nonceInfo.nonceInstruction,...this.instructions]:t=this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");t.length<1&&console.warn("No instructions provided");let r;if(this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let b=0;b<t.length;b++)if(t[b].programId===void 0)throw new Error(`Transaction instruction index ${b} has undefined program id`);const i=[],s=[];t.forEach(b=>{b.keys.forEach(T=>{s.push({...T})});const E=b.programId.toString();i.includes(E)||i.push(E)}
1004),i.forEach(b=>{s.push({pubkey:new bt(b),isSigner:!1,isWritable:!1})});const o=[];s.forEach(b=>{const E=b.pubkey.toString(),T=o.findIndex(N=>N.pubkey.toString()===E);T>-1?(o[T].isWritable=o[T].isWritable||b.isWritable,o[T].isSigner=o[T].isSigner||b.isSigner):o.push(b)}),o.sort(function(b,E){if(b.isSigner!==E.isSigner)return b.isSigner?-1:1;if(b.isWritable!==E.isWritable)return b.isWritable?-1:1;const T={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return b.pubkey.toBase58().localeCompare(E.pubkey.toBase58(),"en",T)});const a=o.findIndex(b=>b.pubkey.equals(r));if(a>-1){const[b]=o.splice(a,1);b.isSigner=!0,b.isWritable=!0,o.unshift(b)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const b of this.signatures){const E=o.findIndex(T=>T.pubkey.equals(b.publicKey));if(E>-1)o[E].isSigner||(o[E].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${b.publicKey.toString()}`)}let c=0,u=0,d=0;const f=[],m=[];o.forEach(({pubkey:b,isSigner:E,isWritable:T})=>{E?(f.push(b.toString()),c+=1,T||(u+=1)):(m.push(b.toString()),T||(d+=1))});const w=f.concat(m),y=t.map(b=>{const{data:E,programId:T}=b;return{programIdIndex:w.indexOf(T.toString()),accounts:b.keys.map(N=>w.indexOf(N.pubkey.toString())),data:ca.encode(E)}});return y.forEach(b=>{oi(b.programIdIndex>=0),b.accounts.forEach(E=>oi(E>=0))}),new rh({header:{numRequiredSignatures:c,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:d},accountKeys:w,recentBlockhash:e,instructions:y})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((i,s)=>t[s].equals(i.publicKey))||(this.signatures=t.map(r=>({signature:null,publicKey:r}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const t=new Set;this.signatures=e.filter(r=>{const i=r.toString();return t.has(i)?!1:(t.add(i),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,r=[];for(const s of e){const o=s.publicKey.toString();t.has(o)||(t.add(o),r.push(s))}this.signatures=r.map(s=>({signature:null,publicKey:s.publicKey}));const i=this._compile();this._partialSign(i,...r)}partialSign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,r=[];for(const s of e){const o=s.publicKey.toString();t.has(o)||(t.add(o),r.push(s))}const i=this._compile();this._partialSign(i,...r)}_partialSign(e,...t){const r=e.serialize();t.forEach(i=>{const s=uU(r,i.secretKey);this._addSignature(i.publicKey,xr(s))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){oi(t.length===64);const r=this.signatures.findIndex(i=>e.equals(i.publicKey));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=Ot.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const r={};for(const{signature:i,publicKey:s}of this.signatures)i===null?t&&(r.missing||(r.missing=[])).push(s):SMe(i,e,s.toBytes())||(r.invalid||(r.invalid=[])).push(s);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),i=this.serializeMessage();if(r){const s=this._getMessageSignednessErrors(i,t);if(s){let o="Signature verification failed.";throw s.invalid&&(o+=` 1005Invalid signature for public key${s.invalid.length===1?"":"(s)"} [\`${s.invalid.map(a=>a.toBase58()).join("`, `")}\`].`),s.missing&&(o+=` 1006Missing signature for public key${s.missing.length===1?"":"(s)"} [\`${s.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(o)}}return this._serialize(i)}_serialize(e){const{signatures:t}=this,r=[];Gl(r,t.length);const i=r.length+t.length*64+e.length,s=Ot.alloc(i);return oi(t.length<256),Ot.from(r).copy(s,0),t.forEach(({signature:o},a)=>
1006{o!==null&&(oi(o.length===64,"signature has invalid length"),Ot.from(o).copy(s,r.length+a*64))}),e.copy(s,r.length+t.length*64),oi(s.length<=l0,`Transaction too large: ${s.length} > ${l0}`),s}get keys(){return oi(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return oi(this.instructions.length===1),this.instructions[0].programId}get data(){return oi(this.instructions.length===1),this.instructions[0].data}static from(e){let t=[...e];const r=sl(t);let i=[];for(let s=0;s<r;s++){const o=ol(t,0,Ax);i.push(ca.encode(Ot.from(o)))}return Wr.populate(rh.from(t),i)}static populate(e,t=[]){const r=new Wr;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach((i,s)=>{const o={signature:i==ca.encode(PMe)?null:ca.decode(i),publicKey:e.accountKeys[s]};r.signatures.push(o)}),e.instructions.forEach(i=>{const s=i.accounts.map(o=>{const a=e.accountKeys[o];return{pubkey:a,isSigner:r.signatures.some(c=>c.publicKey.toString()===a.toString())||e.isAccountSigner(o),isWritable:e.isAccountWritable(o)}});r.instructions.push(new Ni({keys:s,programId:e.accountKeys[i.programIdIndex],data:ca.decode(i.data)}))}),r._message=e,r._json=r.toJSON(),r}}class pU{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,t){const{header:r,compiledInstructions:i,recentBlockhash:s}=e,{numRequiredSignatures:o,numReadonlySignedAccounts:a,numReadonlyUnsignedAccounts:c}=r,u=o-a;oi(u>0,"Message header is invalid");const d=e.staticAccountKeys.length-o-c;oi(d>=0,"Message header is invalid");const f=e.getAccountKeys(t),m=f.get(0);if(m===void 0)throw new Error("Failed to decompile message because no account keys were found");const w=[];for(const y of i){const b=[];for(const T of y.accountKeyIndexes){const N=f.get(T);if(N===void 0)throw new Error(`Failed to find key for account key index ${T}`);const I=T<o;let H;I?H=T<u:T<f.staticAccountKeys.length?H=T-o<d:H=T-f.staticAccountKeys.length<f.accountKeysFromLookups.writable.length,b.push({pubkey:N,isSigner:T<r.numRequiredSignatures,isWritable:H})}const E=f.get(y.programIdIndex);if(E===void 0)throw new Error(`Failed to find program id for program id index ${y.programIdIndex}`);w.push(new Ni({programId:E,data:xr(y.data),keys:b}))}return new pU({payerKey:m,instructions:w,recentBlockhash:s})}compileToLegacyMessage(){return rh.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(e){return m1.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}class w1{get version(){return this.message.version}constructor(e,t){if(this.signatures=void 0,this.message=void 0,t!==void 0)oi(t.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=t;else{const r=[];for(let i=0;i<e.header.numRequiredSignatures;i++)r.push(new Uint8Array(Ax));this.signatures=r}this.message=e}serialize(){const e=this.message.serialize(),t=Array();Gl(t,this.signatures.length);const r=ie.struct([ie.blob(t.length,"encodedSignaturesLength"),ie.seq(NMe(),this.signatures.length,"signatures"),ie.blob(e.length,"serializedMessage")]),i=new Uint8Array(2048),s=r.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},i);return i.slice(0,s)}static deserialize(e){let t=[...e];const r=[],i=sl(t);for(let o=0;o<i;o++)r.push(new Uint8Array(ol(t,0,Ax)));const s=hR.deserialize(new Uint8Array(t));return new w1(s,r)}sign(e){const t=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const i of e){const s=r.findIndex(o=>o.equals(i.publicKey));oi(s>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[s]=uU(t,i.secretKey)}}addSignature(e,t){oi(t.byteLength===64,"Signature must be 64 bytes long");const i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(s=>s.equals(e));oi(i>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[i]=t}}const DMe=160,BMe=64,LMe=DMe/BMe,Vre=1e3/LMe,bf=new bt("SysvarC1ock11111111111111111111111111111111"),$Me=new bt("SysvarEpochSchedu1e111111111111111111111111"),UMe=new bt("Sysvar1nstructions1111111111111111111111111"),x6=new bt("SysvarRecentB1ockHashes11111111111111111111"),Sx=new bt("SysvarRent111111111111111111111111111111111"),jMe=new bt("SysvarRewards111111111111111111111111111111"),zMe=new bt("SysvarS1otHashes111111111111111111111111111"),FMe=new bt("SysvarS1otHistory11111111111111111111111111"),E6=new bt("SysvarStakeHistory1111111111111111111111111");
1006class W_ extends Error{constructor({action:e,signature:t,transactionMessage:r,logs:i}){const s=i?`Logs: 1007${JSON.stringify(i.slice(-10),null,2)}. `:"",o="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";let a;switch(e){case"send":a=`Transaction ${t} resulted in an error. 1008${r}. `+s+o;break;case"simulate":a=`Simulation failed. 1009Message: ${r}. 1010`+s+o;break;default:a=`Unknown action '${(c=>c)(e)}'`}super(a),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=t,this.transactionMessage=r,this.transactionLogs=i||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){const e=this.transactionLogs;if(!(e!=null&&typeof e=="object"&&"then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((t,r)=>{e.getTransaction(this.signature).then(i=>{if(i&&i.meta&&i.meta.logMessages){const s=i.meta.logMessages;this.transactionLogs=s,t(s)}else r(new Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}const WMe={JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016};
1010class Nn extends Error{constructor({code:e,message:t,data:r},i){super(i!=null?`${i}: ${t}`:t),this.code=void 0,this.data=void 0,this.code=e,this.data=r,this.name="SolanaJSONRPCError"}}async function X7(n,e,t,r){const i=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},s=await n.sendTransaction(e,t,i);let o;if(e.recentBlockhash!=null&&e.lastValidBlockHeight!=null)o=(await n.confirmTransaction({abortSignal:r==null?void 0:r.abortSignal,signature:s,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},r&&r.commitment)).value;else if(e.minNonceContextSlot!=null&&e.nonceInfo!=null){const{nonceInstruction:a}=e.nonceInfo,c=a.keys[0].pubkey;o=(await n.confirmTransaction({abortSignal:r==null?void 0:r.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:c,nonceValue:e.nonceInfo.nonce,signature:s},r&&r.commitment)).value}else(r==null?void 0:r.abortSignal)!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),o=(await n.confirmTransaction(s,r&&r.commitment)).value;if(o.err)throw s!=null?new W_({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(o)})`}):new Error(`Transaction ${s} failed (${JSON.stringify(o)})`);return s}function xy(n){return new Promise(e=>setTimeout(e,n))}function qr(n,e){const t=n.layout.span>=0?n.layout.span:Wre(n,e),r=Ot.alloc(t),i=Object.assign({instruction:n.index},e);return n.layout.encode(i,r),r}function vi(n,e){let t;try{t=n.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(t.instruction!==n.index)throw new Error(`invalid instruction; instruction index mismatch ${t.instruction} != ${n.index}`);return t}const qre=ie.nu64("lamportsPerSignature"),Kre=ie.struct([ie.u32("version"),ie.u32("state"),Pr("authorizedPubkey"),Pr("nonce"),ie.struct([qre],"feeCalculator")]),J7=Kre.span;class fR{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const t=Kre.decode(xr(e),0);return new fR({authorizedPubkey:new bt(t.authorizedPubkey),nonce:new bt(t.nonce).toString(),feeCalculator:t.feeCalculator})}}function _x(n){const e=ie.blob(8,n),t=e.decode.bind(e),r=e.encode.bind(e),i=e,s=nMe();return i.decode=(o,a)=>{const c=t(o,a);return s.decode(c)},i.encode=(o,a,c)=>{const u=s.encode(o);return r(u,a,c)},i}class HMe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=ie.u32("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(Xi))if(o.index==r){i=s;break}if(!i)throw new Error("Instruction type incorrect; not a SystemInstruction");return i}static decodeCreateAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t,space:r,programId:i}=vi(Xi.Create,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:t,space:r,programId:new bt(i)}}static decodeTransfer(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t}=vi(Xi.Transfer,e.data);return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:t}}static decodeTransferWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t,seed:r,programId:i}=vi(Xi.TransferWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:t,seed:r,programId:new bt(i)}}static decodeAllocate(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{space:t}=vi(Xi.Allocate,e.data);return{accountPubkey:e.keys[0].pubkey,space:t}}static decodeAllocateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,space:i,programId:s}=vi(Xi.AllocateWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new bt(t),seed:r,space:i,programId:new bt(s)}}static decodeAssign(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{programId:t}=vi(Xi.Assign,e.data);return{accountPubkey:e.keys[0].pubkey,programId:new bt(t)}}static decodeAssignWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,programId:i}=vi(Xi.AssignWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new bt(t),seed:r,programId:new bt(i)}}static decodeCreateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{base:t,seed:r,lamports:i,space:s,programId:o}
1010=vi(Xi.CreateWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new bt(t),seed:r,lamports:i,space:s,programId:new bt(o)}}static decodeNonceInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{authorized:t}=vi(Xi.InitializeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new bt(t)}}static decodeNonceAdvance(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),vi(Xi.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static decodeNonceWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=vi(Xi.WithdrawNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t}}static decodeNonceAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t}=vi(Xi.AuthorizeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new bt(t)}}static checkProgramId(e){if(!e.equals(fo.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const Xi=Object.freeze({Create:{index:0,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports"),ie.ns64("space"),Pr("programId")])},Assign:{index:1,layout:ie.struct([ie.u32("instruction"),Pr("programId")])},Transfer:{index:2,layout:ie.struct([ie.u32("instruction"),_x("lamports")])},CreateWithSeed:{index:3,layout:ie.struct([ie.u32("instruction"),Pr("base"),Ly("seed"),ie.ns64("lamports"),ie.ns64("space"),Pr("programId")])},AdvanceNonceAccount:{index:4,layout:ie.struct([ie.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:ie.struct([ie.u32("instruction"),Pr("authorized")])},AuthorizeNonceAccount:{index:7,layout:ie.struct([ie.u32("instruction"),Pr("authorized")])},Allocate:{index:8,layout:ie.struct([ie.u32("instruction"),ie.ns64("space")])},AllocateWithSeed:{index:9,layout:ie.struct([ie.u32("instruction"),Pr("base"),Ly("seed"),ie.ns64("space"),Pr("programId")])},AssignWithSeed:{index:10,layout:ie.struct([ie.u32("instruction"),Pr("base"),Ly("seed"),Pr("programId")])},TransferWithSeed:{index:11,layout:ie.struct([ie.u32("instruction"),_x("lamports"),Ly("seed"),Pr("programId")])},UpgradeNonceAccount:{index:12,layout:ie.struct([ie.u32("instruction")])}});class fo{constructor(){}static createAccount(e){const t=Xi.Create,r=qr(t,{lamports:e.lamports,space:e.space,programId:xr(e.programId.toBuffer())});return new Ni({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:r})}static transfer(e){let t,r;if("basePubkey"in e){const i=Xi.TransferWithSeed;t=qr(i,{lamports:BigInt(e.lamports),seed:e.seed,programId:xr(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{const i=Xi.Transfer;t=qr(i,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new Ni({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;if("basePubkey"in e){const i=Xi.AssignWithSeed;t=qr(i,{base:xr(e.basePubkey.toBuffer()),seed:e.seed,programId:xr(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=Xi.Assign;t=qr(i,{programId:xr(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ni({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=Xi.CreateWithSeed,r=qr(t,{base:xr(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:xr(e.programId.toBuffer())});let i=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||i.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Ni({keys:i,programId:this.programId,data:r})}static createNonceAccount(e){const t=new Wr;"basePubkey"in e&&"seed"in e?t.add(fo.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:J7,programId:this.programId})):t.add(fo.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:J7,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){const t=Xi.InitializeNonceAccount,r=qr(t,{authorized:xr(e.authorizedPubkey.toBuffer())}),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:x6,isSigner:!1,isWritable:!1},{pubkey:Sx,isSigner:!1,isWritable:!1}],programId:this.programId,data:r};return new Ni(i)}static nonceAdvance(e){const t=Xi.AdvanceNonceAccount,r=qr(t),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:x6,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r};return new Ni(i)}static nonceWithdraw(e){const t=Xi.WithdrawNonceAccount,r=qr(t,{lamports:e.lamports});return new Ni({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:x6,isSigner:!1,isWritable:!1},{pubkey:Sx,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static nonceAuthorize(e){const t=Xi.AuthorizeNonceAccount,r=qr(t,{authorized:xr(e.newAuthorizedPubkey.toBuffer())});return new Ni({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static allocate(e){let t,r;if("basePubkey"in e){const i=Xi.AllocateWithSeed;t=qr(i,{base:xr(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:xr(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=Xi.Allocate;t=qr(i,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Ni({keys:r,programId:this.programId,data:t})}}fo.programId=new bt("11111111111111111111111111111111");const VMe=l0-300;class y1{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/y1.chunkSize)+1+1)}static async load(e,t,r,i,s){{const f=await e.getMinimumBalanceForRentExemption(s.length),m=await e.getAccountInfo(r.publicKey,"confirmed");let w=null;if(m!==null){if(m.executable)return console.error("Program load failed, account is already executable"),!1;m.data.length!==s.length&&(w=w||new Wr,w.add(fo.allocate({accountPubkey:r.publicKey,space:s.length}))),m.owner.equals(i)||(w=w||new Wr,w.add(fo.assign({accountPubkey:r.publicKey,programId:i}))),m.lamports<f&&(w=w||new Wr,w.add(fo.transfer({fromPubkey:t.publicKey,toPubkey:r.publicKey,lamports:f-m.lamports})))}else w=new Wr().add(fo.createAccount({fromPubkey:t.publicKey,newAccountPubkey:r.publicKey,lamports:f>0?f:1,space:s.length,programId:i}));w!==null&&await X7(e,w,[t,r],{commitment:"confirmed"})}const o=ie.struct([ie.u32("instruction"),ie.u32("offset"),ie.u32("bytesLength"),ie.u32("bytesLengthPadding"),ie.seq(ie.u8("byte"),ie.offset(ie.u32(),-8),"bytes")]),a=y1.chunkSize;let c=0,u=s,d=[];for(;u.length>0;){const f=u.slice(0,a),m=Ot.alloc(a+16);o.encode({instruction:0,offset:c,bytes:f,bytesLength:0,bytesLengthPadding:0},m);const w=new Wr().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:m});d.push(X7(e,w,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await xy(1e3/4),c+=a,u=u.slice(a)}await Promise.all(d);{const f=ie.struct([ie.u32("instruction")]),m=Ot.alloc(f.span);f.encode({instruction:1},m);const w=new Wr().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:Sx,isSigner:!1,isWritable:!1}],programId:i,data:m}),y="processed",b=await e.sendTransaction(w,[t,r],{preflightCommitment:y}),{context:E,value:T}=await e.confirmTransaction({signature:b,lastValidBlockHeight:w.lastValidBlockHeight,blockhash:w.recentBlockhash},y);if(T.err)throw new Error(`Transaction ${b} failed (${JSON.stringify(T)})`);for(;;){try{if(await e.getSlot({commitment:y})>E.slot)break}catch{}await new Promise(N=>setTimeout(N,Math.round(Vre/2)))}}return!0}}y1.chunkSize=VMe;const qMe=new bt("BPFLoader2111111111111111111111111111111111");class KMe{static getMinNumSignatures(e){return y1.getMinNumSignatures(e)}static load(e,t,r,i,s){return y1.load(e,t,r,s,i)}}function YMe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nP,xq;function GMe(){if(xq)return nP;xq=1;var n=Object.prototype.toString,e=Object.keys||function(r){var i=[];for(var s in r)i.push(s);return i};function t(r,i){var s,o,a,c,u,d,f;if(r===!0)return"true";if(r===!1)return"false";switch(typeof r){case"object":if(r===null)return null;if(r.toJSON&&typeof r.toJSON=="function")return t(r.toJSON(),i);if(f=n.call(r),f==="[object Array]"){for(a="[",o=r.length-1,s=0;s<o;s++)a+=t(r[s],!0)+",";return o>-1&&(a+=t(r[s],!0)),a+"]"}else if(f==="[object Object]"){for(c=e(r).sort(),o=c.length,a="",s=0;s<o;)u=c[s],d=t(r[u],!1),d!==void 0&&(a&&(a+=","),a+=JSON.stringify(u)+":"+d),s++;return"{"+a+"}"}else return JSON.stringify(r);case"function":case"undefined":return i?null:void 0;case"string":return JSON.stringify(r);default:return isFinite(r)?r:null}}return nP=function(r){var i=t(r,!1);if(i!==void 0)return""+i},nP}var ZMe=GMe(),Eq=YMe(ZMe);const RA=32;function rP(n){let e=0;for(;n>1;)n/=2,e++;return e}function QMe(n){return n===0?1:(n--,n|=n>>1,n|=n>>2,n|=n>>4,n|=n>>8,n|=n>>16,n|=n>>32,n+1)}class Yre{constructor(e,t,r,i,s){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=t,this.warmup=r,this.firstNormalEpoch=i,this.firstNormalSlot=s}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const t=rP(QMe(e+RA+1))-rP(RA)-1,r=this.getSlotsInEpoch(t),i=e-(r-RA);return[t,i]}else{const t=e-this.firstNormalSlot,r=Math.floor(t/this.slotsPerEpoch),i=this.firstNormalEpoch+r,s=t%this.slotsPerEpoch;return[i,s]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(Math.pow(2,e)-1)*RA:(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+rP(RA)):this.slotsPerEpoch}}var XMe=globalThis.fetch;class JMe extends jne{constructor(e,t,r){const i=s=>{const o=Une(s,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return"socket"in o?this.underlyingSocket=o.socket:this.underlyingSocket=o,o};super(i,e,t,r),this.underlyingSocket=void 0}call(...e){var r;const t=(r=this.underlyingSocket)==null?void 0:r.readyState;
vendor: 17,885 bytes, line 1010
1010return t===1?super.call(...e):Promise.reject(new Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}notify(...e){var r;const t=(r=this.underlyingSocket)==null?void 0:r.readyState;return t===1?super.notify(...e):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}}function eke(n,e){let t;try{t=n.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(t.typeIndex!==n.index)throw new Error(`invalid account data; account type mismatch ${t.typeIndex} != ${n.index}`);return t}const Aq=56;class eB{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const t=eke(tke,e),r=e.length-Aq;oi(r>=0,"lookup table is invalid"),oi(r%32===0,"lookup table is invalid");const i=r/32,{addresses:s}=ie.struct([ie.seq(Pr(),i,"addresses")]).decode(e.slice(Aq));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:t.authority.length!==0?new bt(t.authority[0]):void 0,addresses:s.map(o=>new bt(o))}}}const tke={index:1,layout:ie.struct([ie.u32("typeIndex"),_x("deactivationSlot"),ie.nu64("lastExtendedSlot"),ie.u8("lastExtendedStartIndex"),ie.u8(),ie.seq(Pr(),ie.offset(ie.u8(),-1),"authority")])},nke=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function rke(n){const e=n.match(nke);if(e==null)throw TypeError(`Failed to validate endpoint URL \`${n}\``);const[t,r,i,s]=e,o=n.startsWith("https:")?"wss:":"ws:",a=i==null?null:parseInt(i.slice(1),10),c=a==null?"":`:${a+1}`;return`${o}//${r}${c}${s}`}const As=JC(oU(bt),$t(),n=>new bt(n)),Gre=aU([$t(),vs("base64")]),gU=JC(oU(Ot),Gre,n=>Ot.from(n[0],"base64")),Zre=30*1e3;function ike(n){if(/^https?:/.test(n)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return n}function Qi(n){let e,t;if(typeof n=="string")e=n;else if(n){const{commitment:r,...i}=n;e=r,t=i}return{commitment:e,config:t}}function Sq(n){return n.map(e=>"memcmp"in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??"base58"}}:e)}function Qre(n){return _c([Tt({jsonrpc:vs("2.0"),id:$t(),result:n}),Tt({jsonrpc:vs("2.0"),id:$t(),error:Tt({code:iE(),message:$t(),data:Ln(cMe())})})])}const ske=Qre(iE());function vr(n){return JC(Qre(n),ske,e=>"error"in e?e:{...e,result:qt(e.result,n)})}function Hs(n){return vr(Tt({context:Tt({slot:Ve()}),value:n}))}function pR(n){return Tt({context:Tt({slot:Ve()}),value:n})}function iP(n,e){return n===0?new m1({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new bt(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:ca.decode(t.data)})),addressTableLookups:e.addressTableLookups}):new rh(e)}const oke=Tt({foundation:Ve(),foundationTerm:Ve(),initial:Ve(),taper:Ve(),terminal:Ve()}),ake=vr(Xt(tn(Tt({epoch:Ve(),effectiveSlot:Ve(),amount:Ve(),postBalance:Ve(),commission:Ln(tn(Ve()))})))),cke=Xt(Tt({slot:Ve(),prioritizationFee:Ve()})),lke=Tt({total:Ve(),validator:Ve(),foundation:Ve(),epoch:Ve()}),uke=Tt({epoch:Ve(),slotIndex:Ve(),slotsInEpoch:Ve(),absoluteSlot:Ve(),blockHeight:Ln(Ve()),transactionCount:Ln(Ve())}),dke=Tt({slotsPerEpoch:Ve(),leaderScheduleSlotOffset:Ve(),warmup:zf(),firstNormalEpoch:Ve(),firstNormalSlot:Ve()}),hke=Lre($t(),Xt(Ve())),X1=tn(_c([Tt({}),$t()])),fke=Tt({err:X1}),pke=vs("receivedSignature"),gke=Tt({"solana-core":$t(),"feature-set":Ln(Ve())}),mke=Tt({program:$t(),programId:As,parsed:iE()}),wke=Tt({programId:As,accounts:Xt(As),data:$t()}),_q=Hs(Tt({err:tn(_c([Tt({}),$t()])),logs:tn(Xt($t())),accounts:Ln(tn(Xt(tn(Tt({executable:zf(),owner:$t(),lamports:Ve(),data:Xt($t()),rentEpoch:Ln(Ve())}))))),unitsConsumed:Ln(Ve()),returnData:Ln(tn(Tt({programId:$t(),data:aU([$t(),vs("base64")])}))),innerInstructions:Ln(tn(Xt(Tt({index:Ve(),instructions:Xt(_c([mke,wke]))}))))})),yke=Hs(Tt({byIdentity:Lre($t(),Xt(Ve())),range:Tt({firstSlot:Ve(),lastSlot:Ve()})}));function bke(n,e,t,r,i,s){const o=t||XMe;let a;s!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let c;return r&&(c=async(d,f)=>{const m=await new Promise((w,y)=>{try{r(d,f,(b,E)=>w([b,E]))}catch(b){y(b)}});return await o(...m)}),new Lne(async(d,f)=>{const m={method:"POST",body:d,agent:a,headers:Object.assign({"Content-Type":"application/json"},e||{},bOe)};try{let w=5,y,b=500;for(;c?y=await c(n,m):y=await o(n,m),!(y.status!==429||i===!0||(w-=1,w===0));)console.error(`Server responded with ${y.status} ${y.statusText}. Retrying after ${b}ms delay...`),await xy(b),b*=2;const E=await y.text();y.ok?f(null,E):f(new Error(`${y.status} ${y.statusText}: ${E}`))}catch(w){w instanceof Error&&f(w)}},{})}function vke(n){return(e,t)=>new Promise((r,i)=>{n.request(e,t,(s,o)=>{if(s){i(s);return}r(o)})})}function xke(n){return e=>new Promise((t,r)=>{e.length===0&&t([]);const i=e.map(s=>n.request(s.methodName,s.args));n.request(i,(s,o)=>{if(s){r(s);return}t(o)})})}const Eke=vr(oke),Ake=vr(lke),Ske=vr(cke),_ke=vr(uke),Cke=vr(dke),Tke=vr(hke),Ike=vr(Ve()),Nke=Hs(Tt({total:Ve(),circulating:Ve(),nonCirculating:Ve(),nonCirculatingAccounts:Xt(As)})),tB=Tt({amount:$t(),uiAmount:tn(Ve()),decimals:Ve(),uiAmountString:Ln($t())}),Rke=Hs(Xt(Tt({address:As,amount:$t(),uiAmount:tn(Ve()),decimals:Ve(),uiAmountString:Ln($t())}))),Mke=Hs(Xt(Tt({pubkey:As,account:Tt({executable:zf(),owner:As,lamports:Ve(),data:gU,rentEpoch:Ve()})}))),nB=Tt({program:$t(),parsed:iE(),space:Ve()}),kke=Hs(Xt(Tt({pubkey:As,account:Tt({executable:zf(),owner:As,lamports:Ve(),data:nB,rentEpoch:Ve()})}))),Oke=Hs(Xt(Tt({lamports:Ve(),address:As}))),H_=Tt({executable:zf(),owner:As,lamports:Ve(),data:gU,rentEpoch:Ve()}),Pke=Tt({pubkey:As,account:H_}),Dke=JC(_c([oU(Ot),nB]),_c([Gre,nB]),n=>Array.isArray(n)?qt(n,gU):n),rB=Tt({executable:zf(),owner:As,lamports:Ve(),data:Dke,rentEpoch:Ve()}),Bke=Tt({pubkey:As,account:rB}),Lke=Tt({state:_c([vs("active"),vs("inactive"),vs("activating"),vs("deactivating")]),active:Ve(),inactive:Ve()}),$ke=vr(Xt(Tt({signature:$t(),slot:Ve(),err:X1,memo:tn($t()),blockTime:Ln(tn(Ve()))}))),Uke=vr(Xt(Tt({signature:$t(),slot:Ve(),err:X1,memo:tn($t()),blockTime:Ln(tn(Ve()))}))),jke=Tt({subscription:Ve(),result:pR(H_)}),zke=Tt({pubkey:As,account:H_}),Fke=Tt({subscription:Ve(),result:pR(zke)}),Wke=Tt({parent:Ve(),slot:Ve(),root:Ve()}),Hke=Tt({subscription:Ve(),result:Wke}),Vke=_c([Tt({type:_c([vs("firstShredReceived"),vs("completed"),vs("optimisticConfirmation"),vs("root")]),slot:Ve(),timestamp:Ve()}),Tt({type:vs("createdBank"),parent:Ve(),slot:Ve(),timestamp:Ve()}),Tt({type:vs("frozen"),slot:Ve(),timestamp:Ve(),stats:Tt({numTransactionEntries:Ve(),numSuccessfulTransactions:Ve(),numFailedTransactions:Ve(),maxTransactionsPerEntry:Ve()})}),Tt({type:vs("dead"),slot:Ve(),timestamp:Ve(),err:$t()})]),qke=Tt({subscription:Ve(),result:Vke}),Kke=Tt({subscription:Ve(),result:pR(_c([fke,pke]))}),Yke=Tt({subscription:Ve(),result:Ve()}),Gke=Tt({pubkey:$t(),gossip:tn($t()),tpu:tn($t()),rpc:tn($t()),version:tn($t())}),Cq=Tt({votePubkey:$t(),nodePubkey:$t(),activatedStake:Ve(),epochVoteAccount:zf(),epochCredits:Xt(aU([Ve(),Ve(),Ve()])),commission:Ve(),lastVote:Ve(),rootSlot:tn(Ve())}),Zke=vr(Tt({current:Xt(Cq),delinquent:Xt(Cq)})),Qke=_c([vs("processed"),vs("confirmed"),vs("finalized")]),Xke=Tt({slot:Ve(),confirmations:tn(Ve()),err:X1,confirmationStatus:Ln(Qke)}),Jke=Hs(Xt(tn(Xke))),eOe=vr(Ve()),Xre=Tt({accountKey:As,writableIndexes:Xt(Ve()),readonlyIndexes:Xt(Ve())}),mU=Tt({signatures:Xt($t()),message:Tt({accountKeys:Xt($t()),header:Tt({numRequiredSignatures:Ve(),numReadonlySignedAccounts:Ve(),numReadonlyUnsignedAccounts:Ve()}),instructions:Xt(Tt({accounts:Xt(Ve()),data:$t(),programIdIndex:Ve()})),recentBlockhash:$t(),addressTableLookups:Ln(Xt(Xre))})}),Jre=Tt({pubkey:As,signer:zf(),writable:zf(),source:Ln(_c([vs("transaction"),vs("lookupTable")]))}),eie=Tt({accountKeys:Xt(Jre),signatures:Xt($t())}),tie=Tt({parsed:iE(),program:$t(),programId:As}),nie=Tt({accounts:Xt(As),data:$t(),programId:As}),tOe=_c([nie,tie]),nOe=_c([Tt({parsed:iE(),program:$t(),programId:$t()}),Tt({accounts:Xt($t()),data:$t(),programId:$t()})]),rie=JC(tOe,nOe,n=>"accounts"in n?qt(n,nie):qt(n,tie)),iie=Tt({signatures:Xt($t()),message:Tt({accountKeys:Xt(Jre),instructions:Xt(rie),recentBlockhash:$t(),addressTableLookups:Ln(tn(Xt(Xre)))})}),IN=Tt({accountIndex:Ve(),mint:$t(),owner:Ln($t()),programId:Ln($t()),uiTokenAmount:tB}),sie=Tt({writable:Xt(As),readonly:Xt(As)}),gR=Tt({err:X1,fee:Ve(),innerInstructions:Ln(tn(Xt(Tt({index:Ve(),instructions:Xt(Tt({accounts:Xt(Ve()),data:$t(),programIdIndex:Ve()}))})))),preBalances:Xt(Ve()),postBalances:Xt(Ve()),logMessages:Ln(tn(Xt($t()))),preTokenBalances:Ln(tn(Xt(IN))),postTokenBalances:Ln(tn(Xt(IN))),loadedAddresses:Ln(sie),computeUnitsConsumed:Ln(Ve()),costUnits:Ln(Ve())}),wU=Tt({err:X1,fee:Ve(),innerInstructions:Ln(tn(Xt(Tt({index:Ve(),instructions:Xt(rie)})))),preBalances:Xt(Ve()),postBalances:Xt(Ve()),logMessages:Ln(tn(Xt($t()))),preTokenBalances:Ln(tn(Xt(IN))),postTokenBalances:Ln(tn(Xt(IN))),loadedAddresses:Ln(sie),computeUnitsConsumed:Ln(Ve()),costUnits:Ln(Ve())}),sE=_c([vs(0),vs("legacy")]),J1=Tt({pubkey:$t(),lamports:Ve(),postBalance:tn(Ve()),rewardType:tn($t()),commission:Ln(tn(Ve()))}),rOe=vr(tn(Tt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Ve(),transactions:Xt(Tt({transaction:mU,meta:tn(gR),version:Ln(sE)})),rewards:Ln(Xt(J1)),blockTime:tn(Ve()),blockHeight:tn(Ve())}))),iOe=vr(tn(Tt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Ve(),rewards:Ln(Xt(J1)),blockTime:tn(Ve()),blockHeight:tn(Ve())}))),sOe=vr(tn(Tt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Ve(),transactions:Xt(Tt({transaction:eie,meta:tn(gR),version:Ln(sE)})),rewards:Ln(Xt(J1)),blockTime:tn(Ve()),blockHeight:tn(Ve())}))),oOe=vr(tn(Tt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Ve(),transactions:Xt(Tt({transaction:iie,meta:tn(wU),version:Ln(sE)})),rewards:Ln(Xt(J1)),blockTime:tn(Ve()),blockHeight:tn(Ve())}))),aOe=vr(tn(Tt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Ve(),transactions:Xt(Tt({transaction:eie,meta:tn(wU),version:Ln(sE)})),rewards:Ln(Xt(J1)),blockTime:tn(Ve()),blockHeight:tn(Ve())}))),cOe=vr(tn(Tt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Ve(),rewards:Ln(Xt(J1)),blockTime:tn(Ve()),blockHeight:tn(Ve())}))),lOe=vr(tn(Tt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Ve(),transactions:Xt(Tt({transaction:mU,meta:tn(gR)})),rewards:Ln(Xt(J1)),blockTime:tn(Ve())}))),Tq=vr(tn(Tt({blockhash:$t(),previousBlockhash:$t(),parentSlot:Ve(),signatures:Xt($t()),blockTime:tn(Ve())}))),sP=vr(tn(Tt({slot:Ve(),meta:tn(gR),blockTime:Ln(tn(Ve())),transaction:mU,version:Ln(sE)}))),RI=vr(tn(Tt({slot:Ve(),transaction:iie,meta:tn(wU),blockTime:Ln(tn(Ve())),version:Ln(sE)}))),uOe=Hs(Tt({blockhash:$t(),lastValidBlockHeight:Ve()})),dOe=Hs(zf()),hOe=Tt({slot:Ve(),numTransactions:Ve(),numSlots:Ve(),samplePeriodSecs:Ve()}),fOe=vr(Xt(hOe)),pOe=Hs(tn(Tt({feeCalculator:Tt({lamportsPerSignature:Ve()})}))),gOe=vr($t()),mOe=vr($t()),wOe=Tt({err:X1,logs:Xt($t()),signature:$t()}),yOe=Tt({result:pR(wOe),subscription:Ve()}),bOe={"solana-client":"js/1.0.0-maintenance"};class mR{constructor(e,t){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const u={};return async d=>{const{commitment:f,config:m}=Qi(d),w=this._buildArgs([],f,void 0,m),y=Eq(w);return u[y]=u[y]??(async()=>{try{const b=await this._rpcRequest("getBlockHeight",w),E=qt(b,vr(Ve()));if("error"in E)throw new Nn(E.error,"failed to get block height information");return E.result}finally{delete u[y]}})(),await u[y]}})();let r,i,s,o,a,c;t&&typeof t=="string"?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,r=t.wsEndpoint,i=t.httpHeaders,s=t.fetch,o=t.fetchMiddleware,a=t.disableRetryOnRateLimit,c=t.httpAgent),this._rpcEndpoint=ike(e),this._rpcWsEndpoint=r||rke(e),this._rpcClient=bke(e,i,s,o,a,c),this._rpcRequest=vke(this._rpcClient),this._rpcBatchRequest=xke(this._rpcClient),this._rpcWebSocket=new JMe(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,t){const{commitment:r,config:i}=Qi(t),s=this._buildArgs([e.toBase58()],r,void 0,i),o=await this._rpcRequest("getBalance",s),a=qt(o,Hs(Ve()));if("error"in a)throw new Nn(a.error,`failed to get balance for ${e.toBase58()}`);return a.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then(r=>r.value).catch(r=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+r)})}async getBlockTime(e){const t=await this._rpcRequest("getBlockTime",[e]),r=qt(t,vr(tn(Ve())));if("error"in r)throw new Nn(r.error,`failed to get block time for slot ${e}`);return r.result}async getMinimumLedgerSlot(){const e=await this._rpcRequest("minimumLedgerSlot",[]),t=qt(e,vr(Ve()));if("error"in t)throw new Nn(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){const e=await this._rpcRequest("getFirstAvailableBlock",[]),t=qt(e,Ike);if("error"in t)throw new Nn(t.error,"failed to get first available block");return t.result}async getSupply(e){let t={};typeof e=="string"?t={commitment:e}:e?t={...e,commitment:e&&e.commitment||this.commitment}:t={commitment:this.commitment};const r=await this._rpcRequest("getSupply",[t]),i=qt(r,Nke);if("error"in i)throw new Nn(i.error,"failed to get supply");return i.result}async getTokenSupply(e,t){const r=this._buildArgs([e.toBase58()],t),i=await this._rpcRequest("getTokenSupply",r),s=qt(i,Hs(tB));if("error"in s)throw new Nn(s.error,"failed to get token supply");return s.result}async getTokenAccountBalance(e,t){const r=this._buildArgs([e.toBase58()],t),i=await this._rpcRequest("getTokenAccountBalance",r),s=qt(i,Hs(tB));if("error"in s)throw new Nn(s.error,"failed to get token account balance");return s.result}async getTokenAccountsByOwner(e,t,r){const{commitment:i,config:s}=Qi(r);let o=[e.toBase58()];"mint"in t?o.push({mint:t.mint.toBase58()}):o.push({programId:t.programId.toBase58()});const a=this._buildArgs(o,i,"base64",s),c=await this._rpcRequest("getTokenAccountsByOwner",a),u=qt(c,Mke);if("error"in u)throw new Nn(u.error,`failed to get token accounts owned by account ${e.toBase58()}`);return u.result}async getParsedTokenAccountsByOwner(e,t,r){let i=[e.toBase58()];"mint"in t?i.push({mint:t.mint.toBase58()}):i.push({programId:t.programId.toBase58()});const s=this._buildArgs(i,r,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",s),a=qt(o,kke);if("error"in a)throw new Nn(a.error,`failed to get token accounts owned by account ${e.toBase58()}`);return a.result}async getLargestAccounts(e){const t={...e,commitment:e&&e.commitment||this.commitment},r=t.filter||t.commitment?[t]:[],i=await this._rpcRequest("getLargestAccounts",r),s=qt(i,Oke);if("error"in s)throw new Nn(s.error,"failed to get largest accounts");return s.result}async getTokenLargestAccounts(e,t){const r=this._buildArgs([e.toBase58()],t),i=await this._rpcRequest("getTokenLargestAccounts",r),s=qt(i,Rke);if("error"in s)throw new Nn(s.error,"failed to get token largest accounts");return s.result}async getAccountInfoAndContext(e,t){const{commitment:r,config:i}=Qi(t),s=this._buildArgs([e.toBase58()],r,"base64",i),o=await this._rpcRequest("getAccountInfo",s),a=qt(o,Hs(tn(H_)));if("error"in a)throw new Nn(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getParsedAccountInfo(e,t){const{commitment:r,config:i}=Qi(t),s=this._buildArgs([e.toBase58()],r,"jsonParsed",i),o=await this._rpcRequest("getAccountInfo",s),a=qt(o,Hs(tn(rB)));if("error"in a)throw new Nn(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(r){throw new Error("failed to get info about account "+e.toBase58()+": "+r)}}async getMultipleParsedAccounts(e,t){const{commitment:r,config:i}=Qi(t),s=e.map(u=>
1010u.toBase58()),o=this._buildArgs([s],r,"jsonParsed",i),a=await this._rpcRequest("getMultipleAccounts",o),c=qt(a,Hs(Xt(tn(rB))));if("error"in c)throw new Nn(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfoAndContext(e,t){const{commitment:r,config:i}=Qi(t),s=e.map(u=>u.toBase58()),o=this._buildArgs([s],r,"base64",i),a=await this._rpcRequest("getMultipleAccounts",o),c=qt(a,Hs(Xt(tn(H_))));if("error"in c)throw new Nn(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,r){const{commitment:i,config:s}=Qi(t),o=this._buildArgs([e.toBase58()],i,void 0,{...s,epoch:r??(s==null?void 0:s.epoch)}),a=await this._rpcRequest("getStakeActivation",o),c=qt(a,vr(Lke));if("error"in c)throw new Nn(c.error,`failed to get Stake Activation ${e.toBase58()}`);return c.result}async getProgramAccounts(e,t){const{commitment:r,config:i}=Qi(t),{encoding:s,...o}=i||{},a=this._buildArgs([e.toBase58()],r,s||"base64",{...o,...o.filters?{filters:Sq(o.filters)}:null}),c=await this._rpcRequest("getProgramAccounts",a),u=Xt(Pke),d=o.withContext===!0?qt(c,Hs(u)):qt(c,vr(u));if("error"in d)throw new Nn(d.error,`failed to get accounts owned by program ${e.toBase58()}`);return d.result}async getParsedProgramAccounts(e,t){const{commitment:r,config:i}=Qi(t),s=this._buildArgs([e.toBase58()],r,"jsonParsed",i),o=await this._rpcRequest("getProgramAccounts",s),a=qt(o,vr(Xt(Bke)));if("error"in a)throw new Nn(a.error,`failed to get accounts owned by program ${e.toBase58()}`);return a.result}async confirmTransaction(e,t){var s;let r;if(typeof e=="string")r=e;else{const o=e;if((s=o.abortSignal)!=null&&s.aborted)return Promise.reject(o.abortSignal.reason);r=o.signature}let i;try{i=ca.decode(r)}catch{throw new Error("signature must be base58 encoded: "+r)}return oi(i.length===64,"signature has invalid length"),typeof e=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:t||this.commitment,signature:r}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:t||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise((t,r)=>{e!=null&&(e.aborted?r(e.reason):e.addEventListener("abort",()=>{r(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:t}){let r,i,s=!1;const o=new Promise((c,u)=>{try{r=this.onSignature(t,(f,m)=>{r=void 0;const w={context:m,value:f};c({__type:Fp.PROCESSED,response:w})},e);const d=new Promise(f=>{r==null?f():i=this._onSubscriptionStateChange(r,m=>{m==="subscribed"&&f()})});(async()=>{if(await d,s)return;
1010const f=await this.getSignatureStatus(t);if(s||f==null)return;const{context:m,value:w}=f;if(w!=null)if(w!=null&&w.err)u(w.err);else{switch(e){case"confirmed":case"single":case"singleGossip":{if(w.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(w.confirmationStatus==="processed"||w.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}s=!0,c({__type:Fp.PROCESSED,response:{context:m,value:w}})}})()}catch(d){u(d)}});return{abortConfirmation:()=>{i&&(i(),i=void 0),r!=null&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:t,lastValidBlockHeight:r,signature:i}}){let s=!1;const o=new Promise(f=>{const m=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let w=await m();if(!s){for(;w<=r;)if(await xy(1e3),s||(w=await m(),s))return;f({__type:Fp.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:e,signature:i}),u=this.getCancellationPromise(t);let d;try{const f=await Promise.race([u,c,o]);if(f.__type===Fp.PROCESSED)d=f.response;else throw new hU(i)}finally{s=!0,a()}return d}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:t,minContextSlot:r,nonceAccountPubkey:i,nonceValue:s,signature:o}}){let a=!1;const c=new Promise(w=>{let y=s,b=null;const E=async()=>{try{const{context:T,value:N}=await this.getNonceAndContext(i,{commitment:e,minContextSlot:r});return b=T.slot,N==null?void 0:N.nonce}catch{return y}};(async()=>{if(y=await E(),!a)for(;;){if(s!==y){w({__type:Fp.NONCE_INVALID,slotInWhichNonceDidAdvance:b});return}if(await xy(2e3),a||(y=await E(),a))return}})()}),{abortConfirmation:u,confirmationPromise:d}=this.getTransactionConfirmationPromise({commitment:e,signature:o}),f=this.getCancellationPromise(t);let m;try{const w=await Promise.race([f,d,c]);if(w.__type===Fp.PROCESSED)m=w.response;else{let y;for(;;
1010){const b=await this.getSignatureStatus(o);if(b==null)break;if(b.context.slot<(w.slotInWhichNonceDidAdvance??r)){await xy(400);continue}y=b;break}if(y!=null&&y.value){const b=e||"finalized",{confirmationStatus:E}=y.value;switch(b){case"processed":case"recent":if(E!=="processed"&&E!=="confirmed"&&E!=="finalized")throw new R2(o);break;case"confirmed":case"single":case"singleGossip":if(E!=="confirmed"&&E!=="finalized")throw new R2(o);break;case"finalized":case"max":case"root":if(E!=="finalized")throw new R2(o);break;default:}m={context:y.context,value:{err:y.value.err}}}else throw new R2(o)}}finally{a=!0,u()}return m}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:t}){let r;const i=new Promise(c=>{let u=this._confirmTransactionInitialTimeout||6e4;switch(e){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{u=this._confirmTransactionInitialTimeout||3e4;break}}r=setTimeout(()=>c({__type:Fp.TIMED_OUT,timeoutMs:u}),u)}),{abortConfirmation:s,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:e,signature:t});let a;try{const c=await Promise.race([o,i]);if(c.__type===Fp.PROCESSED)a=c.response;else throw new fU(t,c.timeoutMs/1e3)}finally{clearTimeout(r),s()}return a}async getClusterNodes(){const e=await this._rpcRequest("getClusterNodes",[]),t=qt(e,vr(Xt(Gke)));if("error"in t)throw new Nn(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getVoteAccounts",t),i=qt(r,Zke);if("error"in i)throw new Nn(i.error,"failed to get vote accounts");return i.result}async getSlot(e){const{commitment:t,config:r}=Qi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getSlot",i),o=qt(s,vr(Ve()));if("error"in o)throw new Nn(o.error,"failed to get slot");return o.result}async getSlotLeader(e){const{commitment:t,config:r}=Qi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getSlotLeader",i),o=qt(s,vr($t()));if("error"in o)throw new Nn(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(e,t){const r=[e,t],i=await this._rpcRequest("getSlotLeaders",r),s=qt(i,vr(Xt(As)));if("error"in s)throw new Nn(s.error,"failed to get slot leaders");return s.result}async getSignatureStatus(e,t){const{context:r,value:i}
1010=await this.getSignatureStatuses([e],t);oi(i.length===1);const s=i[0];return{context:r,value:s}}async getSignatureStatuses(e,t){const r=[e];t&&r.push(t);const i=await this._rpcRequest("getSignatureStatuses",r),s=qt(i,Jke);if("error"in s)throw new Nn(s.error,"failed to get signature status");return s.result}async getTransactionCount(e){const{commitment:t,config:r}=Qi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getTransactionCount",i),o=qt(s,vr(Ve()));if("error"in o)throw new Nn(o.error,"failed to get transaction count");return o.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const t=this._buildArgs([],e),r=await this._rpcRequest("getInflationGovernor",t),i=qt(r,Eke);if("error"in i)throw new Nn(i.error,"failed to get inflation");return i.result}async getInflationReward(e,t,r){const{commitment:i,config:s}=Qi(r),o=this._buildArgs([e.map(u=>u.toBase58())],i,void 0,{...s,epoch:t??(s==null?void 0:s.epoch)}),a=await this._rpcRequest("getInflationReward",o),c=qt(a,ake);if("error"in c)throw new Nn(c.error,"failed to get inflation reward");return c.result}async getInflationRate(){const e=await this._rpcRequest("getInflationRate",[]),t=qt(e,Ake);if("error"in t)throw new Nn(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(e){const{commitment:t,config:r}=Qi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getEpochInfo",i),o=qt(s,_ke);if("error"in o)throw new Nn(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const e=await this._rpcRequest("getEpochSchedule",[]),t=qt(e,Cke);if("error"in t)throw new Nn(t.error,"failed to get epoch schedule");const r=t.result;return new Yre(r.slotsPerEpoch,r.leaderScheduleSlotOffset,r.warmup,r.firstNormalEpoch,r.firstNormalSlot)}async getLeaderSchedule(){const e=await this._rpcRequest("getLeaderSchedule",[]),t=qt(e,Tke);if("error"in t)throw new Nn(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(e,t){const r=this._buildArgs([e],t),i=await this._rpcRequest("getMinimumBalanceForRentExemption",r),s=qt(i,eOe);return"error"in s?(console.warn("Unable to fetch minimum balance for rent exemption"),0):s.result}async getRecentBlockhashAndContext(e){const{context:t,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(e);return{context:t,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON(){return{}}}}}}async getRecentPerformanceSamples(e){const t=await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),r=qt(t,fOe);if("error"in r)throw new Nn(r.error,"failed to get recent performance samples");return r.result}async getFeeCalculatorForBlockhash(e,t){const r=this._buildArgs([e],t),i=await this._rpcRequest("getFeeCalculatorForBlockhash",r),s=qt(i,pOe);if("error"in s)throw new Nn(s.error,"failed to get fee calculator");const{context:o,value:a}=s.result;return{context:o,value:a!==null?a.feeCalculator:null}}async getFeeForMessage(e,t){const r=xr(e.serialize()).toString("base64"),i=this._buildArgs([r],t),s=await this._rpcRequest("getFeeForMessage",i),o=qt(s,Hs(tn(Ve())));if("error"in o)throw new Nn(o.error,"failed to get fee for message");if(o.result===null)throw new Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(e){var o;const t=(o=e==null?void 0:e.lockedWritableAccounts)==null?void 0:o.map(a=>a.toBase58()),r=t!=null&&t.length?[t]:[],i=await this._rpcRequest("getRecentPrioritizationFees",r),s=qt(i,Ske);if("error"in s)throw new Nn(s.error,"failed to get recent prioritization fees");return s.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(e){const{commitment:t,config:r}=Qi(e),i=this._buildArgs([],t,void 0,r),s=await this._rpcRequest("getLatestBlockhash",i),o=qt(s,uOe);if("error"in o)throw new Nn(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(e,t){const{commitment:r,config:i}=Qi(t),s=this._buildArgs([e],r,void 0,i),o=await this._rpcRequest("isBlockhashValid",s),a=qt(o,dOe);if("error"in a)throw new Nn(a.error,"failed to determine if the blockhash `"+e+"`is valid");return a.result}async getVersion(){const e=await this._rpcRequest("getVersion",[]),t=qt(e,vr(gke));if("error"in t)throw new Nn(t.error,"failed to get version");return t.result}async getGenesisHash(){const e=await this._rpcRequest("getGenesisHash",[]),t=qt(e,vr($t()));if("error"in t)throw new Nn(t.error,"failed to get genesis hash");return t.result}async getBlock(e,t){const{commitment:r,config:i}=Qi(t),s=this._buildArgsAtLeastConfirmed([e],r,void 0,i),o=await this._rpcRequest("getBlock",s);
1010try{switch(i==null?void 0:i.transactionDetails){case"accounts":{const a=qt(o,sOe);if("error"in a)throw a.error;return a.result}case"none":{const a=qt(o,iOe);if("error"in a)throw a.error;return a.result}default:{const a=qt(o,rOe);if("error"in a)throw a.error;const{result:c}=a;return c?{...c,transactions:c.transactions.map(({transaction:u,meta:d,version:f})=>({meta:d,transaction:{...u,message:iP(f,u.message)},version:f}))}:null}}}catch(a){throw new Nn(a,"failed to get confirmed block")}}async getParsedBlock(e,t){const{commitment:r,config:i}=Qi(t),s=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",i),o=await this._rpcRequest("getBlock",s);try{switch(i==null?void 0:i.transactionDetails){case"accounts":{const a=qt(o,aOe);if("error"in a)throw a.error;return a.result}case"none":{const a=qt(o,cOe);if("error"in a)throw a.error;return a.result}default:{const a=qt(o,oOe);if("error"in a)throw a.error;return a.result}}}catch(a){throw new Nn(a,"failed to get block")}}async getBlockProduction(e){let t,r;if(typeof e=="string")r=e;else if(e){const{commitment:a,...c}=e;r=a,t=c}const i=this._buildArgs([],r,"base64",t),s=await this._rpcRequest("getBlockProduction",i),o=qt(s,yke);if("error"in o)throw new Nn(o.error,"failed to get block production information");return o.result}async getTransaction(e,t){const{commitment:r,config:i}=Qi(t),s=this._buildArgsAtLeastConfirmed([e],r,void 0,i),o=await this._rpcRequest("getTransaction",s),a=qt(o,sP);if("error"in a)throw new Nn(a.error,"failed to get transaction");const c=a.result;return c&&{...c,transaction:{...c.transaction,message:iP(c.version,c.transaction.message)}}}async getParsedTransaction(e,t){const{commitment:r,config:i}=Qi(t),s=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",i),o=await this._rpcRequest("getTransaction",s),a=qt(o,RI);if("error"in a)throw new Nn(a.error,"failed to get transaction");return a.result}async getParsedTransactions(e,t){const{commitment:r,config:i}=Qi(t),s=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],r,"jsonParsed",i)}));return(await this._rpcBatchRequest(s)).map(c=>{const u=qt(c,RI);if("error"in u)throw new Nn(u.error,"failed to get transactions");return u.result})}async getTransactions(e,t){const{commitment:r,config:i}=Qi(t),s=e.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],r,void 0,i)}));return(await this._rpcBatchRequest(s)).map(c=>{const u=qt(c,sP);if("error"in u)throw new Nn(u.error,"failed to get transactions");const d=u.result;return d&&{...d,transaction:{...d.transaction,message:iP(d.version,d.transaction.message)}}})}async getConfirmedBlock(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),i=await this._rpcRequest("getBlock",r),s=qt(i,lOe);if("error"in s)throw new Nn(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+e+" not found");const a={...o,transactions:o.transactions.map(({transaction:c,meta:u})=>{const d=new rh(c.message);return{meta:u,transaction:{...c,message:d}}})};return{...a,transactions:a.transactions.map(({transaction:c,meta:u})=>({meta:u,transaction:Wr.populate(c.message,c.signatures)}))}}async getBlocks(e,t,r){const i=this._buildArgsAtLeastConfirmed(t!==void 0?[e,t]:[e],r),s=await this._rpcRequest("getBlocks",i),o=qt(s,vr(Xt(Ve())));if("error"in o)throw new Nn(o.error,"failed to get blocks");return o.result}async getBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getBlock",r),s=qt(i,Tq);if("error"in s)throw new Nn(s.error,"failed to get block");const o=s.result;if(!o)throw new Error("Block "+e+" not found");return o}async getConfirmedBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getBlock",r),s=qt(i,Tq);if("error"in s)throw new Nn(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+e+" not found");return o}async getConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),i=await this._rpcRequest("getTransaction",r),s=qt(i,sP);if("error"in s)throw new Nn(s.error,"failed to get transaction");const o=s.result;if(!o)return o;const a=new rh(o.transaction.message),c=o.transaction.signatures;return{...o,transaction:Wr.populate(a,c)}}async getParsedConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),i=await this._rpcRequest("getTransaction",r),s=qt(i,RI);if("error"in s)throw new Nn(s.error,"failed to get confirmed transaction");return s.result}async getParsedConfirmedTransactions(e,t){const r=e.map(o=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([o],t,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(o=>{const a=qt(o,RI);if("error"in a)throw new Nn(a.error,"failed to get confirmed transactions");return a.result})}async getConfirmedSignaturesForAddress(e,t,r){let i={},s=await this.getFirstAvailableBlock();for(;!("until"in i)&&(t--,!(t<=0||t<s));)try{const c=await this.getConfirmedBlockSignatures(t,"finalized");c.signatures.length>0&&(i.until=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}
1010let o=await this.getSlot("finalized");for(;!("before"in i)&&(r++,!(r>o));)try{const c=await this.getConfirmedBlockSignatures(r);c.signatures.length>0&&(i.before=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}return(await this.getConfirmedSignaturesForAddress2(e,i)).map(c=>c.signature)}async getConfirmedSignaturesForAddress2(e,t,r){const i=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),s=await this._rpcRequest("getConfirmedSignaturesForAddress2",i),o=qt(s,$ke);if("error"in o)throw new Nn(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(e,t,r){const i=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),s=await this._rpcRequest("getSignaturesForAddress",i),o=qt(s,Uke);if("error"in o)throw new Nn(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(e,t){const{context:r,value:i}=await this.getAccountInfoAndContext(e,t);let s=null;return i!==null&&(s=new eB({key:e,state:eB.deserialize(i.data)})),{context:r,value:s}}async getNonceAndContext(e,t){const{context:r,value:i}=await this.getAccountInfoAndContext(e,t);let s=null;return i!==null&&(s=fR.fromAccountData(i.data)),{context:r,value:s}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then(r=>r.value).catch(r=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+r)})}async requestAirdrop(e,t){const r=await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),i=qt(r,gOe);if("error"in i)throw new Nn(i.error,`airdrop to ${e.toBase58()} failed`);return i.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await xy(100);const r=Date.now()-this._blockhashInfo.lastFetch>=Zre;if(this._blockhashInfo.latestBlockhash!==null&&!r)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),t=this._blockhashInfo.latestBlockhash,r=t?t.blockhash:null;for(let i=0;i<50;i++){const s=await this.getLatestBlockhash("finalized");if(r!==s.blockhash)return this._blockhashInfo={latestBlockhash:s,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},s;await xy(Vre/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:t,config:r}=Qi(e),i=this._buildArgs([],t,"base64",r),s=await this._rpcRequest("getStakeMinimumDelegation",i),o=qt(s,Hs(Ve()));if("error"in o)throw new Nn(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(e,t,r){if("message"in e){const b=e.serialize(),E=Ot.from(b).toString("base64");if(Array.isArray(t)||r!==void 0)throw new Error("Invalid arguments");const T=t||{};T.encoding="base64","commitment"in T||(T.commitment=this.commitment),t&&typeof t=="object"&&"innerInstructions"in t&&(T.innerInstructions=t.innerInstructions);const N=[E,T],I=await this._rpcRequest("simulateTransaction",N),H=qt(I,_q);if("error"in H)throw new Error("failed to simulate transaction: "+H.error.message);return H.result}let i;if(e instanceof Wr){let y=e;i=new Wr,i.feePayer=y.feePayer,i.instructions=e.instructions,i.nonceInfo=y.nonceInfo,i.signatures=y.signatures}else i=Wr.populate(e),i._message=i._json=void 0;if(t!==void 0&&!Array.isArray(t))throw new Error("Invalid arguments");const s=t;if(i.nonceInfo&&s)i.sign(...s);else{let y=this._disableBlockhashCaching;for(;;){const b=await this._blockhashWithExpiryBlockHeight(y);if(i.lastValidBlockHeight=b.lastValidBlockHeight,i.recentBlockhash=b.blockhash,!s)break;if(i.sign(...s),!i.signature)throw new Error("!signature");const E=i.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(E)&&!this._blockhashInfo.transactionSignatures.includes(E)){this._blockhashInfo.simulatedSignatures.push(E);break}else y=!0}}const o=i._compile(),a=o.serialize(),u=i._serialize(a).toString("base64"),d={encoding:"base64",commitment:this.commitment};if(r){const y=(Array.isArray(r)?r:o.nonProgramIds()).map(b=>
vendor: 9,566 bytes, lines 1010-1011
1010b.toBase58());d.accounts={encoding:"base64",addresses:y}}s&&(d.sigVerify=!0),t&&typeof t=="object"&&"innerInstructions"in t&&(d.innerInstructions=t.innerInstructions);const f=[u,d],m=await this._rpcRequest("simulateTransaction",f),w=qt(m,_q);if("error"in w){let y;if("data"in w.error&&(y=w.error.data.logs,y&&Array.isArray(y))){const b=` 1011 `,E=b+y.join(b);console.error(w.error.message,E)}throw new W_({action:"simulate",signature:"",transactionMessage:w.error.message,logs:y})}return w.result}async sendTransaction(e,t,r){if("version"in e){if(t&&Array.isArray(t))throw new Error("Invalid arguments");const o=e.serialize();return await this.sendRawTransaction(o,t)}if(t===void 0||!Array.isArray(t))throw new Error("Invalid arguments");const i=t;if(e.nonceInfo)e.sign(...i);else{let o=this._disableBlockhashCaching;for(;;){const a=await this._blockhashWithExpiryBlockHeight(o);if(e.lastValidBlockHeight=a.lastValidBlockHeight,e.recentBlockhash=a.blockhash,e.sign(...i),!e.signature)throw new Error("!signature");const c=e.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(c))o=!0;else{this._blockhashInfo.transactionSignatures.push(c);break}}}const s=e.serialize();return await this.sendRawTransaction(s,r)}async sendRawTransaction(e,t){const r=xr(e).toString("base64");return await this.sendEncodedTransaction(r,t)}async sendEncodedTransaction(e,t){const r={encoding:"base64"},i=t&&t.skipPreflight,s=i===!0?"processed":t&&t.preflightCommitment||this.commitment;t&&t.maxRetries!=null&&(r.maxRetries=t.maxRetries),t&&t.minContextSlot!=null&&(r.minContextSlot=t.minContextSlot),i&&(r.skipPreflight=i),s&&(r.preflightCommitment=s);const o=[e,r],a=await this._rpcRequest("sendTransaction",o),c=qt(a,mOe);if("error"in c){let u;throw"data"in c.error&&(u=c.error.data.logs),new W_({action:i?"send":"simulate",signature:"",transactionMessage:c.error.message,logs:u})}return c.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([t,r])=>{this._setSubscription(t,{...r,state:"pending"})})}_setSubscription(e,t){var i;const r=(i=this._subscriptionsByHash[e])==null?void 0:i.state;if(this._subscriptionsByHash[e]=t,r!==t.state){const s=this._subscriptionStateChangeCallbacksByHash[e];s&&s.forEach(o=>{try{o(t.state)}catch{}})}}_onSubscriptionStateChange(e,t){var s;const r=this._subscriptionHashByClientSubscriptionId[e];if(r==null)return()=>{};const i=(s=this._subscriptionStateChangeCallbacksByHash)[r]||(s[r]=new Set);return i.add(t),()=>{i.delete(t),i.size===0&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(r){r instanceof Error&&console.log(`Error when closing socket connection: ${r.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async r=>{const i=this._subscriptionsByHash[r];if(i!==void 0)switch(i.state){case"pending":case"unsubscribed":if(i.callbacks.size===0){delete this._subscriptionsByHash[r],i.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:s,method:o}=i;try{this._setSubscription(r,{...i,state:"subscribing"});const a=await this._rpcWebSocket.call(o,s);this._setSubscription(r,{...i,serverSubscriptionId:a,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[a]=i.callbacks,await this._updateSubscriptions()}catch(a){if(console.error(`Received ${a instanceof Error?"":"JSON-RPC "}error calling \`${o}\``,{args:s,error:a}),!t())return;this._setSubscription(r,{...i,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":i.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:s,unsubscribeMethod:o}=i;if(this._subscriptionsAutoDisposedByRpc.has(s))this._subscriptionsAutoDisposedByRpc.delete(s);else{this._setSubscription(r,{...i,state:"unsubscribing"}),this._setSubscription(r,{...i,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[s])}catch(a){if(a instanceof Error&&console.error(`${o} error:`,a.message),!t())return;this._setSubscription(r,{...i,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(r,{...i,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,t){const r=this._subscriptionCallbacksByServerSubscriptionId[e];r!==void 0&&r.forEach(i=>{try{i(...t)}catch(s){console.error(s)}})}_wsOnAccountNotification(e){const{result:t,subscription:r}=qt(e,jke);this._handleServerNotification(r,[t.value,t.context])}_makeSubscription(e,t){const r=this._nextClientSubscriptionId++,i=Eq([e.method,t]),s=this._subscriptionsByHash[i];return s===void 0?this._subscriptionsByHash[i]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}:s.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const o=this._subscriptionsByHash[i];oi(o!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),o.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,t,r){const{commitment:i,config:s}=Qi(r),o=this._buildArgs([e.toBase58()],i||this._commitment||"finalized","base64",s);return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:t,subscription:r}=qt(e,Fke);this._handleServerNotification(r,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,r,i){const{commitment:s,config:o}=Qi(r),a=this._buildArgs([e.toBase58()],s||this._commitment||"finalized","base64",o||(i?{filters:Sq(i)}:void 0));return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},a)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,r){const i=this._buildArgs([typeof e=="object"?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},i)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:t,subscription:r}=qt(e,yOe);this._handleServerNotification(r,[t.value,t.context])}_wsOnSlotNotification(e){const{result:t,subscription:r}=qt(e,Hke);this._handleServerNotification(r,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:t,subscription:r}=qt(e,qke);this._handleServerNotification(r,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${t}' events could not be found.`)}_buildArgs(e,t,r,i){const s=t||this._commitment;if(s||r||i){let o={};r&&(o.encoding=r),s&&(o.commitment=s),i&&(o=Object.assign(o,i)),e.push(o)}return e}_buildArgsAtLeastConfirmed(e,t,r,i){const s=t||this._commitment;if(s&&!["confirmed","finalized"].includes(s))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,r,i)}_wsOnSignatureNotification(e){const{result:t,subscription:r}=qt(e,Kke);t.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,t.value==="receivedSignature"?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,r){const i=this._buildArgs([e],r||this._commitment||"finalized"),s=this._makeSubscription({callback:(o,a)=>
1011{if(o.type==="status"){t(o.result,a);try{this.removeSignatureListener(s)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return s}onSignatureWithOptions(e,t,r){const{commitment:i,...s}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([e],i,void 0,s),a=this._makeSubscription({callback:(c,u)=>{t(c,u);try{this.removeSignatureListener(a)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return a}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:t,subscription:r}=qt(e,Yke);this._handleServerNotification(r,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class Q2{constructor(e){this._keypair=void 0,this._keypair=e??yq()}static generate(){return new Q2(yq())}static fromSecretKey(e,t){if(e.byteLength!==64)throw new Error("bad secret key size");const r=e.slice(32,64);if(!t||!t.skipValidation){const i=e.slice(0,32),s=TN(i);for(let o=0;o<32;o++)if(r[o]!==s[o])throw new Error("provided secretKey is invalid")}return new Q2({publicKey:r,secretKey:e})}static fromSeed(e){const t=TN(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),new Q2({publicKey:t,secretKey:r})}get publicKey(){return new bt(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const Gp=Object.freeze({CreateLookupTable:{index:0,layout:ie.struct([ie.u32("instruction"),_x("recentSlot"),ie.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:ie.struct([ie.u32("instruction")])},ExtendLookupTable:{index:2,layout:ie.struct([ie.u32("instruction"),_x(),ie.seq(Pr(),ie.offset(ie.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:ie.struct([ie.u32("instruction")])},CloseLookupTable:{index:4,layout:ie.struct([ie.u32("instruction")])}});class vOe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=ie.u32("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(Gp))if(o.index==r){i=s;break}if(!i)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return i}static decodeCreateLookupTable(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);const{recentSlot:t}=vi(Gp.CreateLookupTable,e.data);return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(t)}}static decodeExtendLookupTable(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error(`invalid instruction; found ${e.keys.length} keys, expected at least 2`);const{addresses:t}=vi(Gp.ExtendLookupTable,e.data);return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:t.map(r=>new bt(r))}}static decodeCloseLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}static decodeFreezeLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static decodeDeactivateLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(yU.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}class yU{constructor(){}static createLookupTable(e){const[t,r]=bt.findProgramAddressSync([e.authority.toBuffer(),Pre().encode(e.recentSlot)],this.programId),i=Gp.CreateLookupTable,s=qr(i,{recentSlot:BigInt(e.recentSlot),bumpSeed:r}),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:fo.programId,isSigner:!1,isWritable:!1}];return[new Ni({programId:this.programId,keys:o,data:s}),t]}static freezeLookupTable(e){const t=Gp.FreezeLookupTable,r=qr(t),i=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Ni({programId:this.programId,keys:i,data:r})}static extendLookupTable(e){const t=Gp.ExtendLookupTable,r=qr(t,{addresses:e.addresses.map(s=>s.toBytes())}),i=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&i.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:fo.programId,isSigner:!1,isWritable:!1}),new Ni({programId:this.programId,keys:i,data:r})}static deactivateLookupTable(e){const t=Gp.DeactivateLookupTable,r=qr(t),i=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new Ni({programId:this.programId,keys:i,data:r})}static closeLookupTable(e){const t=Gp.CloseLookupTable,r=qr(t),i=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new Ni({programId:this.programId,keys:i,data:r})}}yU.programId=new bt("AddressLookupTab1e1111111111111111111111111");
1011class xOe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=ie.u8("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(Ef))if(o.index==r){i=s;break}if(!i)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return i}static decodeRequestUnits(e){this.checkProgramId(e.programId);const{units:t,additionalFee:r}=vi(Ef.RequestUnits,e.data);return{units:t,additionalFee:r}}static decodeRequestHeapFrame(e){this.checkProgramId(e.programId);const{bytes:t}=vi(Ef.RequestHeapFrame,e.data);return{bytes:t}}static decodeSetComputeUnitLimit(e){this.checkProgramId(e.programId);const{units:t}=vi(Ef.SetComputeUnitLimit,e.data);return{units:t}}static decodeSetComputeUnitPrice(e){this.checkProgramId(e.programId);const{microLamports:t}=vi(Ef.SetComputeUnitPrice,e.data);return{microLamports:t}}static checkProgramId(e){if(!e.equals(bU.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const Ef=Object.freeze({RequestUnits:{index:0,layout:ie.struct([ie.u8("instruction"),ie.u32("units"),ie.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:ie.struct([ie.u8("instruction"),ie.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:ie.struct([ie.u8("instruction"),ie.u32("units")])},SetComputeUnitPrice:{index:3,layout:ie.struct([ie.u8("instruction"),_x("microLamports")])}});class bU{constructor(){}static requestUnits(e){const t=Ef.RequestUnits,r=qr(t,e);return new Ni({keys:[],programId:this.programId,data:r})}static requestHeapFrame(e){const t=Ef.RequestHeapFrame,r=qr(t,e);return new Ni({keys:[],programId:this.programId,data:r})}static setComputeUnitLimit(e){const t=Ef.SetComputeUnitLimit,r=qr(t,e);return new Ni({keys:[],programId:this.programId,data:r})}static setComputeUnitPrice(e){const t=Ef.SetComputeUnitPrice,r=qr(t,{microLamports:BigInt(e.microLamports)});return new Ni({keys:[],programId:this.programId,data:r})}}bU.programId=new bt("ComputeBudget111111111111111111111111111111");const Iq=64,Nq=32,Rq=64,Mq=ie.struct([ie.u8("numSignatures"),ie.u8("padding"),ie.u16("signatureOffset"),ie.u16("signatureInstructionIndex"),ie.u16("publicKeyOffset"),ie.u16("publicKeyInstructionIndex"),ie.u16("messageDataOffset"),ie.u16("messageDataSize"),ie.u16("messageInstructionIndex")]);class wR{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:i,instructionIndex:s}=e;oi(t.length===Nq,`Public Key must be ${Nq} bytes but received ${t.length} bytes`),oi(i.length===Rq,`Signature must be ${Rq} bytes but received ${i.length} bytes`);const o=Mq.span,a=o+t.length,c=a+i.length,u=1,d=Ot.alloc(c+r.length),f=s??65535;return Mq.encode({numSignatures:u,padding:0,signatureOffset:a,signatureInstructionIndex:f,publicKeyOffset:o,publicKeyInstructionIndex:f,messageDataOffset:c,messageDataSize:r.length,messageInstructionIndex:f},d),d.fill(t,o),d.fill(i,a),d.fill(r,c),new Ni({keys:[],programId:wR.programId,data:d})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:i}=e;oi(t.length===Iq,`Private key must be ${Iq} bytes but received ${t.length} bytes`);try{const s=Q2.fromSecretKey(t),o=s.publicKey.toBytes(),a=uU(r,s.secretKey);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:a,instructionIndex:i})}catch(s){throw new Error(`Error creating instruction; ${s}`)}}}wR.programId=new bt("Ed25519SigVerify111111111111111111111111111");const EOe=(n,e)=>{const t=lU.sign(n,e);return[t.toCompactRawBytes(),t.recovery]};lU.utils.isValidPrivateKey;const AOe=lU.getPublicKey,kq=32,oP=20,Oq=64,SOe=11,aP=ie.struct([ie.u8("numSignatures"),ie.u16("signatureOffset"),ie.u8("signatureInstructionIndex"),ie.u16("ethAddressOffset"),ie.u8("ethAddressInstructionIndex"),ie.u16("messageDataOffset"),ie.u16("messageDataSize"),ie.u8("messageInstructionIndex"),ie.blob(20,"ethAddress"),ie.blob(64,"signature"),ie.u8("recoveryId")]);class X2{constructor(){}static publicKeyToEthAddress(e){oi(e.length===Oq,`Public key must be ${Oq} bytes but received ${e.length} bytes`);try{return Ot.from(PD(xr(e))).slice(-oP)}
1011catch(t){throw new Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:i,recoveryId:s,instructionIndex:o}=e;return X2.createInstructionWithEthAddress({ethAddress:X2.publicKeyToEthAddress(t),message:r,signature:i,recoveryId:s,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:r,signature:i,recoveryId:s,instructionIndex:o=0}=e;let a;typeof t=="string"?t.startsWith("0x")?a=Ot.from(t.substr(2),"hex"):a=Ot.from(t,"hex"):a=t,oi(a.length===oP,`Address must be ${oP} bytes but received ${a.length} bytes`);const c=1+SOe,u=c,d=c+a.length,f=d+i.length+1,m=1,w=Ot.alloc(aP.span+r.length);return aP.encode({numSignatures:m,signatureOffset:d,signatureInstructionIndex:o,ethAddressOffset:u,ethAddressInstructionIndex:o,messageDataOffset:f,messageDataSize:r.length,messageInstructionIndex:o,signature:xr(i),ethAddress:xr(a),recoveryId:s},w),w.fill(xr(r),aP.span),new Ni({keys:[],programId:X2.programId,data:w})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:i}=e;oi(t.length===kq,`Private key must be ${kq} bytes but received ${t.length} bytes`);try{const s=xr(t),o=AOe(s,!1).slice(1),a=Ot.from(PD(xr(r))),[c,u]=EOe(a,s);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:c,recoveryId:u,instructionIndex:i})}catch(s){throw new Error(`Error creating instruction; ${s}`)}}}X2.programId=new bt("KeccakSecp256k11111111111111111111111111111");var oie;const aie=new bt("StakeConfig11111111111111111111111111111111");class cie{constructor(e,t){this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=t}}class e4{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}oie=e4;e4.default=new oie(0,0,bt.default);class _Oe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=ie.u32("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(ko))if(o.index==r){i=s;break}if(!i)throw new Error("Instruction type incorrect; not a StakeInstruction");return i}static decodeInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t,lockup:r}=vi(ko.Initialize,e.data);return{stakePubkey:e.keys[0].pubkey,authorized:new cie(new bt(t.staker),new bt(t.withdrawer)),lockup:new e4(r.unixTimestamp,r.epoch,new bt(r.custodian))}}static decodeDelegate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),vi(ko.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,stakeAuthorizationType:r}=vi(ko.Authorize,e.data),i={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new bt(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(i.custodianPubkey=e.keys[3].pubkey),i}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{newAuthorized:t,stakeAuthorizationType:r,authoritySeed:i,authorityOwner:s}=vi(ko.AuthorizeWithSeed,e.data),o={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:i,authorityOwner:new bt(s),newAuthorizedPubkey:new bt(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(o.custodianPubkey=e.keys[3].pubkey),o}static decodeSplit(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=vi(ko.Split,e.data);return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}static decodeMerge(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),vi(ko.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=vi(ko.Withdraw,e.data),r={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(r.custodianPubkey=e.keys[5].pubkey),r}static decodeDeactivate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),vi(ko.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static checkProgramId(e){if(!e.equals(yR.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const ko=Object.freeze({Initialize:{index:0,layout:ie.struct([ie.u32("instruction"),RMe(),MMe()])},Authorize:{index:1,layout:ie.struct([ie.u32("instruction"),Pr("newAuthorized"),ie.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:ie.struct([ie.u32("instruction")])},Split:{index:3,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports")])},Withdraw:{index:4,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports")])},Deactivate:{index:5,layout:ie.struct([ie.u32("instruction")])},Merge:{index:7,layout:ie.struct([ie.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:ie.struct([ie.u32("instruction"),Pr("newAuthorized"),ie.u32("stakeAuthorizationType"),Ly("authoritySeed"),Pr("authorityOwner")])}}),COe=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class yR{constructor(){}static initialize(e){const{stakePubkey:t,authorized:r,lockup:i}=e,s=i||e4.default,o=ko.Initialize,a=qr(o,{authorized:{staker:xr(r.staker.toBuffer()),withdrawer:xr(r.withdrawer.toBuffer())},lockup:{unixTimestamp:s.unixTimestamp,epoch:s.epoch,custodian:xr(s.custodian.toBuffer())}}),c={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Sx,isSigner:!1,isWritable:!1}],programId:this.programId,data:a};return new Ni(c)}static createAccountWithSeed(e){const t=new Wr;t.add(fo.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:i,lockup:s}=e;return t.add(this.initialize({stakePubkey:r,authorized:i,lockup:s}))}static createAccount(e){const t=new Wr;t.add(fo.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:i,lockup:s}=e;return t.add(this.initialize({stakePubkey:r,authorized:i,lockup:s}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:r,votePubkey:i}=e,s=ko.Delegate,o=qr(s);return new Wr().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!1},{pubkey:bf,isSigner:!1,isWritable:!1},{pubkey:E6,isSigner:!1,isWritable:!1},{pubkey:aie,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorize(e){const{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:i,stakeAuthorizationType:s,custodianPubkey:o}=e,a=ko.Authorize,c=qr(a,{newAuthorized:xr(i.toBuffer()),stakeAuthorizationType:s.index}),u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:bf,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&u.push({pubkey:o,isSigner:!0,isWritable:!1}),new Wr().add({keys:u,programId:this.programId,data:c})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:r,authoritySeed:i,authorityOwner:s,newAuthorizedPubkey:o,stakeAuthorizationType:a,custodianPubkey:c}=e,u=ko.AuthorizeWithSeed,d=qr(u,{newAuthorized:xr(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:i,authorityOwner:xr(s.toBuffer())}),f=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:bf,isSigner:!1,isWritable:!1}];return c&&f.push({pubkey:c,isSigner:!0,isWritable:!1}),new Wr().add({keys:f,programId:this.programId,data:d})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:i,lamports:s}=e,o=ko.Split,a=qr(o,{lamports:s});return new Ni({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static split(e,t){const r=new Wr;return r.add(fo.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space
vendor: 1,608 bytes, line 1011
1011:this.space,programId:this.programId})),r.add(this.splitInstruction(e))}static splitWithSeed(e,t){const{stakePubkey:r,authorizedPubkey:i,splitStakePubkey:s,basePubkey:o,seed:a,lamports:c}=e,u=new Wr;return u.add(fo.allocate({accountPubkey:s,basePubkey:o,seed:a,space:this.space,programId:this.programId})),t&&t>0&&u.add(fo.transfer({fromPubkey:e.authorizedPubkey,toPubkey:s,lamports:t})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:i,splitStakePubkey:s,lamports:c}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:i}=e,s=ko.Merge,o=qr(s);return new Wr().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:bf,isSigner:!1,isWritable:!1},{pubkey:E6,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:r,toPubkey:i,lamports:s,custodianPubkey:o}=e,a=ko.Withdraw,c=qr(a,{lamports:s}),u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:bf,isSigner:!1,isWritable:!1},{pubkey:E6,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&u.push({pubkey:o,isSigner:!0,isWritable:!1}),new Wr().add({keys:u,programId:this.programId,data:c})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:r}=e,i=ko.Deactivate,s=qr(i);return new Wr().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:bf,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}}yR.programId=new bt("Stake11111111111111111111111111111111111111");yR.space=200;
1011class lie{constructor(e,t,r,i){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=t,this.authorizedWithdrawer=r,this.commission=i}}class TOe{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const r=ie.u32("instruction").decode(e.data);let i;for(const[s,o]of Object.entries(Af))if(o.index==r){i=s;break}if(!i)throw new Error("Instruction type incorrect; not a VoteInstruction");return i}static decodeInitializeAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);const{voteInit:t}=vi(Af.InitializeAccount,e.data);return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new lie(new bt(t.nodePubkey),new bt(t.authorizedVoter),new bt(t.authorizedWithdrawer),t.commission)}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,voteAuthorizationType:r}=vi(Af.Authorize,e.data);return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new bt(t),voteAuthorizationType:{index:r}}}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:t,currentAuthorityDerivedKeySeed:r,newAuthorized:i,voteAuthorizationType:s}}=vi(Af.AuthorizeWithSeed,e.data);return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new bt(t),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new bt(i),voteAuthorizationType:{index:s},votePubkey:e.keys[0].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=vi(Af.Withdraw,e.data);return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:t,toPubkey:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(oE.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(e,t){if(e.length<t)throw new Error(`invalid instruction; found ${e.length} keys, expected at least ${t}`)}}const Af=Object.freeze({InitializeAccount:{index:0,layout:ie.struct([ie.u32("instruction"),kMe()])},Authorize:{index:1,layout:ie.struct([ie.u32("instruction"),Pr("newAuthorized"),ie.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:ie.struct([ie.u32("instruction"),ie.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:ie.struct([ie.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:ie.struct([ie.u32("instruction"),OMe()])}}),IOe=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class oE{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:r,voteInit:i}=e,s=Af.InitializeAccount,o=qr(s,{voteInit:{nodePubkey:xr(i.nodePubkey.toBuffer()),authorizedVoter:xr(i.authorizedVoter.toBuffer()),authorizedWithdrawer:xr(i.authorizedWithdrawer.toBuffer()),commission:i.commission}}),a={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Sx,isSigner:!1,isWritable:!1},{pubkey:bf,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o};return new Ni(a)}static createAccount(e){const t=new Wr;return t.add(fo.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:i,voteAuthorizationType:s}=e,o=Af.Authorize,a=qr(o,{newAuthorized:xr(i.toBuffer()),voteAuthorizationType:s.index}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:bf,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new Wr().add({keys:c,programId:this.programId,data:a})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:i,newAuthorizedPubkey:s,voteAuthorizationType:o,votePubkey:a}=e,c=Af.AuthorizeWithSeed,u=qr(c,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:xr(r.toBuffer()),currentAuthorityDerivedKeySeed:i,newAuthorized:xr(s.toBuffer()),voteAuthorizationType:o.index}}),d=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:bf,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return new Wr().add({keys:d,programId:this.programId,data:u})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:i,toPubkey:s}=e,o=Af.Withdraw,a=qr(o,{lamports:i}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return new Wr().add({keys:c,programId:this.programId,data:a})}static safeWithdraw(e,t,r){if(e.lamports>t-r)throw new Error("Withdraw will leave vote account with insufficient funds.");return oE.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,nodePubkey:i}=e,s=Af.UpdateValidatorIdentity,o=qr(s),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return new Wr().add({keys:a,programId:this.programId,data:o})}}oE.programId=new bt("Vote111111111111111111111111111111111111111");oE.space=3762;const uie=new bt("Va1idator1nfo111111111111111111111111111111"),NOe=Tt({name:$t(),website:Ln($t()),details:Ln($t()),iconUrl:Ln($t()),keybaseUsername:Ln($t())});class vU{constructor(e,t){this.key=void 0,this.info=void 0,this.key=e,this.info=t}static fromConfigData(e){let t=[...e];if(sl(t)!==2)return null;const i=[];for(let s=0;s<2;s++){const o=new bt(ol(t,0,Rf)),a=xf(t)===1;i.push({publicKey:o,isSigner:a})}if(i[0].publicKey.equals(uie)&&i[1].isSigner){const s=Ly().decode(Ot.from(t)),o=JSON.parse(s);return Dre(o,NOe),new vU(i[1].publicKey,o)}return null}}const ROe=new bt("Vote111111111111111111111111111111111111111"),MOe=ie.struct([Pr("nodePubkey"),Pr("authorizedWithdrawer"),ie.u8("commission"),ie.nu64(),ie.seq(ie.struct([ie.nu64("slot"),ie.u32("confirmationCount")]),ie.offset(ie.u32(),-8),"votes"),ie.u8("rootSlotValid"),ie.nu64("rootSlot"),ie.nu64(),ie.seq(ie.struct([ie.nu64("epoch"),Pr("authorizedVoter")]),ie.offset(ie.u32(),-8),"authorizedVoters"),ie.struct([ie.seq(ie.struct([Pr("authorizedPubkey"),ie.nu64("epochOfLastAuthorizedSwitch"),ie.nu64("targetEpoch")]),32,"buf"),ie.nu64("idx"),ie.u8("isEmpty")],"priorVoters"),ie.nu64(),ie.seq(ie.struct([ie.nu64("epoch"),ie.nu64("credits"),ie.nu64("prevCredits")]),ie.offset(ie.u32(),-8),"epochCredits"),ie.struct([ie.nu64("slot"),ie.nu64("timestamp")],"lastTimestamp")]);class xU{constructor(e){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}static fromAccountData(e){const r=MOe.decode(xr(e),4);let i=r.rootSlot;return r.rootSlotValid||(i=null),new xU({nodePubkey:new bt(r.nodePubkey),authorizedWithdrawer:new bt(r.authorizedWithdrawer),commission:r.commission,votes:r.votes,rootSlot:i,authorizedVoters:r.authorizedVoters.map(kOe),priorVoters:OOe(r.priorVoters),epochCredits:r.epochCredits,lastTimestamp:r.lastTimestamp})}}function kOe({authorizedVoter:n,epoch:e}){return{epoch:e,authorizedVoter:new bt(n)}}function Pq({authorizedPubkey:n,epochOfLastAuthorizedSwitch:e,targetEpoch:t}){return{authorizedPubkey:new bt(n),epochOfLastAuthorizedSwitch:e,targetEpoch:t}}function OOe({buf:n,idx:e,isEmpty:t}){return t?[]:[...n.slice(e+1).map(Pq),...n.slice(0,e).map(Pq)]}const Dq={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function POe(n,e){const t=e===!1?"http":"https";if(!n)return Dq[t].devnet;const r=Dq[t][n];if(!r)throw new Error(`Unknown ${t} cluster: ${n}`);return r}async function DOe(n,e,t,r){let i,s;t&&Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")||t&&Object.prototype.hasOwnProperty.call(t,"nonceValue")?(i=t,s=r):s=t;const o=s&&{skipPreflight:s.skipPreflight,preflightCommitment:s.preflightCommitment||s.commitment,minContextSlot:s.minContextSlot},a=await n.sendRawTransaction(e,o),c=s&&s.commitment,d=(await(i?n.confirmTransaction(i,c):n.confirmTransaction(a,c))).value;if(d.err)throw a!=null?new W_({action:o!=null&&o.skipPreflight?"send":"simulate",signature:a,transactionMessage:`Status: (${JSON.stringify(d)})`}):new Error(`Raw transaction ${a} failed (${JSON.stringify(d)})`);return a}const Zp=1e9,BOe=Object.freeze(Object.defineProperty({__proto__:null,Account:TMe,AddressLookupTableAccount:eB,AddressLookupTableInstruction:vOe,AddressLookupTableProgram:yU,Authorized:cie,BLOCKHASH_CACHE_TIMEOUT_MS:Zre,BPF_LOADER_DEPRECATED_PROGRAM_ID:IMe,BPF_LOADER_PROGRAM_ID:qMe,BpfLoader:KMe,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:Ef,ComputeBudgetInstruction:xOe,ComputeBudgetProgram:bU,Connection:mR,Ed25519Program:wR,Enum:_Me,EpochSchedule:Yre,FeeCalculatorLayout:qre,Keypair:Q2,LAMPORTS_PER_SOL:Zp,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:Gp,Loader:y1,Lockup:e4,MAX_SEED_LENGTH:Fre,Message:rh,MessageAccountKeys:F_,MessageV0:m1,NONCE_ACCOUNT_LENGTH:J7,NonceAccount:fR,PACKET_DATA_SIZE:l0,PUBLIC_KEY_LENGTH:Rf,PublicKey:bt,SIGNATURE_LENGTH_IN_BYTES:Ax,SOLANA_SCHEMA:NS,STAKE_CONFIG_ID:aie,STAKE_INSTRUCTION_LAYOUTS:ko,SYSTEM_INSTRUCTION_LAYOUTS:Xi,SYSVAR_CLOCK_PUBKEY:bf,SYSVAR_EPOCH_SCHEDULE_PUBKEY:$Me,SYSVAR_INSTRUCTIONS_PUBKEY:UMe,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:x6,SYSVAR_RENT_PUBKEY:Sx,SYSVAR_REWARDS_PUBKEY:jMe,SYSVAR_SLOT_HASHES_PUBKEY:zMe,SYSVAR_SLOT_HISTORY_PUBKEY:FMe,SYSVAR_STAKE_HISTORY_PUBKEY:E6,Secp256k1Program:X2,SendTransactionError:W_,SolanaJSONRPCError:Nn,SolanaJSONRPCErrorCode:WMe,StakeAuthorizationLayout:COe,StakeInstru
1011ction:_Oe,StakeProgram:yR,Struct:dU,SystemInstruction:HMe,SystemProgram:fo,Transaction:Wr,TransactionExpiredBlockheightExceededError:hU,TransactionExpiredNonceInvalidError:R2,TransactionExpiredTimeoutError:fU,TransactionInstruction:Ni,TransactionMessage:pU,TransactionStatus:Fp,VALIDATOR_INFO_KEY:uie,VERSION_PREFIX_MASK:uR,VOTE_PROGRAM_ID:ROe,ValidatorInfo:vU,VersionedMessage:hR,VersionedTransaction:w1,VoteAccount:xU,VoteAuthorizationLayout:IOe,VoteInit:lie,VoteInstruction:TOe,VoteProgram:oE,clusterApiUrl:POe,sendAndConfirmRawTransaction:DOe,sendAndConfirmTransaction:X7},Symbol.toStringTag,{value:"Module"})),$d={UNIVERSAL_PROVIDER_RELAY_URL:"wss://relay.walletconnect.org",HASH_PREFIX:"SPL Name Service",ROOT_DOMAIN_ACCOUNT:new bt("58PwtjSDuFHuUkYjH9BYnnQKHfwo9reZhC2zMJv9JPkx"),NAME_PROGRAM_ID:new bt("namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX"),REVERSE_LOOKUP_CLASS:new bt("33m47vH6Eav6jr5Ry86XjhRft2jRBLDnDgPSHoquXi2Z"),DEFAULT_CHAIN:{id:"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",caipNetworkId:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",name:"Solana",chainNamespace:Be.CHAIN.SOLANA,nativeCurrency:{name:"Solana",decimals:9,symbol:"SOL"},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},rpcUrls:{default:{http:[`${Be.BLOCKCHAIN_API_RPC_URL}/v1`]}}},CHAIN_IDS:{Mainnet:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",Devnet:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",Testnet:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",Deprecated_Mainnet:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",Deprecated_Devnet:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"},LAMPORTS_PER_SOL:1e9},cP={UNIT_PRICE_MICRO_LAMPORTS:2e7,UNIT_LIMIT_TRANSFER_ONLY:3e5,UNIT_LIMIT_WITH_ATA_CREATION:4e5};let bR=class extends Error{constructor(e,t){super(e),this.error=t}},LOe=class extends bR{constructor(){super(...arguments),this.name="WalletAccountError"}},$Oe=class extends bR{constructor(){super(...arguments),this.name="WalletSendTransactionError"}},Bq=class extends bR{constructor(){super(...arguments),this.name="WalletSignTransactionError"}},UOe=class extends bR{constructor(){super(...arguments),this.name="WalletSignMessageError"}};function Xy(n){return"version"in n}const Fd="solana:signAndSendTransaction",lP="solana:signIn",Ey="solana:signMessage",qs="solana:signTransaction",t4="standard:connect",NN="standard:disconnect",n4="standard:events";function jOe(n){return t4 in n.features&&n4 in n.features&&(Fd in n.features||qs in n.features)}function zOe(n){if(typeof n=="string")return`solana:${n}`}class vR{constructor(){this.listeners={accountsChanged:[],chainChanged:[],connect:[],disconnect:[],pendingTransaction:[],auth_rpcRequest:[],auth_rpcSuccess:[],auth_rpcError:[]}}on(e,t){this.listeners[e].push(t)}removeListener(e,t){this.listeners[e]=this.listeners[e].filter(r=>r!==t)}emit(e,t){this.listeners[e].forEach(r=>r(t))}}class FOe extends vR{constructor(e){super(),this.id=Be.CONNECTOR_ID.AUTH,this.name=Be.CONNECTOR_NAMES.AUTH,this.type="AUTH",this.chain=Be.CHAIN.SOLANA,this.provider=e.w3mFrameProvider,this.requestedChains=e.chains,this.getActiveChain=e.getActiveChain}get publicKey(){var t,r;const e=(r=(t=ue.state.chains.get(Be.CHAIN.SOLANA))==null?void 0:t.accountState)==null?void 0:r.address;return e?new Fn(e):void 0}get chains(){const e=this.provider.getAvailableChainIds();return this.requestedChains.filter(t=>e.includes(t.caipNetworkId))}async connect(e={}){var i;const t=e.chainId||((i=this.getActiveChain())==null?void 0:i.id),r=Xs("solana");if(await al.authConnectorAuthenticate({authConnector:this.provider,chainId:zOe(t),socialUri:e.socialUri,preferredAccountType:r,chainNamespace:Be.CHAIN.SOLANA}),!this.publicKey)throw new Error("Failed to connect to the wallet");return this.emit("connect",this.publicKey),this.publicKey.toBase58()}async disconnect(){await this.provider.disconnect(),this.emit("disconnect",void 0)}async signMessage(e){if(!this.publicKey)throw new Error("Wallet not connected");const t=await this.provider.request({method:"solana_signMessage",params:{message:Os.encode(e),pubkey:this.publicKey.toBase58()},chainNamespace:this.chain});return Os.decode(t.signature)}async signTransaction(e){const t=await this.provider.request({method:"solana_signTransaction",params:{transaction:this.serializeTransaction(e)},chainNamespace:this.chain}),r=Os.decode(t.transaction);return Xy(e)?vx.deserialize(r):cl.from(r)}async signAndSendTransaction(e,t){const r=this.serializeTransaction(e);return(await this.provider.request({method:"solana_signAndSendTransaction",params:{transaction:r,options:t},chainNamespace:this.chain})).signature}async sendTransaction(e,t,r){const i=await this.signTransaction(e);return await t.sendRawTransaction(i.serialize(),r)}async signAllTransactions(e){return(await this.provider.request({method:"solana_signAllTransactions",params:{transactions:e.map(r=>this.serializeTransaction(r))},chainNamespace:this.chain})).transactions.map((r,i)=>{const s=e[i];if(!s)throw new Error("Invalid solana_signAllTransactions response");const o=Os.decode(r);return Xy(s)?vx.deserialize(o):cl.from(o)})}async request(e){return this.provider.request({method:e.method,params:e.params,chainNamespace:this.chain})}async getAccounts(){return this.publicKey?Promise.resolve([{namespace:this.chain,address:this.publicKey.toBase58(),type:"eoa"}]):Promise.resolve([])}
1011serializeTransaction(e){return Os.encode(new Uint8Array(e.serialize({verifySignatures:!1})))}}class WOe extends vR{constructor(e){super(),this.name="Coinbase Wallet",this.id=Tf.ConnectorExplorerIds[Be.CONNECTOR_ID.COINBASE_SDK],this.explorerId=Tf.ConnectorExplorerIds[Be.CONNECTOR_ID.COINBASE_SDK],this.type="ANNOUNCED",this.imageUrl="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSI1MTIiIGN5PSI1MTIiIHI9IjUxMiIgZmlsbD0iIzAwNTJGRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1MiA1MTJDMTUyIDcxMC44MjMgMzEzLjE3NyA4NzIgNTEyIDg3MkM3MTAuODIzIDg3MiA4NzIgNzEwLjgyMyA4NzIgNTEyQzg3MiAzMTMuMTc3IDcxMC44MjMgMTUyIDUxMiAxNTJDMzEzLjE3NyAxNTIgMTUyIDMxMy4xNzcgMTUyIDUxMlpNNDIwIDM5NkM0MDYuNzQ1IDM5NiAzOTYgNDA2Ljc0NSAzOTYgNDIwVjYwNEMzOTYgNjE3LjI1NSA0MDYuNzQ1IDYyOCA0MjAgNjI4SDYwNEM2MTcuMjU1IDYyOCA2MjggNjE3LjI1NSA2MjggNjA0VjQyMEM2MjggNDA2Ljc0NSA2MTcuMjU1IDM5NiA2MDQgMzk2SDQyMFoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=",this.chain=Be.CHAIN.SOLANA,this.provider=this,this.coinbase=e.provider,this.requestedChains=e.chains}get chains(){return this.requestedChains.filter(e=>e.id===$_.id)}get publicKey(){return this.coinbase.publicKey}get imageId(){return Tf.ConnectorImageIds[Be.CONNECTOR_ID.COINBASE]}async connect(){try{await this.coinbase.connect();const e=this.getAccount(!0);return this.coinbase.emit("connect",this.coinbase.publicKey),this.emit("connect",e),e.toBase58()}catch(e){throw this.coinbase.emit("error",e),e}}async disconnect(){await this.coinbase.disconnect(),this.coinbase.emit("disconnect",void 0),this.emit("disconnect",void 0)}async signMessage(e){return(await this.coinbase.signMessage(e)).signature}async signTransaction(e){return this.coinbase.signTransaction(e)}async signAndSendTransaction(e,t){return(await this.coinbase.signAndSendTransaction(e,t)).signature}async sendTransaction(e,t,r){const i=await this.signTransaction(e);return await t.sendRawTransaction(i.serialize(),r)}async signAllTransactions(e){return await this.coinbase.signAllTransactions(e)}async request(e){return Promise.reject(new Error('The "request" method is not supported on Coinbase Wallet'))}async getAccounts(){const e=this.getAccount();return e?Promise.resolve([{namespace:this.chain,address:e.toBase58(),type:"eoa"}]):Promise.resolve([])}getAccount(e){const t=this.coinbase.publicKey;if(e&&!t)throw new Error("Not connected");return t}}class Lq extends Error{constructor(e){super(`The wallet does not support the "${e}" feature`)}}class $q extends Error{constructor(e){super(`The method "${e}" is not supported by the wallet`)}}var HOe=function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},iB;class Uq extends W${constructor({provider:e,chains:t,getActiveChain:r}){super({caipNetworks:t,namespace:"solana",provider:e}),this.eventEmitter=new vR,this.emit=this.eventEmitter.emit.bind(this.eventEmitter),this.on=this.eventEmitter.on.bind(this.eventEmitter),this.removeListener=this.eventEmitter.removeListener.bind(this.eventEmitter),iB.set(this,"1.0.0"),this.getActiveChain=r}get session(){return this.provider.session}get chains(){return this.sessionChains.map(e=>{let t=e;return t===$d.CHAIN_IDS.Deprecated_Mainnet?t=$d.CHAIN_IDS.Mainnet:t===$d.CHAIN_IDS.Deprecated_Devnet&&(t=$d.CHAIN_IDS.Devnet),this.caipNetworks.find(r=>r.caipNetworkId===t)}).filter(Boolean)}get icon(){return bo.state.connectorImages[this.id]}get version(){return HOe(this,iB,"f")}get publicKey(){const e=this.getAccount(!1);if(e)return new Fn(e.publicKey)}async connect(){await super.connectWalletConnect();const e=this.getAccount(!0);return this.emit("connect",new Fn(e.publicKey)),e.address}async disconnect(){await super.disconnect(),this.emit("disconnect",void 0)}async signMessage(e){this.checkIfMethodIsSupported("solana_signMessage");
1011const t=await this.internalRequest("solana_signMessage",{message:Os.encode(e),pubkey:this.getAccount(!0).address});return Os.decode(t.signature)}async signTransaction(e){this.checkIfMethodIsSupported("solana_signTransaction");const t=this.serializeTransaction(e),r=await this.internalRequest("solana_signTransaction",{transaction:t,pubkey:this.getAccount(!0).address,...this.getRawRPCParams(e)});if("signature"in r){const s=Os.decode(r.signature);return e.addSignature(new Fn(this.getAccount(!0).publicKey),pn.from(s)),e}const i=pn.from(r.transaction,"base64");return Xy(e)?vx.deserialize(new Uint8Array(i)):cl.from(i)}async signAndSendTransaction(e,t){this.checkIfMethodIsSupported("solana_signAndSendTransaction");const r=this.serializeTransaction(e),i=await this.internalRequest("solana_signAndSendTransaction",{transaction:r,pubkey:this.getAccount(!0).address,sendOptions:t});return this.emit("pendingTransaction",void 0),i.signature}async sendTransaction(e,t,r){const i=await this.signTransaction(e),s=await t.sendRawTransaction(i.serialize(),r);return this.emit("pendingTransaction",void 0),s}async signAllTransactions(e){try{return this.checkIfMethodIsSupported("solana_signAllTransactions"),(await this.internalRequest("solana_signAllTransactions",{transactions:e.map(r=>this.serializeTransaction(r))})).transactions.map((r,i)=>{const s=e[i];if(!s)throw new Error("Invalid transactions response");const o=pn.from(r,"base64");return Xy(s)?vx.deserialize(new Uint8Array(o)):(this.emit("pendingTransaction",void 0),cl.from(o))})}catch(t){if(t instanceof $q){const r=[];for(const i of e)r.push(await this.signTransaction(i));return r}throw t}}request(e){return this.internalRequest(e.method,e.params)}async getAccounts(){var t,r;const e=((r=(t=this.session)==null?void 0:t.namespaces.solana)==null?void 0:r.accounts)||[];return Promise.resolve(e.map(i=>({namespace:this.chain,address:Ha.parseCaipAddress(i).address,type:"eoa"})))}internalRequest(e,t){var s;const r=this.chains.find(o=>{var a;return((a=this.getActiveChain())==null?void 0:a.id)===o.id});let i=r==null?void 0:r.caipNetworkId;switch(i){case $d.CHAIN_IDS.Mainnet:this.sessionChains.includes($d.CHAIN_IDS.Mainnet)||(i=$d.CHAIN_IDS.Deprecated_Mainnet);break;case $d.CHAIN_IDS.Devnet:this.sessionChains.includes($d.CHAIN_IDS.Devnet)||(i=$d.CHAIN_IDS.Deprecated_Devnet);break}return(s=this.provider)==null?void 0:s.request({method:e,params:t},i)}get sessionChains(){var e;return Jd.getChainsFromNamespaces((e=this.session)==null?void 0:e.namespaces)}serializeTransaction(e){return pn.from(new Uint8Array(e.serialize({verifySignatures:!1}))).toString("base64")}getAccount(e){var i,s;const t=(s=(i=this.session)==null?void 0:i.namespaces.solana)==null?void 0:s.accounts[0];if(!t){if(e)throw new Error("Account not found");return}const r=t.split(":")[2];if(!r){if(e)throw new Error("Address not found");return}return{address:r,publicKey:Os.decode(r)}}getRawRPCParams(e){var t;return Xy(e)?{}
1011:{feePayer:((t=e.feePayer)==null?void 0:t.toBase58())??"",instructions:e.instructions.map(r=>({data:Os.encode(new Uint8Array(r.data)),keys:r.keys.map(i=>({isWritable:i.isWritable,isSigner:i.isSigner,pubkey:i.pubkey.toBase58()})),programId:r.programId.toBase58()})),recentBlockhash:e.recentBlockhash??""}}checkIfMethodIsSupported(e){var t,r;if(!((r=(t=this.session)==null?void 0:t.namespaces.solana)!=null&&r.methods.includes(e)))throw new $q(e)}}iB=new WeakMap;const VOe={},qOe=(n,e)=>{const t=X.useRef(void 0);X.useEffect(()=>{t.current=nue(n,e)}),X.useDebugValue(t.current)},KOe=qOe,YOe=new WeakMap;function sB(n,e){const r=X.useMemo(()=>n&&new WeakMap,[n]),i=X.useRef(void 0);let s=!0;const o=X.useSyncExternalStore(X.useCallback(c=>{const u=Qs(n,c);return c(),u},[n,void 0]),()=>{const c=r1(n);try{if(!s&&i.current&&!RX(i.current,c,r,new WeakMap))return i.current}catch{}return c},()=>r1(n));s=!1,X.useLayoutEffect(()=>{i.current=o}),(VOe?"production":void 0)!=="production"&&KOe(o,r);const a=X.useMemo(()=>new WeakMap,[]);return NX(o,r,a,YOe)}const MA=Mi({connection:null}),u2={state:MA,subscribeKey(n,e){return Eo(MA,n,e)},subscribe(n){return Qs(MA,()=>n(MA))},setConnection(n){MA.connection=d0(n)}},Sg=new bt("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");new bt("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");const EU=new bt("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");new bt("So11111111111111111111111111111111111111112");new bt("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");const AU=n=>{const e=n.decode.bind(n),t=n.encode.bind(n);return{decode:e,encode:t}};var sy={},jq;function GOe(){if(jq)return sy;jq=1,Object.defineProperty(sy,"__esModule",{value:!0});function n(i){{const s=pn.from(i);s.reverse();const o=s.toString("hex");return o.length===0?BigInt(0):BigInt(`0x${o}`)}}sy.toBigIntLE=n;function e(i){{const s=i.toString("hex");return s.length===0?BigInt(0):BigInt(`0x${s}`)}}sy.toBigIntBE=e;function t(i,s){{const o=i.toString(16),a=pn.from(o.padStart(s*2,"0").slice(0,s*2),"hex");return a.reverse(),a}}sy.toBufferLE=t;function r(i,s){{const o=i.toString(16);return pn.from(o.padStart(s*2,"0").slice(0,s*2),"hex")}}return sy.toBufferBE=r,sy}var zq=GOe();const ZOe=n=>e=>{const t=ie.blob(n,e),{encode:r,decode:i}=AU(t),s=t;return s.decode=(o,a)=>{const c=i(o,a);return zq.toBigIntLE(pn.from(c))},s.encode=(o,a,c)=>{const u=zq.toBufferLE(o,n);return r(u,a,c)},s},RS=ZOe(8),die=n=>{const e=ie.u8(n),{encode:t,decode:r}=AU(e),i=e;return i.decode=(s,o)=>!!r(s,o),i.encode=(s,o,a)=>{const c=Number(s);return t(c,o,a)},i},Jo=n=>{const e=ie.blob(32,n),{encode:t,decode:r}=AU(e),i=e;return i.decode=(s,o)=>{const a=r(s,o);return new bt(a)},i.encode=(s,o,a)=>{const c=s.toBuffer();return t(c,o,a)},i};class aE extends Error{constructor(e){super(e)}}class RN extends aE{constructor(){super(...arguments),this.name="TokenAccountNotFoundError"}}class QOe extends aE{constructor(){super(...arguments),this.name="TokenInvalidAccountError"}}class hie extends aE{constructor(){super(...arguments),this.name="TokenInvalidAccountOwnerError"}}class MS extends aE{constructor(){super(...arguments),this.name="TokenInvalidAccountSizeError"}}class XOe extends aE{constructor(){super(...arguments),this.name="TokenInvalidMintError"}}class JOe extends aE{constructor(){super(...arguments),this.name="TokenOwnerOffCurveError"}}var oB;(function(n){n[n.InitializeMint=0]="InitializeMint",n[n.InitializeAccount=1]="InitializeAccount",n[n.InitializeMultisig=2]="InitializeMultisig",n[n.Transfer=3]="Transfer",n[n.Approve=4]="Approve",n[n.Revoke=5]="Revoke",n[n.SetAuthority=6]="SetAuthority",n[n.MintTo=7]="MintTo",n[n.Burn=8]="Burn",n[n.CloseAccount=9]="CloseAccount",n[n.FreezeAccount=10]="FreezeAccount",n[n.ThawAccount=11]="ThawAccount",n[n.TransferChecked=12]="TransferChecked",n[n.ApproveChecked=13]="ApproveChecked",n[n.MintToChecked=14]="MintToChecked",n[n.BurnChecked=15]="BurnChecked",n[n.InitializeAccount2=16]="InitializeAccount2",n[n.SyncNative=17]="SyncNative",n[n.InitializeAccount3=18]="InitializeAccount3",n[n.InitializeMultisig2=19]="InitializeMultisig2",n[n.InitializeMint2=20]="InitializeMint2",n[n.GetAccountDataSize=21]="GetAccountDataSize",n[n.InitializeImmutableOwner=22]="InitializeImmutableOwner",n[n.AmountToUiAmount=23]="Amou
1011ntToUiAmount",n[n.UiAmountToAmount=24]="UiAmountToAmount",n[n.InitializeMintCloseAuthority=25]="InitializeMintCloseAuthority",n[n.TransferFeeExtension=26]="TransferFeeExtension",n[n.ConfidentialTransferExtension=27]="ConfidentialTransferExtension",n[n.DefaultAccountStateExtension=28]="DefaultAccountStateExtension",n[n.Reallocate=29]="Reallocate",n[n.MemoTransferExtension=30]="MemoTransferExtension",n[n.CreateNativeMint=31]="CreateNativeMint",n[n.InitializeNonTransferableMint=32]="InitializeNonTransferableMint",n[n.InterestBearingMintExtension=33]="InterestBearingMintExtension",n[n.CpiGuardExtension=34]="CpiGuardExtension",n[n.InitializePermanentDelegate=35]="InitializePermanentDelegate",n[n.TransferHookExtension=36]="TransferHookExtension",n[n.MetadataPointerExtension=39]="MetadataPointerExtension",n[n.GroupPointerExtension=40]="GroupPointerExtension",n[n.GroupMemberPointerExtension=41]="GroupMemberPointerExtension",n[n.ScaledUiAmountExtension=43]="ScaledUiAmountExtension",n[n.PausableExtension=44]="PausableExtension"})(oB||(oB={}));var MN;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Mint=1]="Mint",n[n.Account=2]="Account"})(MN||(MN={}));const fie=1,ePe=ie.struct([ie.u8("m"),ie.u8("n"),die("isInitialized"),Jo("signer1"),Jo("signer2"),Jo("signer3"),Jo("signer4"),Jo("signer5"),Jo("signer6"),Jo("signer7"),Jo("signer8"),Jo("signer9"),Jo("signer10"),Jo("signer11")]),pie=ePe.span;var kN;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initialized=1]="Initialized",n[n.Frozen=2]="Frozen"})(kN||(kN={}));const gie=ie.struct([Jo("mint"),Jo("owner"),RS("amount"),ie.u32("delegateOption"),Jo("delegate"),ie.u8("state"),ie.u32("isNativeOption"),RS("isNative"),RS("delegatedAmount"),ie.u32("closeAuthorityOption"),Jo("closeAuthority")]),Qm=gie.span;async function Fq(n,e,t,r=Sg){const i=await n.getAccountInfo(e,t);return tPe(e,i,r)}function tPe(n,e,t=Sg){if(!e)throw new RN;if(!e.owner.equals(t))throw new hie;if(e.data.length<Qm)throw new MS;const r=gie.decode(e.data.slice(0,Qm));let i=pn.alloc(0);if(e.data.length>Qm){if(e.data.length===pie)throw new MS;if(e.data[Qm]!=MN.Account)throw new QOe;i=e.data.slice(Qm+fie)}return{address:n,mint:r.mint,owner:r.owner,amount:r.amount,delegate:r.delegateOption?r.delegate:null,delegatedAmount:r.delegatedAmount,isInitialized:r.state!==kN.Uninitialized,isFrozen:r.state===kN.Frozen,isNative:!!r.isNativeOption,rentExemptReserve:r.isNativeOption?r.isNative:null,closeAuthority:r.closeAuthorityOption?r.closeAuthority:null,tlvData:i}}function nPe(n,e,t){if(t.length){n.push({pubkey:e,isSigner:!1,isWritable:!1});for(const r of t)n.push({pubkey:r instanceof bt?r:r.publicKey,isSigner:!0,isWritable:!1})}else n.push({pubkey:e,isSigner:!0,isWritable:!1});return n}const mie=ie.struct([ie.u32("mintAuthorityOption"),Jo("mintAuthority"),RS("supply"),ie.u8("decimals"),die("isInitialized"),ie.u32("freezeAuthorityOption"),Jo("freezeAuthority")]),uP=mie.span;async function rPe(n,e,t,r=Sg){const i=await n.getAccountInfo(e,t);return iPe(e,i,r)}function iPe(n,e,t=Sg){if(!e)throw new RN;if(!e.owner.equals(t))throw new hie;if(e.data.length<uP)throw new MS;const r=mie.decode(e.data.slice(0,uP));let i=pn.alloc(0);if(e.data.length>uP){if(e.data.length<=Qm)throw new MS;if(e.data.length===pie)throw new MS;if(e.data[Qm]!=MN.Mint)throw new XOe;i=e.data.slice(Qm+fie)}return{address:n,mintAuthority:r.mintAuthorityOption?r.mintAuthority:null,supply:r.supply,decimals:r.decimals,isInitialized:r.isInitialized,freezeAuthority:r.freezeAuthorityOption?r.freezeAuthority:null,tlvData:i}}function Wq(n,e,t=!1,r=Sg,i=EU){if(!t&&!bt.isOnCurve(e.toBuffer()))throw new JOe;const[s]=bt.findProgramAddressSync([e.toBuffer(),r.toBuffer(),n.toBuffer()],i);return s}function sPe(n,e,t,r,i=Sg,s=EU){return oPe(n,e,t,r,pn.alloc(0),i,s)}function oPe(n,e,t,r,i,s=Sg,o=EU){const a=[{pubkey:n,isSigner:!0,isWritable:!0},{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:fo.programId,isSigner:!1,isWritable:!1},{pubkey:s,isSigner:!1,isWritable:!1}];return new Ni({keys:a,programId:o,data:i})}const Hq=ie.struct([ie.u8("instruction"),RS("amount")]);function aPe(n,e,t,r,i=[],s=Sg){const o=nPe([{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:e,isSigner:!1,isWritable:!0}],t,i),a=pn.alloc(Hq.span);return Hq.encode({instruction:oB.Transfer,amount:BigInt(r)},a),new Ni({keys:o,programId:s,data:a})}async function cPe({provider:n,to:e,amount:t,tokenMint:r,connection:i}){if(!n.publicKey)throw new Error("No public key found");if(t<=0)throw new Error("Amount must be greater than 0");try{const s=n.publicKey,o=new Fn(e),a=new Fn(r),u=(await rPe(i,a)).decimals;if(u<0)throw new Error("Invalid token decimals");const d=Math.floor(t*10**u),f=Wq(a,s),m=Wq(a,o);try{if((await Fq(i,f)).amount<BigInt(d))throw new Error("Insufficient token balance")}catch(N){throw N instanceof RN?new Error("Sender does not have a token account for this mint"):N}let w=!1;try{await Fq(i,m)}catch(N){if(N instanceof RN)w=!0;else throw N}const y=[],b=w?cP.UNIT_LIMIT_WITH_ATA_CREATION:cP.UNIT_LIMIT_TRANSFER_ONLY;y.push(z_.setComputeUnitPrice({microLamports:cP.UNIT_PRICE_MICRO_LAMPORTS}),z_.setComputeUnitLimit({units:b})),w&&y.push(sPe(s,m,o,a)),y.push(aPe(f,m,s,d,[],Sg));const{blockhash:E,lastValidBlockHeight:T}=await i.getLatestBlockhash();return new cl({feePayer:s,blockhash:E,lastValidBlockHeight:T}).add(...y)}catch(s){throw new Error(`Failed to create SPL token transaction: ${s instanceof Error?s.message:"Unknown error"}`)}}const Vq={UNIT_PRICE_MICRO_LAMPORTS:2e7,UNIT_LIMIT:500};async function qq({provider:n,to:e,value:t,connection:r}){if(!n.publicKey)throw Error("No public key found");
1011const i=new Fn(e),s=Math.floor(t*iRe),{blockhash:o,lastValidBlockHeight:a}=await r.getLatestBlockhash(),c=[z_.setComputeUnitPrice({microLamports:Vq.UNIT_PRICE_MICRO_LAMPORTS}),z_.setComputeUnitLimit({units:Vq.UNIT_LIMIT}),nre.transfer({fromPubkey:n.publicKey,toPubkey:i,lamports:s})];return new cl({feePayer:n.publicKey,blockhash:o,lastValidBlockHeight:a}).add(...c)}var lPe=function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},uPe=function(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t},A6;let Hl;const xR=new Set;function dPe(n){kS=void 0,xR.add(n)}function hPe(n){kS=void 0,xR.delete(n)}const M2={};function SU(){if(Hl||(Hl=Object.freeze({register:Kq,get:fPe,on:pPe}),typeof window>"u"))return Hl;const n=Object.freeze({register:Kq});try{window.addEventListener("wallet-standard:register-wallet",({detail:e})=>e(n))}catch(e){console.error(`wallet-standard:register-wallet event listener could not be added 1012`,e)}try{window.dispatchEvent(new gPe(n))}catch(e){console.error(`wallet-standard:app-ready event could not be dispatched 1013`,e)}return Hl}function Kq(...n){var e;return n=n.filter(t=>!xR.has(t)),n.length?(n.forEach(t=>dPe(t)),(e=M2.register)==null||e.forEach(t=>aB(()=>t(...n))),function(){var r;n.forEach(i=>hPe(i)),(r=M2.unregister)==null||r.forEach(i=>aB(()=>i(...n)))}):()=>{}}let kS;function fPe(){return kS||(kS=[...xR]),kS}function pPe(n,e){var t;return(t=M2[n])!=null&&t.push(e)||(M2[n]=[e]),function(){var i;M2[n]=(i=M2[n])==null?void 0:i.filter(s=>e!==s)}}function aB(n){try{n()}catch(e){console.error(e)}}class gPe extends Event{get detail(){return lPe(this,A6,"f")}get type(){return"wallet-standard:app-ready"}constructor(e){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),A6.set(this,void 0),uPe(this,A6,e,"f")}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}A6=new WeakMap;function mPe(){if(Hl||(Hl=SU(),typeof window>"u"))return Hl;const n=window.navigator.wallets||[];if(!Array.isArray(n))return console.error("window.navigator.wallets is not an array"),Hl;const{register:e}=Hl,t=(...r)=>r.forEach(i=>aB(()=>i({register:e})));try{Object.defineProperty(window.navigator,"wallets",{value:Object.freeze({push:t})})}catch{return console.error("window.navigator.wallets could not be set"),Hl}return t(...n),Hl}function S6(n){switch(n){case"processed":case"confirmed":case"finalized":case void 0:return n;case"recent":return"processed";case"single":case"singleGossip":return"confirmed";case"max":case"root":return"finalized";default:return}}const cB="solana:mainnet",wie="solana:devnet",yie="solana:testnet",wPe="solana:localnet",yPe="https://api.mainnet-beta.solana.com";function bPe(n){return n.includes(yPe)?cB:/\bdevnet\b/i.test(n)?wie:/\btestnet\b/i.test(n)?yie:/\blocalhost\b/i.test(n)||/\b127\.0\.0\.1\b/.test(n)?wPe:cB}const Yq={"solana:mainnet":$_,"solana:testnet":YTe,"solana:devnet":U7};class vPe extends vR{constructor({wallet:e,getActiveChain:t,requestedChains:r}){super(),this.chain=Be.CHAIN.SOLANA,this.provider=this,this.wallet=e,this.getActiveChain=t,this.requestedChains=r,this.bindEvents()}get id(){const e=this.name;return Tf.ConnectorExplorerIds[e]||e}get name(){return this.wallet.name==="Trust"?"Trust Wallet":this.wallet.name}get type(){return"ANNOUNCED"}get explorerId(){return Tf.ConnectorExplorerIds[this.name]}get publicKey(){const e=this.getAccount(!1);if(e)return new Fn(e.publicKey)}get imageUrl(){return this.wallet.icon}get chains(){return this.wallet.chains.map(e=>this.requestedChains.find(t=>{var r;return t.id===e||t.id===((r=Yq[e])==null?void 0:r.id)}
1013)).filter(Boolean)}async connect(){await this.getWalletFeature(t4).connect();const t=this.getAccount(!0),r=new Fn(t.publicKey);return this.emit("connect",r),t.address}async disconnect(){await this.getWalletFeature(NN).disconnect(),this.emit("disconnect",void 0)}async signMessage(e){const t=this.getWalletFeature(Ey),r=this.getAccount(!0),[i]=await t.signMessage({message:e,account:r});if(!i)throw new UOe("Empty result");return i.signature}async signTransaction(e){const t=this.getWalletFeature(qs),r=this.getAccount(!0),i=this.serializeTransaction(e),[s]=await t.signTransaction({account:r,transaction:new Uint8Array(i),chain:this.getActiveChainName()});if(!s)throw new Bq("Empty result");return this.emit("pendingTransaction",void 0),Xy(e)?vx.deserialize(s.signedTransaction):cl.from(s.signedTransaction)}async signAndSendTransaction(e,t){const r=this.getWalletFeature(Fd),i=this.getAccount(!0),[s]=await r.signAndSendTransaction({account:i,transaction:new Uint8Array(this.serializeTransaction(e)),options:{...t,preflightCommitment:S6(t==null?void 0:t.preflightCommitment)},chain:this.getActiveChainName()});if(!s)throw new $Oe("Empty result");return this.emit("pendingTransaction",void 0),Os.encode(s.signature)}async sendTransaction(e,t,r){const i=await this.signTransaction(e);return await t.sendRawTransaction(i.serialize(),r)}async signAllTransactions(e){const t=this.getWalletFeature(qs),r=this.getAccount(!0),i=this.getActiveChainName();return(await t.signTransaction(...e.map(o=>({transaction:new Uint8Array(this.serializeTransaction(o)),account:r,chain:i})))).map(({signedTransaction:o},a)=>{const c=e[a];if(!c)throw new Bq("Invalid transaction signature response");return this.emit("pendingTransaction",void 0),Xy(c)?vx.deserialize(o):cl.from(o)})}async request(e){return Promise.reject(new Lq("request"))}async getAccounts(){return Promise.resolve(this.wallet.accounts.map(e=>({namespace:this.chain,address:e.address,type:"eoa"})))}serializeTransaction(e){return e.serialize({verifySignatures:!1})}getAccount(e){const t=this.wallet.accounts[0];if(e&&!t)throw new LOe;return t}getWalletFeature(e){if(!(e in this.wallet.features))throw new Lq(e);return this.wallet.features[e]}getActiveChainName(){const e=Object.entries(Yq).find(([,t])=>{var r;return t.id===((r=this.getActiveChain())==null?void 0:r.id)});if(!e)throw new Error("Invalid chain id");return e[0]}bindEvents(){this.getWalletFeature(n4).on("change",t=>{if(t.accounts){const r=t.accounts[0];r&&this.emit("accountsChanged",new Fn(r.publicKey))}})}}const{get:xPe,on:Gq}=SU();let Lm=[];function EPe(n,e,t){const r=[Gq("register",(...i)=>{Lm=[...Lm,...Zq(i,n,e)],t(...Lm)}),Gq("unregister",(...i)=>{Lm=Lm.filter(s=>i.some(o=>o.name===s.wallet.name)),t(...Lm)})];return Lm=Zq(xPe(),n,e),t(...Lm),()=>r.forEach(i=>i())}function Zq(n,e,t){return n.filter(r=>r.name!=="WalletConnect"&&jOe(r)).map(r=>new vPe({wallet:r,requestedChains:e,getActiveChain:t}))}const APe=[Be.CONNECTOR_ID.AUTH,Be.CONNECTOR_ID.WALLET_CONNECT];class SPe extends hne{constructor(e={}){super({adapterType:Be.ADAPTER_TYPES.SOLANA,namespace:Be.CHAIN.SOLANA}),this.balancePromises={},this.connectionSettings=e.connectionSettings||"confirmed",this.wallets=e.wallets,this.registerWalletStandard=e.registerWalletStandard}construct(e){var s,o;super.construct(e);const t=wt.getActiveCaipNetworkId(),r=((s=e.networks)==null?void 0:s.find(a=>a.caipNetworkId===t))||((o=e.networks)==null?void 0:o[0]),i=r==null?void 0:r.rpcUrls.default.http[0];i&&u2.setConnection(new NA(i,this.connectionSettings))}setAuthProvider(e){this.addConnector(new FOe({w3mFrameProvider:e,getActiveChain:()=>ue.getCaipNetworkByNamespace(this.namespace),chains:this.getCaipNetworks()}))}syncConnectors(e,t){e.projectId||Fs.open(Qo.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");const r=()=>t.getCaipNetwork(this.namespace);tt.isClient()&&"coinbaseSolana"in window&&this.addConnector(new WOe({provider:window.coinbaseSolana,chains:this.getCaipNetworks(),getActiveChain:r})),EPe(this.getCaipNetworks(),r,this.addConnector.bind(this))}async writeContract(){return Promise.resolve({hash:""})}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async walletGetAssets(e){return Promise.resolve({})}async getAccounts(e){const t=this.connectors.find(r=>r.id===e.id);return t?{accounts:await t.getAccounts()}:{accounts:[]}}async signMessage(e){const t=e.provider;if(!t)throw new Error("connectionControllerClient:signMessage - provider is undefined");const r=await t.signMessage(new TextEncoder().encode(e.message));return{signature:Os.encode(r)}}async estimateGas(e){const t=u2.state.connection;if(!t||!e.provider)throw new Error("Connection is not set");const i=await(await qq({provider:e.provider,connection:t,to:"11111111111111111111111111111111",value:1})).getEstimatedFee(t);return{gas:BigInt(i||0)}}async sendTransaction(e){const t=u2.state.connection;if(!t||!e.provider)throw new Error("Connection is not set");const r=e.provider,i=e.tokenMint?await cPe({provider:r,connection:t,to:e.to,amount:Number(e.value),tokenMint:e.tokenMint}):await qq({provider:r,connection:t,to:e.to,value:Number.isNaN(Number(e.value))?0:Number(e.value)}),s=await r.sendTransaction(i,t);return await new Promise(o=>{const a=setInterval(async()=>{const c=await t.getSignatureStatus(s);c!=null&&c.value&&(clearInterval(a),o())},1e3)}),{hash:s}}parseUnits(){return 0n}formatUnits(){return""}async connect(e){var u,d,f,m,w;const t=this.connectors.find(y=>y.id===e.id);if(!t)throw new Error("Provider not found");const r={...t,...e.id===Be.CONNECTOR_ID.AUTH?{provider:t}:{}},i=e.rpcUrl||((d=(u=this.getCaipNetworks())==null?void 0:u.find(y=>y.id===e.chainId))==null?void 0:d.rpcUrls.default.http[0]);if(!i)throw new Error(`RPC URL not found for chainId: ${e.chainId}`);const s=(f=this.connectionManager)==null?void 0:f.getConnection({address:e.address,connectorId:t.id,connections:this.connections,connectors:this.connectors});
1013if(s!=null&&s.account)return this.emit("accountChanged",{address:s.account.address,chainId:(m=s.caipNetwork)==null?void 0:m.id,connector:r}),{id:t.id,address:s.account.address,chainId:e.chainId,provider:t,type:t.type};const o=await t.connect({chainId:e.chainId,socialUri:e.socialUri});u2.setConnection(new NA(i,this.connectionSettings)),this.emit("accountChanged",{address:o,chainId:e.chainId,connector:r});const a=t.id===Be.CONNECTOR_ID.AUTH,c=(w=this.getCaipNetworks())==null?void 0:w.find(y=>y.id===e.chainId);return this.addConnection({connectorId:t.id,accounts:[{address:o}],caipNetwork:c,auth:a?{name:wt.getConnectedSocialProvider(),username:wt.getConnectedSocialUsername()}:void 0}),t.id!==Be.CONNECTOR_ID.WALLET_CONNECT&&this.listenSolanaProviderEvents(t.id,t.provider),{id:t.id,address:o,chainId:e.chainId,provider:t,type:t.type}}async getBalance(e){var c,u,d,f;const t=e.address,r=(c=this.getCaipNetworks())==null?void 0:c.find(m=>m.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"SOL"});const i=new NA((f=(d=(u=r==null?void 0:r.rpcUrls)==null?void 0:u.default)==null?void 0:d.http)==null?void 0:f[0],this.connectionSettings),s=`${r==null?void 0:r.caipNetworkId}:${e.address}`,o=this.balancePromises[s];if(o)return o;const a=wt.getNativeBalanceCacheForCaipAddress(s);return a?{balance:a.balance,symbol:a.symbol}:(this.balancePromises[s]=new Promise(async m=>{var w,y;try{const E=(await i.getBalance(new Fn(t))/$d.LAMPORTS_PER_SOL).toString();if(wt.updateNativeBalanceCache({caipAddress:s,balance:E,symbol:((w=e.caipNetwork)==null?void 0:w.nativeCurrency.symbol)||"SOL",timestamp:Date.now()}),!e.caipNetwork)throw new Error("caipNetwork is required");m({balance:E,symbol:(y=e.caipNetwork)==null?void 0:y.nativeCurrency.symbol})}catch{m({balance:"0.00",symbol:"SOL"})}}).finally(()=>{delete this.balancePromises[s]}),this.balancePromises[s]||{balance:"0.00",symbol:"SOL"})}async switchNetwork(e){var r,i,s;await super.switchNetwork(e);const{caipNetwork:t}=e;(s=(i=(r=t==null?void 0:t.rpcUrls)==null?void 0:r.default)==null?void 0:i.http)!=null&&s[0]&&u2.setConnection(new NA(t.rpcUrls.default.http[0],this.connectionSettings))}listenProviderEvents(){}listenSolanaProviderEvents(e,t){if(APe.includes(e))return;const r=s=>{this.onAccountsChanged([s.toBase58()],e,!1)},i=()=>this.onDisconnect(e);this.providerHandlers[e]||(t.on("disconnect",i),t.on("accountsChanged",r),t.on("connect",r),this.providerHandlers[e]={provider:t,disconnect:i,accountsChanged:r,chainChanged:()=>{}})}async setUniversalProvider(e){this.universalProvider=e;const t=Be.CONNECTOR_ID.WALLET_CONNECT;Jd.listenWcProvider({universalProvider:e,namespace:Be.CHAIN.SOLANA,onConnect:i=>this.onConnect(i,t),onDisconnect:()=>this.onDisconnect(t),onAccountsChanged:i=>this.onAccountsChanged(i,t,!1)});const r=new Uq({provider:e,chains:this.getCaipNetworks(),getActiveChain:()=>ue.getCaipNetworkByNamespace(this.namespace)});if(this.registerWalletStandard){const{SolanaWalletConnectStandardWallet:i}=await It(async()=>{const{SolanaWalletConnectStandardWallet:s}=await import("./wallet-standard-BiCzqmGh.js");return{SolanaWalletConnectStandardWallet:s}},[]);i.register(e)}return this.addConnector(r),Promise.resolve()}async connectWalletConnect(e){var s,o;const t=await super.connectWalletConnect(e),r=(o=(s=this.getCaipNetworks())==null?void 0:s.find(a=>a.id===e))==null?void 0:o.rpcUrls.default.http[0],i=new NA(r,this.connectionSettings);return u2.setConnection(i),t}async disconnect(e){if(e.id){const t=this.connectors.find(i=>i.id===e.id);if(!t)throw new Error("Provider not found");const r=this.connections.find(i=>xi.isLowerCaseMatch(i.connectorId,e.id));return await t.provider.disconnect(),this.deleteConnection(t.id),this.connections.length===0?this.emit("disconnect"):this.emitFirstAvailableConnection(),{connections:r?[r]:[]}}return this.disconnectAll()}async syncConnection(e){return this.connect({...e,type:""})}async syncConnections({connectToFirstConnector:e,caipNetwork:t,getConnectorStorageInfo:r}){var i;await((i=this.connectionManager)==null?void 0:i.syncConnections({connectors:this.connectors,caipNetwork:t,caipNetworks:this.getCaipNetworks(),universalProvider:this.universalProvider,onConnection:this.addConnection.bind(this),onListenProvi
1013der:this.listenSolanaProviderEvents.bind(this),getConnectionStatusInfo:r})),e&&this.emitFirstAvailableConnection()}getWalletConnectProvider(e){return new Uq({provider:e.provider,chains:e.caipNetworks,getActiveChain:()=>ue.getCaipNetworkByNamespace(this.namespace)})}async disconnectAll(){return{connections:await Promise.all(this.connections.map(async t=>{const r=this.connectors.find(i=>xi.isLowerCaseMatch(i.id,t.connectorId));if(!r)throw new Error("Connector not found");return await this.disconnect({id:r.id}),t}))}}}class eo extends Error{constructor(e,t){super(e),this.error=t}}class ih extends eo{constructor(){super(...arguments),this.name="WalletNotReadyError"}}class _Pe extends eo{constructor(){super(...arguments),this.name="WalletLoadError"}}class k2 extends eo{constructor(){super(...arguments),this.name="WalletConfigError"}}class w0 extends eo{constructor(){super(...arguments),this.name="WalletConnectionError"}}class eb extends eo{constructor(){super(...arguments),this.name="WalletDisconnectedError"}}class _g extends eo{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}class Xl extends eo{constructor(){super(...arguments),this.name="WalletAccountError"}}class sh extends eo{constructor(){super(...arguments),this.name="WalletPublicKeyError"}}class hr extends eo{constructor(){super(...arguments),this.name="WalletNotConnectedError"}}class Fu extends eo{constructor(){super(...arguments),this.name="WalletSendTransactionError"}}class ps extends eo{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}class tb extends eo{constructor(){super(...arguments),this.name="WalletSignMessageError"}}class Qq extends eo{constructor(){super(...arguments),this.name="WalletSignInError"}}var wn;(function(n){n.Installed="Installed",n.NotDetected="NotDetected",n.Loadable="Loadable",n.Unsupported="Unsupported"})(wn||(wn={}));class _U extends X${get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(e,t,r={}){const i=this.publicKey;if(!i)throw new hr;return e.feePayer=e.feePayer||i,e.recentBlockhash=e.recentBlockhash||(await t.getLatestBlockhash({commitment:r.preflightCommitment,minContextSlot:r.minContextSlot})).blockhash,e}}function N0(n){if(typeof window>"u"||typeof document>"u")return;const e=[];function t(){if(n())for(const s of e)s()}const r=setInterval(t,1e3);e.push(()=>clearInterval(r)),document.readyState==="loading"&&(document.addEventListener("DOMContentLoaded",t,{once:!0}),e.push(()=>document.removeEventListener("DOMContentLoaded",t))),document.readyState!=="complete"&&(window.addEventListener("load",t,{once:!0}),e.push(()=>window.removeEventListener("load",t))),t()}function lB(){if(!navigator)return!1;const n=navigator.userAgent.toLowerCase(),e=n.includes("iphone")||n.includes("ipad"),t=n.includes("safari");return e&&t}function Sf(n){return"version"in n}class CPe extends _U{async sendTransaction(e,t,r={}){let i=!0;try{if(Sf(e)){if(!this.supportedTransactionVersions)throw new Fu("Sending versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(e.version))throw new Fu(`Sending transaction version ${e.version} isn't supported by this wallet`);try{e=await this.signTransaction(e);const s=e.serialize();return await t.sendRawTransaction(s,r)}catch(s){throw s instanceof ps?(i=!1,s):new Fu(s==null?void 0:s.message,s)}}else try{const{signers:s,...o}=r;e=await this.prepareTransaction(e,t,o),s!=null&&s.length&&e.partialSign(...s),e=await this.signTransaction(e);const a=e.serialize();return await t.sendRawTransaction(a,o)}catch(s){throw s instanceof ps?(i=!1,s):new Fu(s==null?void 0:s.message,s)}}catch(s){throw i&&this.emit("error",s),s}}async signAllTransactions(e){for(const r of e)if(Sf(r)){if(!this.supportedTransactionVersions)throw new ps("Signing versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(r.version))throw new ps(`Signing transaction version ${r.version} isn't supported by this wallet`)}const t=[];for(const r of e)t.push(await this.signTransaction(r));return t}}class R0 extends CPe{}function bie(n){return t4 in n.features&&n4 in n.features&&(Fd in n.features||qs in n.features)}var uB;(function(n){n.Mainnet="mainnet-beta",n.Testnet="testnet",n.Devnet="devnet"})(uB||(uB={}));const TPe="Bitget";class vie extends R0{constructor(e={}){super(),this.name=TPe,this.url="https://web3.bitget.com",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSIjMDAxRjI5Ii8+CjxwYXRoIGQ9Ik0yMTkuOTQ4IDk1LjcwMjJDMjAxLjYyMyA5NS42OTI5IDE4My4zMyA5NS42ODM1IDE2NC45NDEgOTUuNzExNkMxNTMuODIyIDk1LjcxMTYgMTQ5LjY1MSAxMDkuNjcxIDE1Ny45MjEgMTE3LjkzOUwyODMuMDk4IDI0My4xMTdDMjg3LjAwNCAyNDYuNjkgMjg5LjQ0MSAyNTAuNTc0IDI4OS41MyAyNTUuNjkzQzI4OS40NDEgMjYwLjgxMiAyODcuMDA0IDI2NC42OTYgMjgzLjA5OCAyNjguMjY5TDE1Ny45MjEgMzkzLjQ0NkMxNDkuNjUxIDQwMS43MTUgMTUzLjgyMiA0MTUuNjc0IDE2NC45NDEgNDE1LjY3NEMxODMuMzMgNDE1LjcwMiAyMDEuNjIzIDQxNS42OTMgMjE5Ljk0OCA0MTUuNjgzQzIyOS4xMjIgNDE1LjY3OSAyMzguMzA1IDQxNS42NzQgMjQ3LjUxMSA0MTUuNjc0QzI1OS41NTUgNDE1LjY3NCAyNjYuNzIgNDA5LjI0I
1013DI3My4xNTQgNDAyLjgwNUwzODYuMDQ3IDI4OS45MTJDMzk1LjA1NyAyODAuOTAyIDQwMy4xMTkgMjY4LjkzOSA0MDMuMDA5IDI1NS42OTNDNDAzLjExOSAyNDIuNDQ3IDM5NS4wNTcgMjMwLjQ4NCAzODYuMDQ3IDIyMS40NzRMMjczLjE1NCAxMDguNThDMjY2LjcyIDEwMi4xNDYgMjU5LjU1NSA5NS43MTE2IDI0Ny41MTEgOTUuNzExNkMyMzguMzA1IDk1LjcxMTYgMjI5LjEyMiA5NS43MDY5IDIxOS45NDggOTUuNzAyMloiIGZpbGw9IiMwMEYwRkYiLz4KPC9zdmc+Cg==",this.supportedTransactionVersions=null,this._readyState=typeof window>"u"||typeof document>"u"?wn.Unsupported:wn.NotDetected,this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==wn.Unsupported&&N0(()=>{var t,r;return(r=(t=window.bitkeep)==null?void 0:t.solana)!=null&&r.isBitKeep?(this._readyState=wn.Installed,this.emit("readyStateChange",this._readyState),!0):!1})}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==wn.Installed)throw new ih;this._connecting=!0;const e=window.bitkeep.solana;let t;try{t=await e.getAccount()}catch(i){throw new Xl(i==null?void 0:i.message,i)}let r;try{r=new bt(t)}catch(i){throw new sh(i==null?void 0:i.message,i)}this._wallet=e,this._publicKey=r,this.emit("connect",r)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(t){this.emit("error",new _g(t==null?void 0:t.message,t))}}this.emit("disconnect")}async signTransaction(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signTransaction(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signAllTransactions(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signMessage(e){try{const t=this._wallet;if(!t)throw new hr;try{const{signature:r}=await t.signMessage(e);return r}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}}const IPe="Coin98";class xie extends R0{constructor(e={}){super(),this.name=IPe,this.url="https://coin98.com",this.icon="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3NiA3NSI+CiAgPGRlZnM+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSIxMDEuNjgxJSIgeDI9Ii0xLjU1NyUiIHkxPSIxNS4yNjglIiB5Mj0iODQuOTE3JSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNGMUQ5NjEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjQ0RBMTQ2Ii8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgPHJlY3Qgd2lkdGg9Ijc1IiBoZWlnaHQ9Ijc1IiBmaWxsPSIjMDAwIiByeD0iMTYiLz4KICAgIDxwYXRoIGZpbGw9InVybCgjYSkiIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTYxLjQ0IDBhMTMuNzE0IDEzLjcxNCAwIDAgMSA5LjY4IDQuMDEgMTMuNjYxIDEzLjY2MSAwIDAgMSA0LjAwOCA5LjY2OHY0Ny42NDZhMTMuNjYgMTMuNjYgMCAwIDEtNC4wMDcgOS42NjZBMTMuNzEzIDEzLjcxMyAwIDAgMSA2MS40NCA3NUgxMy42ODZhMTMuNzEzIDEzLjcxMyAwIDAgMS05LjY4LTQuMDFBMTMuNjYgMTMuNjYgMCAwIDEgMCA2MS4zMjRWMTMuNjc4YzAtMy42MjUgMS40NC03LjEwMiA0LjAwNy05LjY2N0ExMy43MTQgMTMuNzE0IDAgMCAxIDEzLjY4NyAwWk0yMC4wNjMgNDYuMjMxaC00LjgyNWExMC4wMzIgMTAuMDMyIDAgMCAwIDIuOTQ2IDcuMDg2IDEwLjA3IDEwLjA3IDAgMCAwIDcuMSAyLjk0MiAxMC4wNjUgMTAuMDY1IDAgMCAwIDcuMTA4LTIuOTM1IDEwLjAzIDEwLjAzIDAgMCAwIDIuOTQ2LTcuMDkzaC00LjgyNGE1LjIwNyA1LjIwNyAwIDAgMS0xLjUzIDMuNjg4IDUuMjI1IDUuMjI1IDAgMCAxLTMuNjk2IDEuNTI4IDUuMjM0IDUuMjM0IDAgMCAxLTMuNjk1LTEuNTI4IDUuMjEzIDUuMjEzIDAgMCAxLTEuNTMtMy42ODhaTTU0LjMzIDMzLjcxNmExMS43NjMgMTEuNzYzIDAgMCAwLTEyLjc5OSAyLjUzOEExMS42OTcgMTEuNjk3IDAgMCAwIDM4Ljk5IDQ5LjAzYTExLjcyMyAxMS43MjMgMCAwIDAgNC4zMjggNS4yNTkgMTEuNzU3IDExLjc1NyAwIDAgMCA2LjUyNiAxLjk3IDExLjc2NiAxMS43NjYgMCAwIDAgOC4yOS0zLjQzNSAxMS43MiAxMS43MiAwIDAgMCAzLjQ0Mi04LjI3NCAxMS43MDIgMTEuNzAyIDAgMCAwLTEuOTc1LTYuNTE0IDExLjczNiAxMS43MzYgMCAwIDAtNS4yNjktNC4zMlptLTQuNDg4IDMuOTJhNi45MzcgNi45MzcgMCAwIDEgNC45IDIuMDI1IDYuOTEgNi45MSAwIDAgMSAyLjAyOCA0Ljg5MiA2Ljg5NyA2Ljg5NyAwIDAgMS0xLjE3IDMuODM0IDYuOTMyIDYuOTMyIDAgMCAxLTEwLjY0MyAxLjA0MiA2LjkwMiA2LjkwMiAwIDAgMS0xLjUtNy41MjIgNi45MDkgNi45MDkgMCAwIDEgMi41NDQtMy4xIDYuOTI4IDYuOTI4IDAgMCAxIDMuODQxLTEuMTY3Wm0uMTcgNC4
10131NTJhMi40MzEgMi40MzEgMCAwIDAtMi4yNDEgMS4xNTQgMi40MTggMi40MTggMCAwIDAtLjM1NiAxLjI1NyAyLjM5NSAyLjM5NSAwIDAgMCAxLjYxOSAyLjI5djEuNzUzaDEuNjE4di0xLjc1NGEyLjQyNyAyLjQyNyAwIDAgMCAxLjU5NC0xLjk1IDIuNDE4IDIuNDE4IDAgMCAwLTEtMi4zMSAyLjQzMSAyLjQzMSAwIDAgMC0xLjIzNC0uNDRabS0yMC4yMi0yMi41NTJhMTEuNzYyIDExLjc2MiAwIDAgMC0xMi43OTYgMi41MzEgMTEuNjk3IDExLjY5NyAwIDAgMC0yLjU1NCAxMi43NjkgMTEuNzIzIDExLjcyMyAwIDAgMCA0LjMyIDUuMjYyIDExLjc1NyAxMS43NTcgMCAwIDAgMTQuODI1LTEuNDQ2IDExLjcxNyAxMS43MTcgMCAwIDAgMy40NDUtOC4yODQgMTEuNzAzIDExLjcwMyAwIDAgMC0xLjk3NC02LjUxMiAxMS43MzYgMTEuNzM2IDAgMCAwLTUuMjY2LTQuMzJabS00LjUxIDMuOTE3YTYuOTQ1IDYuOTQ1IDAgMCAxIDQuODk3IDIuMDI5IDYuOTE4IDYuOTE4IDAgMCAxIDIuMDMyIDQuODg2IDYuOTA2IDYuOTA2IDAgMCAxLTEuMTY4IDMuODQyIDYuOTQgNi45NCAwIDAgMS0xMC42NiAxLjA0OCA2LjkxMSA2LjkxMSAwIDAgMS0xLjUtNy41MzYgNi45MTggNi45MTggMCAwIDEgMi41NS0zLjEwMyA2LjkzNyA2LjkzNyAwIDAgMSAzLjg1LTEuMTY2Wm0yNC41Ni00LjgxYTEwLjA1OSAxMC4wNTkgMCAwIDAtNy4xMDMgMi45NCAxMC4wMiAxMC4wMiAwIDAgMC0yLjk0IDcuMDkgOS45IDkuOSAwIDAgMCAxLjIzIDQuNzk1IDEzLjU3NSAxMy41NzUgMCAwIDEgNC4yMTQtMi4zMjIgNS4wODIgNS4wODIgMCAwIDEtLjYyNS0yLjQ3NyA1LjIwNiA1LjIwNiAwIDAgMSAxLjUwMy0zLjczNiA1LjIyMyA1LjIyMyAwIDAgMSAzLjcyMi0xLjU1NCA1LjIzNCA1LjIzNCAwIDAgMSAzLjcyIDEuNTU0IDUuMjEzIDUuMjEzIDAgMCAxIDEuNTA1IDMuNzM2IDUuMjc5IDUuMjc5IDAgMCAxLS42MjMgMi40NzMgMTMuNTc0IDEzLjU3NCAwIDAgMSA0LjIxMyAyLjMyMiA5LjkwMyA5LjkwMyAwIDAgMCAxLjIzLTQuNzk1IDEwLjAzMiAxMC4wMzIgMCAwIDAtMi45NDYtNy4wODYgMTAuMDcgMTAuMDcgMCAwIDAtNy4xLTIuOTRabS0yMy43NSA3Ljk
10135aC0xLjYxN3YxLjc1YTIuNDE5IDIuNDE5IDAgMCAwLTEuNTgyIDIuNjg3IDIuNDE0IDIuNDE0IDAgMCAwIDIuMzkgMi4wMDYgMi40NSAyLjQ1IDAgMCAwIDEuNTU1LS41NzQgMi40MTQgMi40MTQgMCAwIDAtLjc0Ni00LjExOXYtMS43NVoiLz4KICA8L2c+Cjwvc3ZnPgo=",this.supportedTransactionVersions=null,this._readyState=typeof window>"u"||typeof document>"u"?wn.Unsupported:wn.NotDetected,this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==wn.Unsupported&&N0(()=>{var t;return(t=window.coin98)!=null&&t.sol?(this._readyState=wn.Installed,this.emit("readyStateChange",this._readyState),!0):!1})}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get connected(){var e;return!!((e=this._wallet)!=null&&e.isConnected())}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==wn.Installed)throw new ih;this._connecting=!0;const e=window.coin98.sol;let t;try{t=(await e.connect())[0]}catch(i){throw new Xl(i==null?void 0:i.message,i)}let r;try{r=new bt(t)}catch(i){throw new sh(i==null?void 0:i.message,i)}this._wallet=e,this._publicKey=r,this.emit("connect",r)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(t){this.emit("error",new _g(t==null?void 0:t.message,t))}}this.emit("disconnect")}async signTransaction(e){try{const t=this._wallet;if(!t)throw new hr;try{const r=await t.request({method:"sol_sign",params:[e]}),i=new bt(r.publicKey),s=Os.decode(r.signature);return e.addSignature(i,pn.from(s)),e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(e){try{const t=this._wallet;if(!t)throw new hr;try{const r=await t.request({method:"sol_signAllTransactions",params:[e]}),i=new bt(r.publicKey),s=r.signatures;return e.map((o,a)=>{const c=Os.decode(s[a]);return o.addSignature(i,pn.from(c)),o})}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signMessage(e){try{const t=this._wallet;if(!t)throw new hr;try{const r=await t.request({method:"sol_signMessage",params:[e]});return Os.decode(r.signature)}catch(r){throw new tb(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}}const NPe="Coinbase Wallet";class CU extends R0{constructor(e={}){super(),this.name=NPe,this.url="https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSI1MTIiIGN5PSI1MTIiIHI9IjUxMiIgZmlsbD0iIzAwNTJGRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1MiA1MTJDMTUyIDcxMC44MjMgMzEzLjE3NyA4NzIgNTEyIDg3MkM3MTAuODIzIDg3MiA4NzIgNzEwLjgyMyA4NzIgNTEyQzg3MiAzMTMuMTc3IDcxMC44MjMgMTUyIDUxMiAxNTJDMzEzLjE3NyAxNTIgMTUyIDMxMy4xNzcgMTUyIDUxMlpNNDIwIDM5NkM0MDYuNzQ1IDM5NiAzOTYgNDA2Ljc0NSAzOTYgNDIwVjYwNEMzOTYgNjE3LjI1NSA0MDYuNzQ1IDYyOCA0MjAgNjI4SDYwNEM2MTcuMjU1IDYyOCA2MjggNjE3LjI1NSA2MjggNjA0VjQyMEM2MjggNDA2Ljc0NSA2MTcuMjU1IDM5NiA2MDQgMzk2SDQyMFoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=",this.supportedTransactionVersions=new Set(["legacy",0]),this._readyState=typeof window>"u"||typeof document>"u"?wn.Unsupported:wn.NotDetected,this._disconnected=()=>{const t=this._wallet;t&&(t.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("error",new eb),this.emit("disconnect"))},this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==wn.Unsupported&&N0(()=>window!=null&&window.coinbaseSolana?(this._readyState=wn.Installed,this.emit("readyStateChange",this._readyState),!0):!1)}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==wn.Installed)throw new ih;this._connecting=!0;const e=window.coinbaseSolana;try{await e.connect()}catch(r){throw new w0(r==null?void 0:r.message,r)}if(!e.publicKey)throw new Xl;let t;try{t=new bt(e.publicKey.toBytes())}catch(r){throw new sh(r==null?void 0:r.message,r)}e.on("disconnect",this._disconnected),this._wallet=e,this._publicKey=t,this.emit
1013("connect",t)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(t){this.emit("error",new _g(t==null?void 0:t.message,t))}}this.emit("disconnect")}async sendTransaction(e,t,r={}){try{const i=this._wallet;if(!i)throw new hr;try{const{signers:s,...o}=r;Sf(e)?s!=null&&s.length&&e.sign(s):(e=await this.prepareTransaction(e,t,o),s!=null&&s.length&&e.partialSign(...s)),o.preflightCommitment=o.preflightCommitment||t.commitment;const{signature:a}=await i.signAndSendTransaction(e,o);return a}catch(s){throw s instanceof eo?s:new Fu(s==null?void 0:s.message,s)}}catch(i){throw this.emit("error",i),i}}async signTransaction(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signTransaction(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signAllTransactions(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signMessage(e){try{const t=this._wallet;if(!t)throw new hr;try{const{signature:r}=await t.signMessage(e);return r}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}}const RPe="Phantom";class TU extends R0{constructor(e={}){super(),this.name=RPe,this.url="https://phantom.app",this.icon="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDgiIGhlaWdodD0iMTA4IiB2aWV3Qm94PSIwIDAgMTA4IDEwOCIgZmlsbD0ibm9uZSI+CjxyZWN0IHdpZHRoPSIxMDgiIGhlaWdodD0iMTA4IiByeD0iMjYiIGZpbGw9IiNBQjlGRjIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00Ni41MjY3IDY5LjkyMjlDNDIuMDA1NCA3Ni44NTA5IDM0LjQyOTIgODUuNjE4MiAyNC4zNDggODUuNjE4MkMxOS41ODI0IDg1LjYxODIgMTUgODMuNjU2MyAxNSA3NS4xMzQyQzE1IDUzLjQzMDUgNDQuNjMyNiAxOS44MzI3IDcyLjEyNjggMTkuODMyN0M4Ny43NjggMTkuODMyNyA5NCAzMC42ODQ2IDk0IDQzLjAwNzlDOTQgNTguODI1OCA4My43MzU1IDc2LjkxMjIgNzMuNTMyMSA3Ni45MTIyQzcwLjI5MzkgNzYuOTEyMiA2OC43MDUzIDc1LjEzNDIgNjguNzA1MyA3Mi4zMTRDNjguNzA1MyA3MS41NzgzIDY4LjgyNzUgNzAuNzgxMiA2OS4wNzE5IDY5LjkyMjlDNjUuNTg5MyA3NS44Njk5IDU4Ljg2ODUgODEuMzg3OCA1Mi41NzU0IDgxLjM4NzhDNDcuOTkzIDgxLjM4NzggNDUuNjcxMyA3OC41MDYzIDQ1LjY3MTMgNzQuNDU5OEM0NS42NzEzIDcyLjk4ODQgNDUuOTc2OCA3MS40NTU2IDQ2LjUyNjcgNjkuOTIyOVpNODMuNjc2MSA0Mi41Nzk0QzgzLjY3NjEgNDYuMTcwNCA4MS41NTc1IDQ3Ljk2NTggNzkuMTg3NSA0Ny45NjU4Qzc2Ljc4MTYgNDcuOTY1OCA3NC42OTg5IDQ2LjE3MDQgNzQuNjk4OSA0Mi41Nzk0Qzc0LjY5ODkgMzguOTg4NSA3Ni43ODE2IDM3LjE5MzEgNzkuMTg3NSAzNy4xOTMxQzgxLjU1NzUgMzcuMTkzMSA4My42NzYxIDM4Ljk4ODUgODMuNjc2MSA0Mi41Nzk0Wk03MC4yMTAzIDQyLjU3OTVDNzAuMjEwMyA0Ni4xNzA0IDY4LjA5MTYgNDcuOTY1OCA2NS43MjE2IDQ3Ljk2NThDNjMuMzE1NyA0Ny45NjU4IDYxLjIzMyA0Ni4xNzA0IDYxLjIzMyA0Mi41Nzk1QzYxLjIzMyAzOC45ODg1IDYzLjMxNTcgMzcuMTkzMSA2NS43MjE2IDM3LjE5MzFDNjguMDkxNiAzNy4xOTMxIDcwLjIxMDMgMzguOTg4NSA3MC4yMTAzIDQyLjU3OTVaIiBmaWxsPSIjRkZGREY4Ii8+Cjwvc3ZnPg==",this.supportedTransactionVersions=new Set(["legacy",0]),this._readyState=typeof window>"u"||typeof document>"u"?wn.Unsupported:wn.NotDetected,this._disconnected=()=>{const t=this._wallet;t&&(t.off("disconnect",this._disconnected),t.off("accountChanged",this._accountChanged),this._wallet=null,this._publicKey=null,this.emit("error",new eb),this.emit("disconnect"))},this._accountChanged=t=>{const r=this._publicKey;if(r){try{t=new bt(t.toBytes())}catch(i){this.emit("error",new sh(i==null?void 0:i.message,i));return}r.equals(t)||(this._publicKey=t,this.emit("connect",t))}},this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==wn.Unsupported&&(lB()?(this._readyState=wn.Loadable,this.emit("readyStateChange",this._readyState)):N0(()=>{var t,r,i;return(r=(t=window.phantom)==null?void 0:t.solana)!=null&&r.isPhantom||(i=window.solana)!=null&&i.isPhantom?(this._readyState=wn.Installed,this.emit("readyStateChange",this._readyState),!0):!1}))}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get readyState(){return this._readyState}async autoConnect(){this.readyState===wn.Installed&&await this.connect()}async connect(){var e;try{if(this.connected||this.connecting)return;if(this.readyState===wn.Loadable){const i=encodeURIComponent(window.location.href),s=encodeURIComponent(window.location.origin);window.location.href=`https://phantom.app/ul/browse/${i}?ref=${s}`;return}if(this.readyState!==wn.Installed)throw new ih;this._connecting=!0;const t=((e=window.phantom)==null?void 0:e.solana)||window.solana;if(!t.isConnected)try{await t.connect()}catch(i){throw new w0(i==null?void 0:i.message,i)}if(!t.publicKey)throw new Xl;let r;try{r=new bt(t.publicKey.toBytes())}catch(i){throw new sh(i==null?void 0:i.message,i)}t.on("disconnect",this._disconnected),t.on("accountChanged",this._accountChanged),this._wallet=t,this._publicKey=r,this.emit
1013("connect",r)}catch(t){throw this.emit("error",t),t}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),e.off("accountChanged",this._accountChanged),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(t){this.emit("error",new _g(t==null?void 0:t.message,t))}}this.emit("disconnect")}async sendTransaction(e,t,r={}){try{const i=this._wallet;if(!i)throw new hr;try{const{signers:s,...o}=r;Sf(e)?s!=null&&s.length&&e.sign(s):(e=await this.prepareTransaction(e,t,o),s!=null&&s.length&&e.partialSign(...s)),o.preflightCommitment=o.preflightCommitment||t.commitment;const{signature:a}=await i.signAndSendTransaction(e,o);return a}catch(s){throw s instanceof eo?s:new Fu(s==null?void 0:s.message,s)}}catch(i){throw this.emit("error",i),i}}async signTransaction(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signTransaction(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signAllTransactions(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signMessage(e){try{const t=this._wallet;if(!t)throw new hr;try{const{signature:r}=await t.signMessage(e);return r}catch(r){throw new tb(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}}var MPe=function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},kPe=function(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t},_6;function OPe(n){const e=({register:t})=>t(n);try{window.dispatchEvent(new PPe(e))}catch(t){console.error(`wallet-standard:register-wallet event could not be dispatched 1014`,t)}try{window.addEventListener("wallet-standard:app-ready",({detail
1014:t})=>e(t))}catch(t){console.error(`wallet-standard:app-ready event listener could not be added 1015`,t)}}class PPe extends Event{get detail(){return MPe(this,_6,"f")}get type(){return"wallet-standard:register-wallet"}constructor(e){super("wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),_6.set(this,void 0),kPe(this,_6,e,"f")}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}_6=new WeakMap;function DPe(n,e){if(n===e)return!0;const t=n.length;if(t!==e.length)return!1;for(let r=0;r<t;r++)if(n[r]!==e[r])return!1;return!0}const BPe="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjMxIiB2aWV3Qm94PSIwIDAgMzEgMzEiIHdpZHRoPSIzMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGxpbmVhckdyYWRpZW50IGlkPSJhIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjIwLjI1IiB4Mj0iMjYuNTcxIiB5MT0iMjcuMTczIiB5Mj0iMTkuODU4Ij48c3RvcCBvZmZzZXQ9Ii4wOCIgc3RvcC1jb2xvcj0iIzk5NDVmZiIvPjxzdG9wIG9mZnNldD0iLjMiIHN0b3AtY29sb3I9IiM4NzUyZjMiLz48c3RvcCBvZmZzZXQ9Ii41IiBzdG9wLWNvbG9yPSIjNTQ5N2Q1Ii8+PHN0b3Agb2Zmc2V0PSIuNiIgc3RvcC1jb2xvcj0iIzQzYjRjYSIvPjxzdG9wIG9mZnNldD0iLjcyIiBzdG9wLWNvbG9yPSIjMjhlMGI5Ii8+PHN0b3Agb2Zmc2V0PSIuOTciIHN0b3AtY29sb3I9IiMxOWZiOWIiLz48L2xpbmVhckdyYWRpZW50PjxnIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iLjA5NCI+PHBhdGggZD0ibTI2LjEwOSAzLjY0My05LjM2OSA2Ljk1OSAxLjczMy00LjEwNSA3LjYzNy0yLjg1M3oiIGZpbGw9IiNlMjc2MWIiIHN0cm9rZT0iI2UyNzYxYiIvPjxnIGZpbGw9IiNlNDc2MWIiIHN0cm9rZT0iI2U0NzYxYiI+PHBhdGggZD0ibTQuNDgxIDMuNjQzIDkuMjk0IDcuMDI0LTEuNjQ4LTQuMTcxem0xOC4yNTggMTYuMTMtMi40OTUgMy44MjMgNS4zMzkgMS40NjkgMS41MzUtNS4yMDctNC4zNzgtLjA4NXptLTE5LjI0Ny4wODUgMS41MjUgNS4yMDcgNS4zMzktMS40NjktMi40OTUtMy44MjN6Ii8+PHBhdGggZD0ibTEwLjA1NSAxMy4zMTMtMS40ODggMi4yNTEgNS4zMDEuMjM1LS4xODgtNS42OTd6bTEwLjQ4IDAtMy42NzItMy4yNzctLjEyMiA1Ljc2MyA1LjI5Mi0uMjM1LTEuNDk3LTIuMjUxem0tMTAuMTc4IDEwLjI4MyAzLjE4My0xLjU1NC0yLjc0OS0yLjE0Ny0uNDMzIDMuNzAxem02LjY5NS0xLjU1NCAzLjE5MiAxLjU1NC0uNDQzLTMuNzAxeiIvPjwvZz48cGF0aCBkPSJtMjAuMjQ0IDIzLjU5Ni0zLjE5Mi0xLjU1NC4yNTQgMi4wODEtLjAyOC44NzZ6bS05Ljg4NyAwIDIuOTY2IDEuNDAzLS4wMTktLjg3Ni4yMzUtMi4wODEtMy4xODMgMS41NTR6IiBmaWxsPSIjZDdjMWIzIiBzdHJva2U9IiNkN2MxYjMiLz48cGF0aCBkPSJtMTMuMzY5IDE4LjUyMS0yLjY1NS0uNzgxIDEuODc0LS44NTd6bTMuODUxIDAgLjc4MS0xLjYzOCAxLjg4My44NTctMi42NjUuNzgxeiIgZmlsbD0iIzIzMzQ0NyIgc3Ryb2tlPSIjMjMzNDQ3Ii8+PHBhdGggZD0ibTEwLjM1NyAyMy41OTYuNDUyLTMuODIzLTIuOTQ3LjA4NXptOS40MzUtMy44MjMuNDUyIDMuODIzIDIuNDk1LTMuNzM4em0yLjI0MS00LjIwOS01LjI5Mi4yMzUuNDkgMi43MjEuNzgyLTEuNjM4IDEuODgzLjg1N3ptLTExLjMxOCAyLjE3NSAxLjg4My0uODU3Ljc3MiAxLjYzOC40OTktMi43MjEtNS4zMDEtLjIzNXoiIGZpbGw9IiNjZDYxMTYiIHN0cm9rZT0iI2NkNjExNiIvPjxwYXRoIGQ9Im04LjU2NyAxNS41NjQgMi4yMjIgNC4zMzEtLjA3NS0yLjE1NnptMTEuMzI4IDIuMTc1LS4wOTQgMi4xNTYgMi4yMzItNC4zMzEtMi4xMzcgMi4xNzV6bS02LjAyNi0xLjk0LS40OTkgMi43MjEuNjIxIDMuMjExLjE0MS00LjIyOC0uMjY0LTEuNzA0em0yLjg3MiAwLS4yNTQgMS42OTUuMTEzIDQuMjM3LjYzMS0zLjIxMXoiIGZpbGw9IiNlNDc1MWYiIHN0cm9rZT0iI2U0NzUxZiIvPjxwYXRoIGQ9Im0xNy4yMyAxOC41Mi0uNjMxIDMuMjExLjQ1Mi4zMTEgMi43NS0yLjE0Ny4wOTQtMi4xNTZ6bS02LjUxNi0uNzgxLjA3NSAyLjE1NiAyLjc1IDIuMTQ3LjQ1Mi0uMzExLS42MjItMy4yMTF6IiBmaWxsPSIjZjY4NTFiIiBzdHJva2U9IiNmNjg1MWIiLz48cGF0aCBkPSJtMTcuMjc3IDI0Ljk5OS4wMjgtLjg3Ni0uMjM1LS4yMDdoLTMuNTVsLS4yMTcuMjA3LjAxOS44NzYtMi45NjYtMS40MDMgMS4wMzYuODQ4IDIuMSAxLjQ1OWgzLjYwNmwyLjEwOS0xLjQ1OSAxLjAzNi0uODQ4eiIgZmlsbD0iI2MwYWQ5ZSIgc3Ryb2tlPSIjYzBhZDllIi8+PHBhdGggZD0ibTE3LjA1MSAyMi4wNDItLjQ1Mi0uMzExaC0yLjYwOGwtLjQ1Mi4zMTEtLjIzNSAyLjA4MS4yMTctLjIwN2gzLjU1bC4yMzUuMjA3LS4yNTQtMi4wODF6IiBmaWxsPSIjMTYxNjE2IiBzdHJva2U9IiMxNjE2MTYiLz48cGF0aCBkPSJtMjYuNTA1IDExLjA1My44LTMuODQyLTEuMTk2LTMuNTY5LTkuMDU4IDYuNzIzIDMuNDg0IDIuOTQ3IDQuOTI1IDEuNDQxIDEuMDkyLTEuMjcxLS40NzEtLjMzOS43NTMtLjY4Ny0uNTg0LS40NTIuNzUzLS41NzQtLjQ5OS0uMzc3em0tMjMuMjExLTMuODQxLjggMy44NDItLjUwOC4zNzcuNzUzLjU3NC0uNTc0LjQ1Mi43NTMuNjg3LS40NzEuMzM5IDEuMDgzIDEuMjcxIDQuOTI1LTEuNDQxIDMuNDg0LTIuOTQ3LTkuMDU5LTYuNzIzeiIgZmlsbD0iIzc2M2QxNiIgc3Ryb2tlPSIjNzYzZDE2Ii8+PHBhdGggZD0ibTI1LjQ2IDE0Ljc1NC00LjkyNS0xLjQ0MSAxLjQ5NyAyLjI1MS0yLjIzMiA0LjMzMSAyLjkzOC0uMDM4aDQuMzc4bC0xLjY1Ny01LjEwNHptLTE1LjQwNS0xLjQ0MS00LjkyNSAxLjQ0MS0xLjYzOCA1LjEwNGg0LjM2OWwyLjkyOC4wMzgtMi4yMjItNC4zMzEgMS40ODgtMi4yNTF6bTYuNjg1IDIuNDg2LjMxMS01LjQzMyAxLjQzMS0zLjg3aC02LjM1NmwxLjQxMyAzLjg3LjMyOSA1LjQzMy4xMTMgMS43MTQuMDA5IDQuMjE5aDIuNjFsLjAxOS00LjIxOS4xMjItMS43MTR6IiBmaWxsPSIjZjY4NTFiIiBzdHJva2U9IiNmNjg1MWIiLz48L2c+PGNpcmNsZSBjeD0iMjMuNSIgY3k9IjIzLjUiIGZpbGw9IiMwMDAiIHI9IjYuNSIvPjxwYXRoIGQ9Im0yNy40NzMgMjUuNTQ1LTEuMzEgMS4zNjhjLS4wMjkuMDMtLjA2My4wNTMtLjEwMS4wN2EuMzEuMzEgMCAwIDEgLS4xMjEuMDI0aC02LjIwOWMtLjAzIDAtLjA1OS0uMDA4LS4wODMtLjAyNGEuMTUuMTUgMCAwIDEgLS4wNTYtLjA2NWMtLjAxMi0uMDI2LS4wMTUtLjA1Ni0uMDEtLjA4NHMuMDE4LS4wNTUuMDM5LS4wNzZsMS4zMTEtMS4zNjhjLjAyOC0uMDMuMDYzLS4wNTMuMTAxLS4wNjlhLjMxLjMxIDAgMCAxIC4xMjEtLjAyNWg2LjIwOGMuMDMgMCAuMDU5LjAwOC4wODMuMDI0YS4xNS4xNSAwIDAgMSAuMDU2LjA2NWMuMDEyLjAyNi4wMTUuMDU2LjAxLjA4NHMtLjAxOC4wNTUtLjAzOS4wNzZ6bS0xLjMxLTIuNzU2Yy0uMDI5LS4wMy0uMDYzLS4wNTMtLjEwMS0uMDdhLjMxLjMxIDAgMCAwIC0uMTIxLS4wMjRoLTYuMjA5Yy0uMDMgMC0uMDU5LjAwOC0uMDgzLjAyNHMtLjA0NC4wMzgtLjA1Ni4wNjUtLjAxNS4wNTYtLjAxLjA4NC4wMTguMDU1LjAzOS4wNzZsMS4zMTEgMS4zNjhjLjAyOC4wMy4wNjMuMDUzLjEwMS4wNjlhLjMxLjMxIDAgMCAwIC4xMjEuMDI1aDYuMjA4Yy4wMyAwIC4wNTktLjAwOC4wODMtLjAyNGEuMTUuMTUgMCAwIDAgLjA1Ni0uMDY1Yy4wMTItLjAyNi4wMTUtLjA1Ni4wMS0uMDg0cy0uMDE4LS4wNTUtLjAzOS0uMDc2em0tNi40MzEtLjk4M2g2LjIwOWEuMzEuMzEgMCAwIDAgLjEyMS0uMDI0Yy4wMzgtLjAxNi4wNzMtLjA0LjEwMS0uMDdsMS4zMS0xLjM2OGMuMDItLjAyMS4wMzQtLjA0Ny4wMzktLjA3NnMuMDAxLS4wNTgtLjAxLS4wODRhLjE1LjE1IDAgMCAwIC0uMDU2LS4wNjVjLS4wMjUtLjAxNi0uMDU0LS4wMjQtLjA4My0uMDI0aC02LjIwOGEuMzEuMzEgMCAwIDAgLS4xMjEuMDI1Yy0uMDM4LjAxNi0uMDcyLjA0LS4xMDEuMDY5bC0xLjMxIDEuMzY4Yy0uMDIuMDIxLS4wMzQuMDQ3LS4wMzkuMDc2cy0uMDAxLjA1OC4wMS4wODQuMDMxLjA0OS4wNTYuMDY1LjA1NC4wMjQuMDgzLjAyNHoiIGZpbGw9InVybCgjYSkiLz48L3N2Zz4=";var Ti=function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},LPe=function(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t},C6,$y,dB,hB,fB,Fa,pB,Eie,Aie,gB,mB,wB,yB,bB;class $Pe{constructor(){C6.add(this),$y.set(this,{}),dB.set(this,"1.0.0"),hB.set(this,"MetaMask"),fB.set(this,BPe),Fa.set(this,null),pB.set(this,(e,t)=>{var r;return(r=Ti(this,$y,"f")[e])!=null&&r.push(t)||(Ti(this,$y,"f")[e]=[t]),()=>Ti(this,C6,"m",Aie).call(this,e,t)}),gB.set(this,async()=>
1015{if(!Ti(this,Fa,"f")){let e;try{e=(await It(async()=>{const{default:t}=await import("./index-BCSlC2u9.js");return{default:t}},[])).default}catch{throw new Error("Unable to load Solflare MetaMask SDK")}LPe(this,Fa,new e,"f"),Ti(this,Fa,"f").on("standard_change",t=>Ti(this,C6,"m",Eie).call(this,"change",t))}return this.accounts.length||await Ti(this,Fa,"f").connect(),{accounts:this.accounts}}),mB.set(this,async()=>{Ti(this,Fa,"f")&&await Ti(this,Fa,"f").disconnect()}),wB.set(this,async(...e)=>{if(!Ti(this,Fa,"f"))throw new hr;return await Ti(this,Fa,"f").standardSignAndSendTransaction(...e)}),yB.set(this,async(...e)=>{if(!Ti(this,Fa,"f"))throw new hr;return await Ti(this,Fa,"f").standardSignTransaction(...e)}),bB.set(this,async(...e)=>{if(!Ti(this,Fa,"f"))throw new hr;return await Ti(this,Fa,"f").standardSignMessage(...e)})}get version(){return Ti(this,dB,"f")}get name(){return Ti(this,hB,"f")}get icon(){return Ti(this,fB,"f")}get chains(){return[cB,wie,yie]}get features(){return{[t4]:{version:"1.0.0",connect:Ti(this,gB,"f")},[NN]:{version:"1.0.0",disconnect:Ti(this,mB,"f")},[n4]:{version:"1.0.0",on:Ti(this,pB,"f")},[Fd]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:Ti(this,wB,"f")},[qs]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:Ti(this,yB,"f")},[Ey]:{version:"1.0.0",signMessage:Ti(this,bB,"f")}}}get accounts(){return Ti(this,Fa,"f")?Ti(this,Fa,"f").standardAccounts:[]}}$y=new WeakMap,dB=new WeakMap,hB=new WeakMap,fB=new WeakMap,Fa=new WeakMap,pB=new WeakMap,gB=new WeakMap,mB=new WeakMap,wB=new WeakMap,yB=new WeakMap,bB=new WeakMap,C6=new WeakSet,Eie=function(e,...t){var r;(r=Ti(this,$y,"f")[e])==null||r.forEach(i=>i.apply(null,t))},Aie=function(e,t){var r;Ti(this,$y,"f")[e]=(r=Ti(this,$y,"f")[e])==null?void 0:r.filter(i=>t!==i)};let Xq=!1;function UPe(){Xq||(OPe(new $Pe),Xq=!0)}async function jPe(){const n="solflare-detect-metamask";function e(){window.postMessage({target:"metamask-contentscript",data:{name:"metamask-provider",data:{id:n,jsonrpc:"2.0",method:"wallet_getSnaps"}}},window.location.origin)}function t(r){var s,o;const i=r.data;(i==null?void 0:i.target)==="metamask-inpage"&&((s=i.data)==null?void 0:s.name)==="metamask-provider"&&(((o=i.data.data)==null?void 0:o.id)===n?(window.removeEventListener("message",t),i.data.data.error||UPe()):e())}window.addEventListener("message",t),window.setTimeout(()=>window.removeEventListener("message",t),5e3),e()}const zPe="Solflare";class IU extends R0{constructor(e={}){super(),this.name=zPe,this.url="https://solflare.com",this.icon="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJTIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MCA1MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMwMjA1MGE7c3Ryb2tlOiNmZmVmNDY7c3Ryb2tlLW1pdGVybGltaXQ6MTA7c3Ryb2tlLXdpZHRoOi41cHg7fS5jbHMtMntmaWxsOiNmZmVmNDY7fTwvc3R5bGU+PC9kZWZzPjxyZWN0IGNsYXNzPSJjbHMtMiIgeD0iMCIgd2lkdGg9IjUwIiBoZWlnaHQ9IjUwIiByeD0iMTIiIHJ5PSIxMiIvPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTI0LjIzLDI2LjQybDIuNDYtMi4zOCw0LjU5LDEuNWMzLjAxLDEsNC41MSwyLjg0LDQuNTEsNS40MywwLDEuOTYtLjc1LDMuMjYtMi4yNSw0LjkzbC0uNDYuNS4xNy0xLjE3Yy42Ny00LjI2LS41OC02LjA5LTQuNzItNy40M2wtNC4zLTEuMzhoMFpNMTguMDUsMTEuODVsMTIuNTIsNC4xNy0yLjcxLDIuNTktNi41MS0yLjE3Yy0yLjI1LS43NS0zLjAxLTEuOTYtMy4zLTQuNTF2LS4wOGgwWk0xNy4zLDMzLjA2bDIuODQtMi43MSw1LjM0LDEuNzVjMi44LjkyLDMuNzYsMi4xMywzLjQ2LDUuMThsLTExLjY1LTQuMjJoMFpNMTMuNzEsMjAuOTVjMC0uNzkuNDItMS41NCwxLjEzLTIuMTcuNzUsMS4wOSwyLjA1LDIuMDUsNC4wOSwyLjcxbDQuNDIsMS40Ni0yLjQ2LDIuMzgtNC4zNC0xLjQyYy0yLS42Ny0yLjg0LTEuNjctMi44NC0yLjk2TTI2LjgyLDQyLjg3YzkuMTgtNi4wOSwxNC4xMS0xMC4yMywxNC4xMS0xNS4zMiwwLTMuMzgtMi01LjI2LTYuNDMtNi43MmwtMy4zNC0xLjEzLDkuMTQtOC43Ny0xLjg0LTEuOTYtMi43MSwyLjM4LTEyLjgxLTQuMjJjLTMuOTcsMS4yOS04Ljk3LDUuMDktOC45Nyw4Ljg5LDAsLjQyLjA0LjgzLjE3LDEuMjktMy4zLDEuODgtNC42MywzLjYzLTQuNjMsNS44LDAsMi4wNSwxLjA5LDQuMDksNC41NSw1LjIybDIuNzUuOTItOS41Miw5LjE0LDEuODQsMS45NiwyLjk2LTIuNzEsMTQuNzMsNS4yMmgwWiIvPjwvc3ZnPg==",this.supportedTransactionVersions=new Set(["legacy",0]),this._readyState=typeof window>"u"||typeof document>"u"?wn.Unsupported:wn.Loadable,this._disconnected=()=>{const t=this._wallet;t&&(t.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit
1015("error",new eb),this.emit("disconnect"))},this._accountChanged=t=>{if(!t)return;const r=this._publicKey;if(r){try{t=new bt(t.toBytes())}catch(i){this.emit("error",new sh(i==null?void 0:i.message,i));return}r.equals(t)||(this._publicKey=t,this.emit("connect",t))}},this._connecting=!1,this._publicKey=null,this._wallet=null,this._config=e,this._readyState!==wn.Unsupported&&(N0(()=>{var t;return(t=window.solflare)!=null&&t.isSolflare||window.SolflareApp?(this._readyState=wn.Installed,this.emit("readyStateChange",this._readyState),!0):!1}),jPe())}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get connected(){var e;return!!((e=this._wallet)!=null&&e.connected)}get readyState(){return this._readyState}async autoConnect(){this.readyState===wn.Loadable&&lB()||await this.connect()}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==wn.Loadable&&this._readyState!==wn.Installed)throw new ih;if(this.readyState===wn.Loadable&&lB()){const i=encodeURIComponent(window.location.href),s=encodeURIComponent(window.location.origin);window.location.href=`https://solflare.com/ul/v1/browse/${i}?ref=${s}`;return}let e;try{e=(await It(async()=>{const{default:i}=await import("./index-9XGLpNCx.js");return{default:i}},[])).default}catch(i){throw new _Pe(i==null?void 0:i.message,i)}let t;try{t=new e({network:this._config.network})}catch(i){throw new k2(i==null?void 0:i.message,i)}if(this._connecting=!0,!t.connected)try{await t.connect()}catch(i){throw new w0(i==null?void 0:i.message,i)}if(!t.publicKey)throw new w0;let r;try{r=new bt(t.publicKey.toBytes())}catch(i){throw new sh(i==null?void 0:i.message,i)}t.on("disconnect",this._disconnected),t.on("accountChanged",this._accountChanged),this._wallet=t,this._publicKey=r,this.emit("connect",r)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),e.off("accountChanged",this._accountChanged),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(t){this.emit("error",new _g(t==null?void 0:t.message,t))}}this.emit("disconnect")}async sendTransaction(e,t,r={}){try{const i=this._wallet;if(!i)throw new hr;try{const{signers:s,...o}=r;return Sf(e)?s!=null&&s.length&&e.sign(s):(e=await this.prepareTransaction(e,t,o),s!=null&&s.length&&e.partialSign(...s)),o.preflightCommitment=o.preflightCommitment||t.commitment,await i.signAndSendTransaction(e,o)}catch(s){throw s instanceof eo?s:new Fu(s==null?void 0:s.message,s)}}catch(i){throw this.emit("error",i),i}}async signTransaction(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signTransaction(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signAllTransactions(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signMessage(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signMessage(e,"utf8")}catch(r){throw new tb(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}}const FPe="Trust";class NU extends R0{constructor(e={}){super(),this.name=FPe,this.url="https://trustwallet.com",this.icon="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMTkyMCAxMDgwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6dXJsKCNsaW5lYXItZ3JhZGllbnQpO30uY2xzLTJ7ZmlsbDojMDUwMGZmO308L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50IiB4MT0iMTEyMy4yNiIgeTE9IjE4NjUuNzgiIHgyPSI5NTQuNjEiIHkyPSIxMzM3LjUiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAyMTgyKSBzY2FsZSgxIC0xKSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIG9mZnNldD0iLjAyIiBzdG9wLWNvbG9yPSJibHVlIi8+PHN0b3Agb2Zmc2V0PSIuMDgiIHN0b3AtY29sb3I9IiMwMDk0ZmYiLz48c3RvcCBvZmZzZXQ9Ii4xNiIgc3RvcC1jb2xvcj0iIzQ4ZmY5MSIvPjxzdG9wIG9mZnNldD0iLjQyIiBzdG9wLWNvbG9yPSIjMDA5NGZmIi8+PHN0b3Agb2Zmc2V0PSIuNjgiIHN0b3AtY29sb3I9IiMwMDM4ZmYiLz48c3RvcCBvZmZzZXQ9Ii45IiBzdG9wLWNvbG9yPSIjMDUwMGZmIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0yIiBkPSJtNzM4LjcxLDQyMy40MWwyMjEuNDUtNzIuM3Y1MDAuNTJjLTE1OC4xOC02Ni43NC0yMjEuNDUtMTk0LjY1LTIyMS40NS0yNjYuOTR2LTE2MS4yOFoiLz48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Im0xMTgxLjYyLDQyMy40MWwtMjIxLjQ1LTcyLjN2NTAwLjUyYzE1OC4xOC02Ni43NCwyMjEuNDUtMTk0LjY1LDIyMS40NS0yNjYuOTR2LTE2MS4yOFoiLz48cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Im04MjUuOTEsMjMwLjg1
1015aDMwLjl2MTcuMzFjMTAuMTMtMTUuNTYsMjEuNzgtMTcuMzEsMzguODQtMTcuMzF2MzAuNmgtNy43N2MtMjAuNDQsMC0zMC4yMyw5LjYyLTMwLjIzLDI4LjY3djMyLjUyaC0zMS43NXYtOTEuNzlaIi8+PHBhdGggY2xhc3M9ImNscy0yIiBkPSJtOTk4Ljc4LDMyMi42M2gtMzEuNzV2LTguNzVjLTYuOTMsOC4wNS0xNi4zOCwxMS41NC0yOC4wMywxMS41NC0yMi4xMiwwLTM0LjYyLTEzLjExLTM0LjYyLTM3LjI0di01Ny4zNGgzMS43NXY1MC4xOGMwLDExLjM2LDUuNTcsMTgsMTUuMDIsMThzMTUuODgtNi40NywxNS44OC0xNy40OHYtNTAuN2gzMS43NXY5MS43OVoiLz48cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Im0xMDA2LjU0LDI5NC4zaDI5LjczYzEuMzYsNi42NCw1LjkxLDkuNDMsMTYuODgsOS40Myw4Ljk1LDAsMTQuMTktMi4wOSwxNC4xOS01Ljk0LDAtMi45OC0yLjU0LTQuOS05Ljc5LTYuNDdsLTIzLjk4LTUuNDJjLTE2LjA0LTMuNjYtMjQuMTUtMTIuOTMtMjQuMTUtMjcuOCwwLTE5LjU5LDE0LjM1LTI5LjczLDQyLjIxLTI5LjczczQxLjU0LDkuODgsNDMuOTEsMzEuMDRoLTI5LjU1Yy0uNS01LjU5LTYuMjUtOS4wMS0xNS43LTkuMDEtNy41OSwwLTEyLjQ5LDIuNDQtMTIuNDksNi4xMiwwLDMuMTQsMy4yLDUuNTksOS42Myw3LjE4bDI1LjE2LDYuMTJjMTYuNTQsNC4wMSwyNC40OSwxMi40MSwyNC40OSwyNi4wNSwwLDE4Ljg5LTE2LjM4LDMwLjA4LTQ0LjIzLDMwLjA4cy00Ni4yNy0xMi4wNi00Ni4yNy0zMS42NWgtLjAzWiIvPjxwYXRoIGNsYXNzPSJjbHMtMiIgZD0ibTExODEuNjIsMjU5LjR2LTI4LjU1aC03OC4zNXYyOC41NmgyMy4zOHY2My4yMmgzMS41OHYtNjMuMjRoMjMuMzlaIi8+PHBhdGggY2xhc3M9ImNscy0yIiBkPSJtODE3LjA4LDI1OS40di0yOC41NWgtNzguMzV2MjguNTZoMjMuMzh2NjMuMjJoMzEuNTh2LTYzLjI0aDIzLjM4WiIvPjwvc3ZnPg==",this.supportedTransactionVersions=null,this._readyState=typeof window>"u"||typeof document>"u"?wn.Unsupported:wn.NotDetected,this._disconnected=()=>{const t=this._wallet;t&&(t.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("error",new eb),this.emit("disconnect"))},this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==wn.Unsupported&&N0(()=>{var t,r;return(r=(t=window.trustwallet)==null?void 0:t.solana)!=null&&r.isTrust?(this._readyState=wn.Installed,this.emit("readyStateChange",this._readyState),!0):!1})}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get connected(){var e;return!!((e=this._wallet)!=null&&e.isConnected)}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==wn.Installed)throw new ih;this._connecting=!0;const e=window.trustwallet.solana;if(!e.isConnected)try{await e.connect()}catch(r){throw new w0(r==null?void 0:r.message,r)}if(!e.publicKey)throw new Xl;let t;try{t=new bt(e.publicKey.toBytes())}catch(r){throw new sh(r==null?void 0:r.message,r)}e.on("disconnect",this._disconnected),this._wallet=e,this._publicKey=t,this.emit("connect",t)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(t){this.emit("error",new _g(t==null?void 0:t.message,t))}}this.emit("disconnect")}async sendTransaction(e,t,r={}){try{const i=this._wallet;if(!i)throw new hr;try{const{signers:s,...o}=r;e=await this.prepareTransaction(e,t,o),s!=null&&s.length&&e.partialSign(...s),o.preflightCommitment=o.preflightCommitment||t.commitment;const{signature:a}=await i.signAndSendTransaction(e,o);return a}catch(s){throw s instanceof eo?s:new Fu(s==null?void 0:s.message,s)}}catch(i){throw this.emit("error",i),i}}async signTransaction(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signTransaction(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signAllTransactions(e)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signMessage(e){try{const t=this._wallet;if(!t)throw new hr;try{const{signature:r}=await t.signMessage(e);return r}catch(r){throw new tb(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}}const WPe="da8c7c317018211f30040492b8770a38",dP={name:"YUPFUN",description:"YUPFUN Swap",url:"https://yup.fun",icons:["https://yup.fun/cryptos/yupfun-logo.png"],redirect:{native:"phantom://",universal:"https://yup.fun"}},Sie=[$_],MI={solflare:{mobile:n=>`solflare://browse/${encodeURIComponent(n)}`,desktop:"https://solflare.com/"},nightly:{mobile:n=>`nightly://v1?network=solana&url=${encodeURIComponent(n+"?nightly_deeplink=true")}`,desktop:"https://nightly.app/"}},HPe=new SPe({wallets:[new TU,new IU,new CU,new NU],networks:Sie}),_ie=typeof window<"u"?sIe({projectId:WPe,networks:Sie,metadata:dP,adapters:[HPe],features:{anal
1015ytics:!1},defaultWallets:["coinbaseWallet","phantom","backpack","solflare","trustWallet","nightly","glow","magicEden"],storageOptions:{storage:typeof window<"u"?window.localStorage:void 0},qrModalOptions:{themeMode:"dark"},customWallets:[{id:"solflare",name:"Solflare",homepage:"https://solflare.com/",image_url:"https://yup.fun/logos/solflare-logo.png",mobile_link:MI.solflare.mobile(dP.url),desktop_link:MI.solflare.desktop,app_store:"https://apps.apple.com/app/solflare/id1569391969",play_store:"https://play.google.com/store/apps/details?id=com.solflare.mobile"},{id:"nightly",name:"Nightly",homepage:"https://nightly.app/",image_url:"https://yup.fun/logos/nightly-logo.png",mobile_link:MI.nightly.mobile(dP.url),desktop_link:MI.nightly.desktop,app_store:"https://apps.apple.com/app/nightly-wallet/id6444625622",play_store:"https://play.google.com/store/apps/details?id=com.nightlymobile"}]}):null;typeof window<"u"&&(window.reown=window.reown||{},window.reown.appKit=_ie,window.reown.autoConnect=!1,window.reown.enableMobile=!0);const rf={coinbaseWallet:{name:"Coinbase Wallet",icon:"https://cryptologos.cc/logos/coinbase-coin-logo.png"},phantom:{name:"Phantom",icon:"https://cryptologos.cc/logos/phantom-phm-logo.png"},backpack:{name:"Backpack",icon:"https://backpack.app/favicon.ico"},solflare:{name:"Solflare",icon:"https://solflare.com/favicon.ico"},trustWallet:{name:"Trust Wallet",icon:"https://trustwallet.com/favicon.ico"},nightly:{name:"Nightly",icon:"https://nightly.app/favicon.ico"},glow:{name:"Glow",icon:"https://glow.app/favicon.ico"},magicEden:{name:"Magic Eden",icon:"https://magiceden.io/favicon.ico"}},Du=_ie;/** 1016 * react-router v7.7.1 1017 * 1018 * Copyright (c) Remix Software Inc. 1019 * 1020 * This source code is licensed under the MIT license found in the 1021 * LICENSE.md file in the root directory of this source tree. 1022 * 1023 * @license MIT 1024 */var Jq="popstate";function VPe(n={}){function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return vB("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function t(r,i){return typeof i=="string"?i:V_(i)}return KPe(e,t,null,n)}function ms(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function oh(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function qPe(){return Math.random().toString(36).substring(2,10)}function eK(n,e){return{usr:n.state,key:n.key,idx:e}}function vB(n,e,t=null,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof e=="string"?cE(e):e,state:t,key:e&&e.key||r||qPe()}}function V_({pathname:n="/",search:e="",hash:t=""}){return e&&e!=="?"&&(n+=e.charAt(0)==="?"?e:"?"+e),t&&t!=="#"&&(n+=t.charAt(0)==="#"?t:"#"+t),n}function cE(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substring(t),n=n.substring(0,t));let r=n.indexOf("?");r>=0&&(e.search=n.substring(r),n=n.substring(0,r)),n&&(e.pathname=n)}return e}function KPe(n,e,t,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a="POP",c=null,u=d();u==null&&(u=0,o.replaceState({...o.state,idx:u},""));function d(){return(o.state||{idx:null}).idx}function f(){a="POP";let E=d(),T=E==null?null:E-u;u=E,c&&c({action:a,location:b.location,delta:T})}function m(E,T){a="PUSH";let N=vB(b.location,E,T);u=d()+1;let I=eK(N,u),H=b.createHref(N);try{o.pushState(I,"",H)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;i.location.assign(H)}s&&c&&c({action:a,location:b.location,delta:1})}function w(E,T){a="REPLACE";let N=vB(b.location,E,T);u=d();let I=eK(N,u),H=b.createHref(N);o.replaceState(I,"",H),s&&c&&c({action:a,location:b.location,delta:0})}function y(E){return YPe(E)}let b={get action(){return a},get location(){return n(i,o)},listen(E){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Jq,f),c=E,()=>{i.removeEventListener(Jq,f),c=null}},createHref(E){return e(i,E)},createURL:y,encodeLocation(E){let T=y(E);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:m,replace:w,go(E){return o.go(E)}};return b}function YPe(n,e=!1){let t="http://localhost";
1024typeof window<"u"&&(t=window.location.origin!=="null"?window.location.origin:window.location.href),ms(t,"No window.location.(origin|href) available to create URL");let r=typeof n=="string"?n:V_(n);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=t+r),new URL(r,t)}function Cie(n,e,t="/"){return GPe(n,e,t,!1)}function GPe(n,e,t,r){let i=typeof e=="string"?cE(e):e,s=hg(i.pathname||"/",t);if(s==null)return null;let o=Tie(n);ZPe(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let u=a9e(s);a=s9e(o[c],u,r)}return a}function Tie(n,e=[],t=[],r=""){let i=(s,o,a)=>{let c={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(ms(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=og([r,c.relativePath]),d=t.concat(c);s.children&&s.children.length>0&&(ms(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),Tie(s.children,e,d,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:r9e(u,s.index),routesMeta:d})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let c of Iie(s.path))i(s,o,c)}),e}function Iie(n){let e=n.split("/");if(e.length===0)return[];let[t,...r]=e,i=t.endsWith("?"),s=t.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=Iie(r.join("/")),a=[];return a.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&a.push(...o),a.map(c=>n.startsWith("/")&&c===""?"/":c)}function ZPe(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:i9e(e.routesMeta.map(r=>r.childrenIndex),t.routesMeta.map(r=>r.childrenIndex)))}var QPe=/^:[\w-]+$/,XPe=3,JPe=2,e9e=1,t9e=10,n9e=-2,tK=n=>n==="*";function r9e(n,e){let t=n.split("/"),r=t.length;return t.some(tK)&&(r+=n9e),e&&(r+=JPe),t.filter(i=>!tK(i)).reduce((i,s)=>i+(QPe.test(s)?XPe:s===""?e9e:t9e),r)}function i9e(n,e){return n.length===e.length&&n.slice(0,-1).every((r,i)=>r===e[i])?n[n.length-1]-e[e.length-1]:0}function s9e(n,e,t=!1){let{routesMeta:r}=n,i={},s="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],u=a===r.length-1,d=s==="/"?e:e.slice(s.length)||"/",f=ON({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),m=c.route;if(!f&&u&&t&&!r[r.length-1].route.index&&(f=ON({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;
1024Object.assign(i,f.params),o.push({params:i,pathname:og([s,f.pathname]),pathnameBase:d9e(og([s,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(s=og([s,f.pathnameBase]))}return o}function ON(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,r]=o9e(n.path,n.caseSensitive,n.end),i=e.match(t);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,{paramName:d,isOptional:f},m)=>{if(d==="*"){let y=a[m]||"";o=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const w=a[m];return f&&!w?u[d]=void 0:u[d]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:n}}function o9e(n,e=!1,t=!0){oh(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let r=[],i="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(r.push({paramName:"*"}),i+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?i+="\\/*$":n!==""&&n!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function a9e(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return oh(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),n}}function hg(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,r=n.charAt(t);return r&&r!=="/"?null:n.slice(t)||"/"}function c9e(n,e="/"){let{pathname:t,search:r="",hash:i=""}=typeof n=="string"?cE(n):n;return{pathname:t?t.startsWith("/")?t:l9e(t,e):e,search:h9e(r),hash:f9e(i)}}function l9e(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(i=>{i===".."?t.length>1&&t.pop():i!=="."&&t.push(i)}),t.length>1?t.join("/"):"/"}function hP(n,e,t,r){return`Cannot include a '${n}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function u9e(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function RU(n){let e=u9e(n);return e.map((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)}function MU(n,e,t,r=!1){let i;typeof n=="string"?i=cE(n):(i={...n},ms(!i.pathname||!i.pathname.includes("?"),hP("?","pathname","search",i)),ms(!i.pathname||!i.pathname.includes("#"),hP("#","pathname","hash",i)),ms(!i.search||!i.search.includes("#"),hP("#","search","hash",i)));let s=n===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=t;else{let f=e.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;i.pathname=m.join("/")}a=f>=0?e[f]:"/"}let c=c9e(i,a),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&t.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}var og=n=>n.join("/").replace(/\/\/+/g,"/"),d9e=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),h9e=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,f9e=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function p9e(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}var Nie=["POST","PUT","PATCH","DELETE"];new Set(Nie);var g9e=["GET",...Nie];new Set(g9e);var lE=X.createContext(null);lE.displayName="DataRouter";var ER=X.createContext(null);ER.displayName="DataRouterState";X.createContext(!1);var Rie=X.createContext({isTransitioning:!1});Rie.displayName="ViewTransition";var m9e=X.createContext(new Map);m9e.displayName="Fetchers";var w9e=X.createContext(null);w9e.displayName="Await";var hh=X.createContext(null);hh.displayName="Navigation";var r4=X.createContext(null);r4.displayName="Location";var fh=X.createContext({outlet:null,matches:[],isDataRoute:!1});fh.displayName="Route";var kU=X.createContext(null);kU.displayName="RouteError";function y9e(n,{relative:e}={}){ms(uE(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:r}=X.useContext(hh),{hash:i,pathname:s,search:o}=i4(n,{relative:e}),a=s;
1024return t!=="/"&&(a=s==="/"?t:og([t,s])),r.createHref({pathname:a,search:o,hash:i})}function uE(){return X.useContext(r4)!=null}function M0(){return ms(uE(),"useLocation() may be used only in the context of a <Router> component."),X.useContext(r4).location}var Mie="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kie(n){X.useContext(hh).static||X.useLayoutEffect(n)}function OU(){let{isDataRoute:n}=X.useContext(fh);return n?k9e():b9e()}function b9e(){ms(uE(),"useNavigate() may be used only in the context of a <Router> component.");let n=X.useContext(lE),{basename:e,navigator:t}=X.useContext(hh),{matches:r}=X.useContext(fh),{pathname:i}=M0(),s=JSON.stringify(RU(r)),o=X.useRef(!1);return kie(()=>{o.current=!0}),X.useCallback((c,u={})=>{if(oh(o.current,Mie),!o.current)return;if(typeof c=="number"){t.go(c);return}let d=MU(c,JSON.parse(s),i,u.relative==="path");n==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:og([e,d.pathname])),(u.replace?t.replace:t.push)(d,u.state,u)},[e,t,s,i,n])}X.createContext(null);function v9e(){let{matches:n}=X.useContext(fh),e=n[n.length-1];return e?e.params:{}}function i4(n,{relative:e}={}){let{matches:t}=X.useContext(fh),{pathname:r}=M0(),i=JSON.stringify(RU(t));return X.useMemo(()=>MU(n,JSON.parse(i),r,e==="path"),[n,i,r,e])}function x9e(n,e){return Oie(n,e)}function Oie(n,e,t,r){var T;ms(uE(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=X.useContext(hh),{matches:s}=X.useContext(fh),o=s[s.length-1],a=o?o.params:{},c=o?o.pathname:"/",u=o?o.pathnameBase:"/",d=o&&o.route;{let N=d&&d.path||"";Pie(c,!d||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 1025 1026Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let f=M0(),m;if(e){let N=typeof e=="string"?cE(e):e;ms(u==="/"||((T=N.pathname)==null?void 0:T.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${N.pathname}" was given in the \`location\` prop.`),m=N}else m=f;let w=m.pathname||"/",y=w;if(u!=="/"){let N=u.replace(/^\//,"").split("/");y="/"+w.replace(/^\//,"").split("/").slice(N.length).join("/")}let b=Cie(n,{pathname:y});oh(d||b!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),oh(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=C9e(b&&b.map(N=>Object.assign({},N,{params:Object.assign({},a,N.params),pathname:og([u,i.encodeLocation?i.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?u:og([u,i.encodeLocation?i.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),s,t,r);return e&&E?X.createElement(r4.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...m},navigationType:"POP"}},E):E}function E9e(){let n=M9e(),e=p9e(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",n),o=X.createElement(X.Fragment,null,X.createElement("p",null,"ð¿ Hey developer ð"),X.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",X.createElement("code",{style:s},"ErrorBoundary")," or"," ",X.createElement("code",{style:s},"errorElement")," prop on your route.")),X.createElement(X.Fragment,null,X.createElement("h2",null,"Unexpected Application
1026Error!"),X.createElement("h3",{style:{fontStyle:"italic"}},e),t?X.createElement("pre",{style:i},t):null,o)}var A9e=X.createElement(E9e,null),S9e=class extends X.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,e){return e.location!==n.location||e.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:e.error,location:e.location,revalidation:n.revalidation||e.revalidation}}componentDidCatch(n,e){console.error("React Router caught the following error during render",n,e)}render(){return this.state.error!==void 0?X.createElement(fh.Provider,{value:this.props.routeContext},X.createElement(kU.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function _9e({routeContext:n,match:e,children:t}){let r=X.useContext(lE);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),X.createElement(fh.Provider,{value:n},t)}function C9e(n,e=[],t=null,r=null){if(n==null){if(!t)return null;if(t.errors)n=t.matches;else if(e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let i=n,s=t==null?void 0:t.errors;if(s!=null){let c=i.findIndex(u=>u.route.id&&(s==null?void 0:s[u.route.id])!==void 0);ms(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,c+1))}let o=!1,a=-1;if(t)for(let c=0;c<i.length;c++){let u=i[c];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(a=c),u.route.id){let{loaderData:d,errors:f}=t,m=u.route.loader&&!d.hasOwnProperty(u.route.id)&&(!f||f[u.route.id]===void 0);if(u.route.lazy||m){o=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((c,u,d)=>{let f,m=!1,w=null,y=null;t&&(f=s&&u.route.id?s[u.route.id]:void 0,w=u.route.errorElement||A9e,o&&(a<0&&d===0?(Pie("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,y=null):a===d&&(m=!0,y=u.route.hydrateFallbackElement||null)));let b=e.concat(i.slice(0,d+1)),E=()=>{let T;return f?T=w:m?T=y:u.route.Component?T=X.createElement(u.route.Component,null):u.route.element?T=u.route.element:T=c,X.createElement(_9e,{match:u,routeContext:{outlet:c,matches:b,isDataRoute:t!=null},children:T})};return t&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?X.createElement(S9e,{location:t.location,revalidation:t.revalidation,component:w,error:f,children:E(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):E()},null)}function PU(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function T9e(n){let e=X.useContext(lE);return ms(e,PU(n)),e}function I9e(n){let e=X.useContext(ER);return ms(e,PU(n)),e}function N9e(n){let e=X.useContext(fh);return ms(e,PU(n)),e}function DU(n){let e=N9e(n),t=e.matches[e.matches.length-1];return ms(t.route.id,`${n} can only be used on routes that contain a unique "id"`),t.route.id}function R9e(){return DU("useRouteId")}function M9e(){var r;let n=X.useContext(kU),e=I9e("useRouteError"),t=DU("useRouteError");return n!==void 0?n:(r=e.errors)==null?void 0:r[t]}function k9e(){let{router:n}=T9e("useNavigate"),e=DU("useNavigate"),t=X.useRef(!1);return kie(()=>{t.current=!0}),X.useCallback(async(i,s={})=>{oh(t.current,Mie),t.current&&(typeof i=="number"?n.navigate(i):await n.navigate(i,{fromRouteId:e,...s}))},[n,e])}var nK={};function Pie(n,e,t){!e&&!nK[n]&&(nK[n]=!0,oh(!1,t))}X.memo(O9e);function O9e({routes:n,future:e,state:t}){return Oie(n,void 0,t,e)}function fc({to:n,replace:e,state:t,relative:r}){ms(uE(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=X.useContext(hh);oh(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=X.useContext(fh),{pathname:o}=M0(),a=OU(),c=MU(n,RU(s),o,r==="path"),u=JSON.stringify(c);return X.useEffect(()=>{a(JSON.parse(u),{replace:e,state:t,relative:r})},[a,u,r,e,t]),null}function Xr(n){ms(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function P9e({basename:n="/",children:e=null,location:t,navigationType:r="POP",navigator:i,static:s=!1}
1026){ms(!uE(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=n.replace(/^\/*/,"/"),a=X.useMemo(()=>({basename:o,navigator:i,static:s,future:{}}),[o,i,s]);typeof t=="string"&&(t=cE(t));let{pathname:c="/",search:u="",hash:d="",state:f=null,key:m="default"}=t,w=X.useMemo(()=>{let y=hg(c,o);return y==null?null:{location:{pathname:y,search:u,hash:d,state:f,key:m},navigationType:r}},[o,c,u,d,f,m,r]);return oh(w!=null,`<Router basename="${o}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:X.createElement(hh.Provider,{value:a},X.createElement(r4.Provider,{children:e,value:w}))}function D9e({children:n,location:e}){return x9e(xB(n),e)}function xB(n,e=[]){let t=[];return X.Children.forEach(n,(r,i)=>{if(!X.isValidElement(r))return;let s=[...e,i];if(r.type===X.Fragment){t.push.apply(t,xB(r.props.children,s));return}ms(r.type===Xr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ms(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||s.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,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||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=xB(r.props.children,s)),t.push(o)}),t}var T6="get",I6="application/x-www-form-urlencoded";function AR(n){return n!=null&&typeof n.tagName=="string"}function B9e(n){return AR(n)&&n.tagName.toLowerCase()==="button"}function L9e(n){return AR(n)&&n.tagName.toLowerCase()==="form"}function $9e(n){return AR(n)&&n.tagName.toLowerCase()==="input"}function U9e(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function j9e(n,e){return n.button===0&&(!e||e==="_self")&&!U9e(n)}var kI=null;function z9e(){if(kI===null)try{new FormData(document.createElement("form"),0),kI=!1}catch{kI=!0}return kI}var F9e=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function fP(n){return n!=null&&!F9e.has(n)?(oh(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${I6}"`),null):n}function W9e(n,e){let t,r,i,s,o;if(L9e(n)){let a=n.getAttribute("action");r=a?hg(a,e):null,t=n.getAttribute("method")||T6,i=fP(n.getAttribute("enctype"))||I6,s=new FormData(n)}else if(B9e(n)||$9e(n)&&(n.type==="submit"||n.type==="image")){let a=n.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=n.getAttribute("formaction")||a.getAttribute("action");if(r=c?hg(c,e):null,t=n.getAttribute("formmethod")||a.getAttribute("method")||T6,i=fP(n.getAttribute("formenctype"))||fP(a.getAttribute("enctype"))||I6,s=new FormData(a,n),!z9e()){let{name:u,type:d,value:f}=n;if(d==="image"){let m=u?`${u}.`:"";s.append(`${m}x`,"0"),s.append(`${m}y`,"0")}else u&&s.append(u,f)}}else{if(AR(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=T6,r=null,i=I6,o=n}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:t.toLowerCase(),encType:i,formData:s,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function BU(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function H9e(n,e,t){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return r.pathname==="/"?r.pathname=`_root.${t}`:e&&hg(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${t}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${t}`,r}async function V9e(n,e){if(n.id in e)return e[n.id];try{let t=await import(n.module);return e[n.id]=t,t}catch(t){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.
1026isSpaMode,window.location.reload(),new Promise(()=>{})}}function q9e(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function K9e(n,e,t){let r=await Promise.all(n.map(async i=>{let s=e.routes[i.route.id];if(s){let o=await V9e(s,t);return o.links?o.links():[]}return[]}));return Q9e(r.flat(1).filter(q9e).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function rK(n,e,t,r,i,s){let o=(c,u)=>t[u]?c.route.id!==t[u].route.id:!0,a=(c,u)=>{var d;return t[u].pathname!==c.pathname||((d=t[u].route.path)==null?void 0:d.endsWith("*"))&&t[u].params["*"]!==c.params["*"]};return s==="assets"?e.filter((c,u)=>o(c,u)||a(c,u)):s==="data"?e.filter((c,u)=>{var f;let d=r.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(o(c,u)||a(c,u))return!0;if(c.route.shouldRevalidate){let m=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((f=t[0])==null?void 0:f.params)||{},nextUrl:new URL(n,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function Y9e(n,e,{includeHydrateFallback:t}={}){return G9e(n.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),t&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function G9e(n){return[...new Set(n)]}function Z9e(n){let e={},t=Object.keys(n).sort();for(let r of t)e[r]=n[r];return e}function Q9e(n,e){let t=new Set;return new Set(e),n.reduce((r,i)=>{let s=JSON.stringify(Z9e(i));return t.has(s)||(t.add(s),r.push({key:s,link:i})),r},[])}function Die(){let n=X.useContext(lE);return BU(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function X9e(){let n=X.useContext(ER);return BU(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var LU=X.createContext(void 0);LU.displayName="FrameworkContext";function Bie(){let n=X.useContext(LU);return BU(n,"You must render this element inside a <HydratedRouter> element"),n}function J9e(n,e){let t=X.useContext(LU),[r,i]=X.useState(!1),[s,o]=X.useState(!1),{onFocus:a,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=e,m=X.useRef(null);X.useEffect(()=>{if(n==="render"&&o(!0),n==="viewport"){let b=T=>{T.forEach(N=>{o(N.isIntersecting)})},E=new IntersectionObserver(b,{threshold:.5});return m.current&&E.observe(m.current),()=>{E.disconnect()}}},[n]),X.useEffect(()=>{if(r){let b=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(b)}}},[r]);let w=()=>{i(!0)},y=()=>{i(!1),o(!1)};return t?n!=="intent"?[s,m,{}]:[s,m,{onFocus:kA(a,w),onBlur:kA(c,y),onMouseEnter:kA(u,w),onMouseLeave:kA(d,y),onTouchStart:kA(f,w)}]:[!1,m,{}]}function kA(n,e){return t=>{n&&n(t),t.defaultPrevented||e(t)}}function eDe({page:n,...e}){let{router:t}=Die(),r=X.useMemo(()=>Cie(t.routes,n,t.basename),[t.routes,n,t.basename]);return r?X.createElement(nDe,{page:n,matches:r,...e}):null}function tDe(n){let{manifest:e,routeModules:t}=Bie(),[r,i]=X.useState([]);return X.useEffect(()=>{let s=!1;return K9e(n,e,t).then(o=>{s||i(o)}),()=>{s=!0}},[n,e,t]),r}function nDe({page:n,matches:e,...t}){let r=M0(),{manifest:i,routeModules:s}=Bie(),{basename:o}=Die(),{loaderData:a,matches:c}=X9e(),u=X.useMemo(()=>rK(n,e,c,i,r,"data"),[n,e,c,i,r]),d=X.useMemo(()=>rK(n,e,c,i,r,"assets"),[n,e,c,i,r]),f=X.useMemo(()=>{if(n===r.pathname+r.search+r.hash)return[];let y=new Set,b=!1;if(e.forEach(T=>{var I;let N=i.routes[T.route.id];!N||!N.hasLoader||(!u.some(H=>H.route.id===T.route.id)&&T.route.id in a&&((I=s[T.route.id])!=null&&I.shouldRevalidate)||N.hasClientLoader?b=!0:y.add(T.route.id))}),y.size===0)return[];let E=H9e(n,o,"data");return b&&y.size>0&&E.searchParams.set("_routes",e.filter(T=>y.has(T.route.id)).map(T=>T.route.id).join(",")),[E.pathname+E.search]},[o,a,r,i,u,e,n,s]),m=X.useMemo(()=>Y9e(d,i),[d,i]),w=tDe(d);return X.createElement(X.Fragment,null,f.map(y=>X.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...t})),m.map(y=>X.createElement("link",{key:y,rel:"modulepreload",href:y,...t})),w.map(({key:y,link:b})=>X.createElement("link",{key:y,...b})))}function rDe(...n){return e=>
1026{n.forEach(t=>{typeof t=="function"?t(e):t!=null&&(t.current=e)})}}var Lie=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Lie&&(window.__reactRouterVersion="7.7.1")}catch{}function iDe({basename:n,children:e,window:t}){let r=X.useRef();r.current==null&&(r.current=VPe({window:t,v5Compat:!0}));let i=r.current,[s,o]=X.useState({action:i.action,location:i.location}),a=X.useCallback(c=>{X.startTransition(()=>o(c))},[o]);return X.useLayoutEffect(()=>i.listen(a),[i,a]),X.createElement(P9e,{basename:n,children:e,location:s.location,navigationType:s.action,navigator:i})}var $ie=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Oo=X.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:c,to:u,preventScrollReset:d,viewTransition:f,...m},w){let{basename:y}=X.useContext(hh),b=typeof u=="string"&&$ie.test(u),E,T=!1;if(typeof u=="string"&&b&&(E=u,Lie))try{let k=new URL(window.location.href),j=u.startsWith("//")?new URL(k.protocol+u):new URL(u),V=hg(j.pathname,y);j.origin===k.origin&&V!=null?u=V+j.search+j.hash:T=!0}catch{oh(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let N=y9e(u,{relative:i}),[I,H,L]=J9e(r,m),U=cDe(u,{replace:o,state:a,target:c,preventScrollReset:d,relative:i,viewTransition:f});function K(k){e&&e(k),k.defaultPrevented||U(k)}let Y=X.createElement("a",{...m,...L,href:E||N,onClick:T||s?e:K,ref:rDe(w,H),target:c,"data-discover":!b&&t==="render"?"true":void 0});return I&&!b?X.createElement(X.Fragment,null,Y,X.createElement(eDe,{page:N})):Y});Oo.displayName="Link";var sDe=X.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:c,...u},d){let f=i4(o,{relative:u.relative}),m=M0(),w=X.useContext(ER),{navigator:y,basename:b}=X.useContext(hh),E=w!=null&&fDe(f)&&a===!0,T=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,N=m.pathname,I=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;t||(N=N.toLowerCase(),I=I?I.toLowerCase():null,T=T.toLowerCase()),I&&b&&(I=hg(I,b)||I);const H=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let L=N===T||!i&&N.startsWith(T)&&N.charAt(H)==="/",U=I!=null&&(I===T||!i&&I.startsWith(T)&&I.charAt(T.length)==="/"),K={isActive:L,isPending:U,isTransitioning:E},Y=L?e:void 0,k;typeof r=="function"?k=r(K):k=[r,L?"active":null,U?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let j=typeof s=="function"?s(K):s;return X.createElement(Oo,{...u,"aria-current":Y,className:k,ref:d,style:j,to:o,viewTransition:a},typeof c=="function"?c(K):c)});sDe.displayName="NavLink";var oDe=X.forwardRef(({discover:n="render",fetcherKey:e,navigate:t,reloadDocument:r,replace:i,state:s,method:o=T6,action:a,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:f,...m},w)=>{let y=dDe(),b=hDe(a,{relative:u}),E=o.toLowerCase()==="get"?"get":"post",T=typeof a=="string"&&$ie.test(a),N=I=>{if(c&&c(I),I.defaultPrevented)return;I.preventDefault();let H=I.nativeEvent.submitter,L=(H==null?void 0:H.getAttribute("formmethod"))||o;y(H||I.currentTarget,{fetcherKey:e,method:L,navigate:t,replace:i,state:s,relative:u,preventScrollReset:d,viewTransition:f})};return X.createElement("form",{ref:w,method:E,action:b,onSubmit:r?c:N,...m,"data-discover":!T&&n==="render"?"true":void 0})});oDe.displayName="Form";function aDe(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Uie(n){let e=X.useContext(lE);return ms(e,aDe(n)),e}function cDe(n,{target:e,replace:t,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=OU(),c=M0(),u=i4(n,{relative:s});return X.useCallback(d=>{if(j9e(d,e)){d.preventDefault();let f=t!==void 0?t:V_(c)===V_(u);a(n,{replace:f,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[c,a,u,t,r,e,n,i,s,o])}var lDe=0,uDe=()=>`__${String(++lDe)}__`;function dDe(){let{router:n}=Uie("useSubmit"),{basename:e}=X.useContext(hh),t=R9e();return X.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:c,body:u}=W9e(r,e);if(i.navigate===!1){let d=i.fetcherKey||uDe();await n.fetch(d,t,i.action||s,{preventScrollReset:i.preventScrollReset,formData:c,body:u,formMethod:i.method||o,formEncType:i.encType||a,flushSync:i.flushSync})}else await n.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:c,body:u,formMethod:i.method||o,formEncType:i.encType||a,replace:i.replace,state:i.state,fromRouteId:t,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,e,t])}function hDe(n,{relative:e}={}){let{basename:t}=X.useContext(hh),r=X.useContext(fh);ms(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...i4(n||".",{relative:e})},o=M0();if(n==null){s.search=o.search;let a=new URLSearchParams(s.search),c=a.getAll("index");if(c.some(d=>d==="")){a.delete("index"),c.filter(f=>f).forEach(f=>a.append("index",f));let d=a.toString();s.search=d?`?${d}`:""}}return(!n||n===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(s.pathname=s.pathname==="/"?t:og([t,s.pathname])),V_(s)}function fDe(n,{relative:e}={}){let t=X.useContext(Rie);ms(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Uie("useViewTransitionState"),i=i4(n,{relative:e});if(!t.isTransitioning)return!1;let s=hg(t.currentLocation.pathname,r)||t.currentLocation.pathname,o=hg(t.nextLocation.pathname,r)||t.nextLocation.pathname;return ON(i.pathname,o)!=null||ON(i.pathname,s)!=null}var y0=EX();const jie=X.createContext({});function zie(){return X.useContext(jie)}const pDe=({children:n,endpoint:e,config:t={commitment:"confirmed"}})=>{const r=X.useMemo(()=>new mR(e,t),[e,t]);
1026return Qn.createElement(jie.Provider,{value:{connection:r}},n)};class iK extends eo{constructor(){super(...arguments),this.name="WalletNotSelectedError"}}const gDe=[],SR={autoConnect:!1,connecting:!1,connected:!1,disconnecting:!1,select(){zd("call","select")},connect(){return Promise.reject(zd("call","connect"))},disconnect(){return Promise.reject(zd("call","disconnect"))},sendTransaction(){return Promise.reject(zd("call","sendTransaction"))},signTransaction(){return Promise.reject(zd("call","signTransaction"))},signAllTransactions(){return Promise.reject(zd("call","signAllTransactions"))},signMessage(){return Promise.reject(zd("call","signMessage"))},signIn(){return Promise.reject(zd("call","signIn"))}};Object.defineProperty(SR,"wallets",{get(){return zd("read","wallets"),gDe}});Object.defineProperty(SR,"wallet",{get(){return zd("read","wallet"),null}});Object.defineProperty(SR,"publicKey",{get(){return zd("read","publicKey"),null}});function zd(n,e){const t=new Error(`You have tried to ${n} "${e}" on a WalletContext without providing one. Make sure to render a WalletProvider as an ancestor of the component that uses WalletContext.`);return console.error(t),t}const Fie=X.createContext(SR);function $U(){return X.useContext(Fie)}function mDe(n,e){const t=X.useState(()=>{try{const s=localStorage.getItem(n);if(s)return JSON.parse(s)}catch(s){typeof window<"u"&&console.error(s)}return e}),r=t[0],i=X.useRef(!0);return X.useEffect(()=>{if(i.current){i.current=!1;return}try{r===null?localStorage.removeItem(n):localStorage.setItem(n,JSON.stringify(r))}catch(s){typeof window<"u"&&console.error(s)}},[r,n]),t}var sf={},oy={},pc={},_r={},sK;function UU(){if(sK)return _r;sK=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.WalletWindowClosedError=_r.WalletWindowBlockedError=_r.WalletTimeoutError=_r.WalletSignInError=_r.WalletSignMessageError=_r.WalletSignTransactionError=_r.WalletSendTransactionError=_r.WalletNotConnectedError=_r.WalletKeypairError=_r.WalletPublicKeyError=_r.WalletAccountError=_r.WalletDisconnectionError=_r.WalletDisconnectedError=_r.WalletConnectionError=_r.WalletConfigError=_r.WalletLoadError=_r.WalletNotReadyError=_r.WalletError=void 0;class n extends Error{constructor(I,H){super(I),this.error=H}}_r.WalletError=n;class e extends n{constructor(){super(...arguments),this.name="WalletNotReadyError"}}_r.WalletNotReadyError=e;class t extends n{constructor(){super(...arguments),this.name="WalletLoadError"}}_r.WalletLoadError=t;class r extends n{constructor(){super(...arguments),this.name="WalletConfigError"}}_r.WalletConfigError=r;class i extends n{constructor(){super(...arguments),this.name="WalletConnectionError"}}_r.WalletConnectionError=i;class s extends n{constructor(){super(...arguments),this.name="WalletDisconnectedError"}}_r.WalletDisconnectedError=s;class o extends n{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}_r.WalletDisconnectionError=o;class a extends n{constructor(){super(...arguments),this.name="WalletAccountError"}}_r.WalletAccountError=a;class c extends n{constructor(){super(...arguments),this.name="WalletPublicKeyError"}}_r.WalletPublicKeyError=c;class u extends n{constructor(){super(...arguments),this.name="WalletKeypairError"}}_r.WalletKeypairError=u;class d extends n{constructor(){super(...arguments),this.name="WalletNotConnectedError"}}_r.WalletNotConnectedError=d;class f extends n{constructor(){super(...arguments),this.name="WalletSendTransactionError"}}_r.WalletSendTransactionError=f;class m extends n{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}_r.WalletSignTransactionError=m;class w extends n{constructor(){super(...arguments),this.name="WalletSignMessageError"}}_r.WalletSignMessageError=w;class y extends n{constructor(){super(...arguments),this.name="WalletSignInError"}}_r.WalletSignInError=y;class b extends n{constructor(){super(...arguments),this.name="WalletTimeoutError"}}_r.WalletTimeoutError=b;class E extends n{constructor(){super(...arguments),this.name="WalletWindowBlockedError"}}_r.WalletWindowBlockedError=E;class T extends n{constructor(){super(...arguments),this.name="WalletWindowClosedError"}}return _r.WalletWindowClosedError=T,_r}var oK;function Wie(){if(oK)return pc;oK=1;var n=pc&&pc.__awaiter||function(c,u,d,f){function m(w){return w instanceof d?w:new d(function(y){y(w)})}return new(d||(d=Promise))(function(w,y){function b(N){try{T(f.next(N))}catch(I){y(I)}}function E(N){try{T(f.throw(N))}catch(I){y(I)}}function T(N){N.done?w(N.value):m(N.value).then(b,E)}T((f=f.apply(c,u||[])).next())})},e=pc&&pc.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(pc,"__esModule",{value:!0}),pc.BaseWalletAdapter=pc.WalletReadyState=pc.EventEmitter=void 0,pc.scopePollingDetectionStrategy=o,pc.isIosAndRedirectable=a;const t=e($ne());pc.EventEmitter=t.default;const r=UU();var i;(function(c){c.Installed="Installed",c.NotDetected="NotDetected",c.Loadable="Loadable",c.Unsupported="Unsupported"})(i||(pc.WalletReadyState=i={}));class s extends t.default{get connected(){return!!this.publicKey}autoConnect(){return n(this,void 0,void 0,function*(){yield this.connect()})}prepareTransaction(u,d){return n(this,arguments,void 0,function*(f,m,w={}){const y=this.publicKey;if(!y)throw new r.WalletNotConnectedError;return f.feePayer=f.feePayer||y,f.recentBlockhash=f.recentBlockhash||(yield m.getLatestBlockhash({commitment:w.preflightCommitment,minContextSlot:w.minContextSlot})).blockhash,f})}}pc.BaseWalletAdapter=s;function o(c){if(typeof window>"u"||typeof document>"u")return;const u=[];function d(){if(c())for(const w of u)w()}const f=setInterval(d,1e3);u.push(()=>clearInterval(f)),document.readyState==="loading"&&(document.addEventListener("DOMContentLoaded",d,{once:!0}),u.push(()=>document.removeEventListener("DOMContentLoaded",d))),document.readyState!=="complete"&&(window.addEventListener("load",d,{once:!0}),u.push(()=>window.removeEventListener("load",d))),d()}function a(){if(!navigator)return!1;const c=navigator.userAgent.toLowerCase(),u=c.includes("iphone")||c.includes("ipad"),d=c.includes("safari");return u&&d}return pc}var zl={},OI={},aK;function Hie(){if(aK)return OI;aK=1,Object.defineProperty(OI,"__esModule",{value:!0}),OI.isVersionedTransaction=n;function n(e){return"version"in e}return OI}var cK;function wDe(){if(cK)return zl;cK=1;var n=zl&&zl.__awaiter||function(c,u,d,f){function m(w){return w instanceof d?w:new d(function(y){y(w)})}return new(d||(d=Promise))(function(w,y){function b(N){try{T(f.next(N))}catch(I){y(I)}}function E(N){try{T(f.throw(N))}catch(I){y(I)}}function T(N){N.done?w(N.value):m(N.value).then(b,E)}T((f=f.apply(c,u||[])).next())})},e=zl&&zl.__rest||function(c,u){var d={};for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&u.indexOf(f)<0&&(d[f]=c[f]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function")for(var m=0,f=Object.getOwnPropertySymbols(c);m<f.length;m++)u.indexOf(f[m])<0&&Object.prototype.propertyIsEnumerable.call(c,f[m])&&(d[f[m]]=c[f[m]]);return d};
1026Object.defineProperty(zl,"__esModule",{value:!0}),zl.BaseSignInMessageSignerWalletAdapter=zl.BaseMessageSignerWalletAdapter=zl.BaseSignerWalletAdapter=void 0;const t=Wie(),r=UU(),i=Hie();class s extends t.BaseWalletAdapter{sendTransaction(u,d){return n(this,arguments,void 0,function*(f,m,w={}){let y=!0;try{if((0,i.isVersionedTransaction)(f)){if(!this.supportedTransactionVersions)throw new r.WalletSendTransactionError("Sending versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(f.version))throw new r.WalletSendTransactionError(`Sending transaction version ${f.version} isn't supported by this wallet`);try{f=yield this.signTransaction(f);const b=f.serialize();return yield m.sendRawTransaction(b,w)}catch(b){throw b instanceof r.WalletSignTransactionError?(y=!1,b):new r.WalletSendTransactionError(b==null?void 0:b.message,b)}}else try{const{signers:b}=w,E=e(w,["signers"]);f=yield this.prepareTransaction(f,m,E),b!=null&&b.length&&f.partialSign(...b),f=yield this.signTransaction(f);const T=f.serialize();return yield m.sendRawTransaction(T,E)}catch(b){throw b instanceof r.WalletSignTransactionError?(y=!1,b):new r.WalletSendTransactionError(b==null?void 0:b.message,b)}}catch(b){throw y&&this.emit("error",b),b}})}signAllTransactions(u){return n(this,void 0,void 0,function*(){for(const f of u)if((0,i.isVersionedTransaction)(f)){if(!this.supportedTransactionVersions)throw new r.WalletSignTransactionError("Signing versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(f.version))throw new r.WalletSignTransactionError(`Signing transaction version ${f.version} isn't supported by this wallet`)}const d=[];for(const f of u)d.push(yield this.signTransaction(f));return d})}}zl.BaseSignerWalletAdapter=s;class o extends s{}zl.BaseMessageSignerWalletAdapter=o;class a extends o{}return zl.BaseSignInMessageSignerWalletAdapter=a,zl}var PI={},ay={},OA={},lK;function yDe(){return lK||(lK=1,Object.defineProperty(OA,"__esModule",{value:!0}),OA.SolanaSignAndSendTransaction=void 0,OA.SolanaSignAndSendTransaction="solana:signAndSendTransaction"),OA}var PA={},uK;function bDe(){return uK||(uK=1,Object.defineProperty(PA,"__esModule",{value:!0}),PA.SolanaSignIn=void 0,PA.SolanaSignIn="solana:signIn"),PA}var DA={},dK;function vDe(){return dK||(dK=1,Object.defineProperty(DA,"__esModule",{value:!0}),DA.SolanaSignMessage=void 0,DA.SolanaSignMessage="solana:signMessage"),DA}var BA={},hK;function xDe(){return hK||(hK=1,Object.defineProperty(BA,"__esModule",{value:!0}),BA.SolanaSignTransaction=void 0,BA.SolanaSignTransaction="solana:signTransaction"),BA}var LA={},fK;function EDe(){return fK||(fK=1,Object.defineProperty(LA,"__esModule",{value:!0}),LA.SignAndSendAllTransactions=void 0,LA.SignAndSendAllTransactions="solana:signAndSendAllTransactions"),LA}var pK;function jU(){return pK||(pK=1,function(n){var e=ay&&ay.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),t=ay&&ay.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(n,"__esModule",{value:!0}),t(yDe(),n),t(bDe(),n),t(vDe(),n),t(xDe(),n),t(EDe(),n)}(ay)),ay}var cy={},pP={},gK;function ADe(){return gK||(gK=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Connect=n.StandardConnect=void 0,n.StandardConnect="standard:connect",n.Connect=n.StandardConnect}(pP)),pP}var gP={},mK;function SDe(){return mK||(mK=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Disconnect=n.StandardDisconnect=void 0,n.StandardDisconnect="standard:disconnect",n.Disconnect=n.StandardDisconnect}(gP)),gP}var mP={},wK;function _De(){return wK||(wK=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Events=n.StandardEvents=void 0,n.StandardEvents="standard:events",n.Events=n.StandardEvents}(mP)),mP}var yK;function Vie(){return yK||(yK=1,function(n){var e=cy&&cy.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),t=cy&&cy.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(n,"__esModule",{value:!0}),t(ADe(),n),t(SDe(),n),t(_De(),n)}(cy)),cy}var bK;function CDe(){if(bK)return PI;bK=1,Object.defineProperty(PI,"__esModule",{value:!0}),PI.isWalletAdapterCompatibleStandardWallet=t;const n=jU(),e=Vie();function t(r){return e.StandardConnect in r.features&&e.StandardEvents in r.features&&(n.SolanaSignAndSendTransaction in r.features||n.SolanaSignTransaction in r.features)}return PI}var $A={},vK;function TDe(){if(vK)return $A;
vendor: 28,285 bytes, lines 1026-1033
1026vK=1,Object.defineProperty($A,"__esModule",{value:!0}),$A.WalletAdapterNetwork=void 0;var n;return function(e){e.Mainnet="mainnet-beta",e.Testnet="testnet",e.Devnet="devnet"}(n||($A.WalletAdapterNetwork=n={})),$A}var xK;function IDe(){return xK||(xK=1,function(n){var e=oy&&oy.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),t=oy&&oy.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(n,"__esModule",{value:!0}),t(Wie(),n),t(UU(),n),t(wDe(),n),t(CDe(),n),t(Hie(),n),t(TDe(),n)}(oy)),oy}const qie=Vx(BOe);var Bd={},d2={},wP,EK;function NDe(){return EK||(EK=1,wP=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),wP}var yP={},$m={},AK;function nb(){if(AK)return $m;AK=1;let n;const e=[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 $m.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},$m.getSymbolTotalCodewords=function(r){return e[r]},$m.getBCHDigit=function(t){let r=0;for(;t!==0;)r++,t>>>=1;return r},$m.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');n=r},$m.isKanjiModeEnabled=function(){return typeof n<"u"},$m.toSJIS=function(r){return n(r)},$m}var bP={},SK;function zU(){return SK||(SK=1,function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+t)}}n.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},n.from=function(r,i){if(n.isValid(r))return r;try{return e(r)}catch{return i}}}(bP)),bP}var vP,_K;function RDe(){if(_K)return vP;_K=1;function n(){this.buffer=[],this.length=0}return n.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},vP=n,vP}var xP,CK;function MDe(){if(CK)return xP;CK=1;function n(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return n.prototype.set=function(e,t,r,i){const s=e*this.size+t;this.data[s]=r,i&&(this.reservedBit[s]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},xP=n,xP}var EP={},TK;function kDe(){return TK||(TK=1,function(n){const e=nb().getSymbolSize;n.getRowColCoords=function(r){if(r===1)return[];const i=Math.floor(r/7)+2,s=e(r),o=s===145?26:Math.ceil((s-13)/(2*i-2))*2,a=[s-7];for(let c=1;c<i-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},n.getPositions=function(r){const i=[],s=n.getRowColCoords(r),o=s.length;for(let a=0;a<o;a++)for(let c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||i.push([s[a],s[c]]);return i}}(EP)),EP}var AP={},IK;function ODe(){if(IK)return AP;IK=1;const n=nb().getSymbolSize,e=7;return AP.getPositions=function(r){const i=n(r);return[[0,0],[i-e,0],[0,i-e]]},AP}var SP={},NK;function PDe(){return NK||(NK=1,function(n){n.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};n.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},n.from=function(i){return n.isValid(i)?parseInt(i,10):void 0},n.getPenaltyN1=function(i){const s=i.size;let o=0,a=0,c=0,u=null,d=null;for(let f=0;f<s;f++){a=c=0,u=d=null;for(let m=0;m<s;m++){let w=i.get(f,m);w===u?a++:(a>=5&&(o+=e.N1+(a-5)),u=w,a=1),w=i.get(m,f),w===d?c++:(c>=5&&(o+=e.N1+(c-5)),d=w,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},n.getPenaltyN2=function(i){const s=i.size;let o=0;for(let a=0;a<s-1;a++)for(let c=0;c<s-1;c++){const u=i.get(a,c)+i.get(a,c+1)+i.get(a+1,c)+i.get(a+1,c+1);(u===4||u===0)&&o++}return o*e.N2},n.getPenaltyN3=function(i){const s=i.size;let o=0,a=0,c=0;for(let u=0;u<s;u++){a=c=0;for(let d=0;d<s;d++)a=a<<1&2047|i.get(u,d),d>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|i.get(d,u),d>=10&&(c===1488||c===93)&&o++}return o*e.N3},n.getPenaltyN4=function(i){let s=0;const o=i.data.length;for(let c=0;c<o;c++)s+=i.data[c];return Math.abs(Math.ceil(s*100/o/5)-10)*e.N4};function t(r,i,s){switch(r){case n.Patterns.PATTERN000:return(i+s)%2===0;case n.Patterns.PATTERN001:return i%2===0;case n.Patterns.PATTERN010:return s%3===0;case n.Patterns.PATTERN011:return(i+s)%3===0;case n.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(s/3))%2===0;case n.Patterns.PATTERN101:return i*s%2+i*s%3===0;case n.Patterns.PATTERN110:return(i*s%2+i*s%3)%2===0;case n.Patterns.PATTERN111:return(i*s%3+(i+s)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}n.applyMask=function(i,s){const o=s.size;for(let a=0;a<o;a++)for(let c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,t(i,c,a))},n.getBestMask=function(i,s){const o=Object.keys(n.Patterns).length;let a=0,c=1/0;for(let u=0;u<o;u++){s(u),n.applyMask(u,i);const d=n.getPenaltyN1(i)+n.getPenaltyN2(i)+n.getPenaltyN3(i)+n.getPenaltyN4(i);n.applyMask(u,i),d<c&&(c=d,a=u)}return a}}(SP)),SP}var DI={},RK;function Kie(){if(RK)return DI;RK=1;const n=zU(),e=[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],t=[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 DI.getBlocksCount=function(i,s){switch(s){case n.L:return e[(i-1)*4+0];case n.M:return e[(i-1)*4+1];case n.Q:return e[(i-1)*4+2];case n.H:return e[(i-1)*4+3];default:return}},DI.getTotalCodewordsCount=function(i,s){switch(s){case n.L:return t[(i-1)*4+0];case n.M:return t[(i-1)*4+1];case n.Q:return t[(i-1)*4+2];case n.H:return t[(i-1)*4+3];default:return}},DI}var _P={},UA={},MK;function DDe(){if(MK)return UA;MK=1;const n=new Uint8Array(512),e=new Uint8Array(256);return function(){let r=1;for(let i=0;i<255;i++)n[i]=r,e[r]=i,r<<=1,r&256&&(r^=285);for(let i=255;i<512;i++)n[i]=n[i-255]}(),UA.log=function(r){if(r<1)throw new Error("log("+r+")");return e[r]},UA.exp=function(r){return n[r]},UA.mul=function(r,i){return r===0||i===0?0:n[e[r]+e[i]]},UA}var kK;function BDe(){return kK||(kK=1,function(n){const e=DDe();n.mul=function(r,i){const s=new Uint8Array(r.length+i.length-1);for(let o=0;o<r.length;o++)for(let a=0;a<i.length;a++)s[o+a]^=e.mul(r[o],i[a]);return s},n.mod=function(r,i){let s=new Uint8Array(r);for(;s.length-i.length>=0;){const o=s[0];for(let c=0;c<i.length;c++)s[c]^=e.mul(i[c],o);let a=0;for(;a<s.length&&s[a]===0;)a++;s=s.slice(a)}return s},n.generateECPolynomial=function(r){let i=new Uint8Array([1]);for(let s=0;s<r;s++)i=n.mul(i,new Uint8Array([1,e.exp(s)]));return i}}(_P)),_P}var CP,OK;function LDe(){if(OK)return CP;OK=1;const n=BDe();function e(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(r){this.degree=r,this.genPoly=n.generateECPolynomial(this.degree)},e.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(r.length+this.degree);i.set(r);const s=n.mod(i,this.genPoly),o=this.degree-s.length;if(o>0){const a=new Uint8Array(this.degree);return a.set(s,o),a}return s},CP=e,CP}var TP={},IP={},NP={},PK;function Yie(){return PK||(PK=1,NP.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),NP}var of={},DK;function Gie(){if(DK)return of;DK=1;const n="[0-9]+",e="[A-Z $%*+\\-./:]+";let t="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";t=t.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+t+`)(?:.|[\r 1027]))+`;of.KANJI=new RegExp(t,"g"),of.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),of.BYTE=new RegExp(r,"g"),of.NUMERIC=new RegExp(n,"g"),of.ALPHANUMERIC=new RegExp(e,"g");const i=new RegExp("^"+t+"$"),s=new RegExp("^"+n+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return of.testKanji=function(c){return i.test(c)},of.testNumeric=function(c){return s.test(c)},of.testAlphanumeric=function(c){return o.test(c)},of}var BK;function rb(){return BK||(BK=1,function(n){const e=Yie(),t=Gie();n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},n.getBestModeForData=function(s){return t.testNumeric(s)?n.NUMERIC:t.testAlphanumeric(s)?n.ALPHANUMERIC:t.testKanji(s)?n.KANJI:n.BYTE},n.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},n.isValid=function(s){return s&&s.bit&&s.ccBits};function r(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+i)}}n.from=function(s,o){if(n.isValid(s))return s;try{return r(s)}catch{return o}}}(IP)),IP}var LK;function $De(){return LK||(LK=1,function(n){const e=nb(),t=Kie(),r=zU(),i=rb(),s=Yie(),o=7973,a=e.getBCHDigit(o);function c(m,w,y){for(let b=1;b<=40;b++)if(w<=n.getCapacity(b,y,m))return b}function u(m,w){return i.getCharCountIndicator(m,w)+4}function d(m,w){let y=0;return m.forEach(function(b){const E=u(b.mode,w);y+=E+b.getBitsLength()}),y}function f(m,w){for(let y=1;y<=40;y++)if(d(m,y)<=n.getCapacity(y,w,i.MIXED))return y}n.from=function(w,y){return s.isValid(w)?parseInt(w,10):y},n.getCapacity=function(w,y,b){if(!s.isValid(w))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=i.BYTE);const E=e.getSymbolTotalCodewords(w),T=t.getTotalCodewordsCount(w,y),N=(E-T)*8;if(b===i.MIXED)return N;const I=N-u(b,w);switch(b){case i.NUMERIC:return Math.floor(I/10*3);case i.ALPHANUMERIC:return Math.floor(I/11*2);case i.KANJI:return Math.floor(I/13);case i.BYTE:default:return Math.floor(I/8)}},n.getBestVersionForData=function(w,y){let b;const E=r.from(y,r.M);if(Array.isArray(w)){if(w.length>1)return f(w,E);if(w.length===0)return 1;b=w[0]}else b=w;return c(b.mode,b.getLength(),E)},n.getEncodedBits=function(w){if(!s.isValid(w)||w<7)throw new Error("Invalid QR Code version");let y=w<<12;for(;e.getBCHDigit(y)-a>=0;)y^=o<<e.getBCHDigit(y)-a;return w<<12|y}}(TP)),TP}var RP={},$K;function UDe(){if($K)return RP;$K=1;const n=nb(),e=1335,t=21522,r=n.getBCHDigit(e);return RP.getEncodedBits=function(s,o){const a=s.bit<<3|o;let c=a<<10;for(;n.getBCHDigit(c)-r>=0;)c^=e<<n.getBCHDigit(c)-r;return(a<<10|c)^t},RP}var MP={},kP,UK;function jDe(){if(UK)return kP;UK=1;const n=rb();function e(t){this.mode=n.NUMERIC,this.data=t.toString()}return e.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(r){let i,s,o;for(i=0;i+3<=this.data.length;i+=3)s=this.data.substr(i,3),o=parseInt(s,10),r.put(o,10);const a=this.data.length-i;a>0&&(s=this.data.substr(i),o=parseInt(s,10),r.put(o,a*3+1))},kP=e,kP}var OP,jK;function zDe(){if(jK)return OP;jK=1;const n=rb(),e=["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 t(r){this.mode=n.ALPHANUMERIC,this.data=r}return t.getBitsLength=function(i){return 11*Math.floor(i/2)+6*(i%2)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(i){let s;for(s=0;s+2<=this.data.length;s+=2){let o=e.indexOf(this.data[s])*45;o+=e.indexOf(this.data[s+1]),i.put(o,11)}this.data.length%2&&i.put(e.indexOf(this.data[s]),6)},OP=t,OP}var PP,zK;function FDe(){if(zK)return PP;zK=1;const n=rb();function e(t){this.mode=n.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}return e.getBitsLength=function(r){return r*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(t){for(let r=0,i=this.data.length;r<i;r++)t.put(this.data[r],8)},PP=e,PP}var DP,FK;function WDe(){if(FK)return DP;FK=1;const n=rb(),e=nb();function t(r){this.mode=n.KANJI,this.data=r}return t.getBitsLength=function(i){return i*13},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){let i;for(i=0;i<this.data.length;i++){let s=e.toSJIS(this.data[i]);if(s>=33088&&s<=40956)s-=33088;else if(s>=57408&&s<=60351)s-=49472;else throw new Error("Invalid SJIS character: "+this.data[i]+` 1028Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),r.put(s,13)}},DP=t,DP}var BP={exports:{}},WK;function Zie(){return WK||(WK=1,function(n){var e={single_source_shortest_paths:function(t,r,i){var s={},o={};o[r]=0;var a=e.PriorityQueue.make();a.push(r,0);for(var c,u,d,f,m,w,y,b,E;!a.empty();){c=a.pop(),u=c.value,f=c.cost,m=t[u]||{};for(d in m)m.hasOwnProperty(d)&&(w=m[d],y=f+w,b=o[d],E=typeof o[d]>"u",(E||b>y)&&(o[d]=y,a.push(d,y),s[d]=u))}if(typeof i<"u"&&typeof o[i]>"u"){var T=["Could not find a path from ",r," to ",i,"."].join("");throw new Error(T)}return s},extract_shortest_path_from_predecessor_list:function(t,r){for(var i=[],s=r;s;)i.push(s),t[s],s=t[s];return i.reverse(),i},find_path:function(t,r,i){var s=e.single_source_shortest_paths(t,r,i);return e.extract_shortest_path_from_predecessor_list(s,i)},PriorityQueue:{make:function(t){var r=e.PriorityQueue,i={},s;t=t||{};for(s in r)r.hasOwnProperty(s)&&(i[s]=r[s]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,r){return t.cost-r.cost},push:function(t,r){var i={value:t,cost:r};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};n.exports=e}(BP)),BP.exports}var HK;function HDe(){return HK||(HK=1,function(n){const e=rb(),t=jDe(),r=zDe(),i=FDe(),s=WDe(),o=Gie(),a=nb(),c=Zie();function u(T){return unescape(encodeURIComponent(T)).length}function d(T,N,I){const H=[];let L;for(;(L=T.exec(I))!==null;)H.push({data:L[0],index:L.index,mode:N,length:L[0].length});return H}function f(T){const N=d(o.NUMERIC,e.NUMERIC,T),I=d(o.ALPHANUMERIC,e.ALPHANUMERIC,T);let H,L;return a.isKanjiModeEnabled()?(H=d(o.BYTE,e.BYTE,T),L=d(o.KANJI,e.KANJI,T)):(H=d(o.BYTE_KANJI,e.BYTE,T),L=[]),N.concat(I,H,L).sort(function(K,Y){return K.index-Y.index}).map(function(K){return{data:K.data,mode:K.mode,length:K.length}})}function m(T,N){switch(N){case e.NUMERIC:return t.getBitsLength(T);case e.ALPHANUMERIC:return r.getBitsLength(T);case e.KANJI:return s.getBitsLength(T);case e.BYTE:return i.getBitsLength(T)}}function w(T){return T.reduce(function(N,I){const H=N.length-1>=0?N[N.length-1]:null;return H&&H.mode===I.mode?(N[N.length-1].data+=I.data,N):(N.push(I),N)},[])}function y(T){const N=[];for(let I=0;I<T.length;I++){const H=T[I];switch(H.mode){case e.NUMERIC:N.push([H,{data:H.data,mode:e.ALPHANUMERIC,length:H.length},{data:H.data,mode:e.BYTE,length:H.length}]);break;case e.ALPHANUMERIC:N.push([H,{data:H.data,mode:e.BYTE,length:H.length}]);break;case e.KANJI:N.push([H,{data:H.data,mode:e.BYTE,length:u(H.data)}]);break;case e.BYTE:N.push([{data:H.data,mode:e.BYTE,length:u(H.data)}])}}return N}function b(T,N){const I={},H={start:{}};let L=["start"];for(let U=0;U<T.length;U++){const K=T[U],Y=[];for(let k=0;k<K.length;k++){const j=K[k],V=""+U+k;Y.push(V),I[V]={node:j,lastCount:0},H[V]={};for(let W=0;W<L.length;W++){const $=L[W];I[$]&&I[$].node.mode===j.mode?(H[$][V]=m(I[$].lastCount+j.length,j.mode)-m(I[$].lastCount,j.mode),I[$].lastCount+=j.length):(I[$]&&(I[$].lastCount=j.length),H[$][V]=m(j.length,j.mode)+4+e.getCharCountIndicator(j.mode,N))}}L=Y}for(let U=0;U<L.length;U++)H[L[U]].end=0;return{map:H,table:I}}function E(T,N){let I;const H=e.getBestModeForData(T);if(I=e.from(N,H),I!==e.BYTE&&I.bit<H.bit)throw new Error('"'+T+'" cannot be encoded with mode '+e.toString(I)+`. 1029 Suggested mode is: `+e.toString(H));switch(I===e.KANJI&&!a.isKanjiModeEnabled()&&(I=e.BYTE),I){case e.NUMERIC:return new t(T);case e.ALPHANUMERIC:return new r(T);case e.KANJI:return new s(T);case e.BYTE:return new i(T)}}n.fromArray=function(N){return N.reduce(function(I,H){return typeof H=="string"?I.push(E(H,null)):H.data&&I.push(E(H.data,H.mode)),I},[])},n.fromString=function(N,I){const H=f(N,a.isKanjiModeEnabled()),L=y(H),U=b(L,I),K=c.find_path(U.map,"start","end"),Y=[];for(let k=1;k<K.length-1;k++)Y.push(U.table[K[k]].node);return n.fromArray(w(Y))},n.rawSplit=function(N){return n.fromArray(f(N,a.isKanjiModeEnabled()))}}(MP)),MP}var VK;function VDe(){if(VK)return yP;VK=1;const n=nb(),e=zU(),t=RDe(),r=MDe(),i=kDe(),s=ODe(),o=PDe(),a=Kie(),c=LDe(),u=$De(),d=UDe(),f=rb(),m=HDe();function w(U,K){const Y=U.size,k=s.getPositions(K);for(let j=0;j<k.length;j++){const V=k[j][0],W=k[j][1];for(let $=-1;$<=7;$++)if(!(V+$<=-1||Y<=V+$))for(let A=-1;A<=7;A++)W+A<=-1||Y<=W+A||($>=0&&$<=6&&(A===0||A===6)||A>=0&&A<=6&&($===0||$===6)||$>=2&&$<=4&&A>=2&&A<=4?U.set(V+$,W+A,!0,!0):U.set(V+$,W+A,!1,!0))}}function y(U){const K=U.size;for(let Y=8;Y<K-8;Y++){const k=Y%2===0;U.set(Y,6,k,!0),U.set(6,Y,k,!0)}}function b(U,K){const Y=i.getPositions(K);for(let k=0;k<Y.length;k++){const j=Y[k][0],V=Y[k][1];for(let W=-2;W<=2;W++)for(let $=-2;$<=2;$++)W===-2||W===2||$===-2||$===2||W===0&&$===0?U.set(j+W,V+$,!0,!0):U.set(j+W,V+$,!1,!0)}}function E(U,K){const Y=U.size,k=u.getEncodedBits(K);let j,V,W;for(let $=0;$<18;$++)j=Math.floor($/3),V=$%3+Y-8-3,W=(k>>$&1)===1,U.set(j,V,W,!0),U.set(V,j,W,!0)}function T(U,K,Y){const k=U.size,j=d.getEncodedBits(K,Y);let V,W;for(V=0;V<15;V++)W=(j>>V&1)===1,V<6?U.set(V,8,W,!0):V<8?U.set(V+1,8,W,!0):U.set(k-15+V,8,W,!0),V<8?U.set(8,k-V-1,W,!0):V<9?U.set(8,15-V-1+1,W,!0):U.set(8,15-V-1,W,!0);U.set(k-8,8,1,!0)}function N(U,K){const Y=U.size;let k=-1,j=Y-1,V=7,W=0;for(let $=Y-1;$>0;$-=2)for($===6&&$--;;){for(let A=0;A<2;A++)if(!U.isReserved(j,$-A)){let _=!1;W<K.length&&(_=(K[W]>>>V&1)===1),U.set(j,$-A,_),V--,V===-1&&(W++,V=7)}if(j+=k,j<0||Y<=j){j-=k,k=-k;break}}}function I(U,K,Y){const k=new t;Y.forEach(function(A){k.put(A.mode.bit,4),k.put(A.getLength(),f.getCharCountIndicator(A.mode,U)),A.write(k)});const j=n.getSymbolTotalCodewords(U),V=a.getTotalCodewordsCount(U,K),W=(j-V)*8;for(k.getLengthInBits()+4<=W&&k.put(0,4);k.getLengthInBits()%8!==0;)k.putBit(0);const $=(W-k.getLengthInBits())/8;for(let A=0;A<$;A++)k.put(A%2?17:236,8);return H(k,U,K)}function H(U,K,Y){const k=n.getSymbolTotalCodewords(K),j=a.getTotalCodewordsCount(K,Y),V=k-j,W=a.getBlocksCount(K,Y),$=k%W,A=W-$,_=Math.floor(k/W),R=Math.floor(V/W),P=R+1,q=_-R,F=new c(q);let z=0;const B=new Array(W),C=new Array(W);let M=0;const Z=new Uint8Array(U.buffer);for(let xe=0;xe<W;xe++){const Se=xe<A?R:P;B[xe]=Z.slice(z,z+Se),C[xe]=F.encode(B[xe]),z+=Se,M=Math.max(M,Se)}const J=new Uint8Array(k);let ae=0,we,he;for(we=0;we<M;we++)for(he=0;he<W;he++)we<B[he].length&&(J[ae++]=B[he][we]);for(we=0;we<q;we++)for(he=0;he<W;he++)J[ae++]=C[he][we];return J}function L(U,K,Y,k){let j;if(Array.isArray(U))j=m.fromArray(U);else if(typeof U=="string"){let _=K;if(!_){const R=m.rawSplit(U);_=u.getBestVersionForData(R,Y)}j=m.fromString(U,_||40)}else throw new Error("Invalid data");const V=u.getBestVersionForData(j,Y);if(!V)throw new Error("The amount of data is too big to be stored in a QR Code");if(!K)K=V;else if(K<V)throw new Error(` 1030The chosen QR Code version cannot contain this amount of data. 1031Minimum version required to store current data is: `+V+`. 1032`);const W=I(K,Y,j),$=n.getSymbolSize(K),A=new r($);return w(A,K),y(A),b(A,K),T(A,Y,0),K>=7&&E(A,K),N(A,W),isNaN(k)&&(k=o.getBestMask(A,T.bind(null,A,Y))),o.applyMask(k,A),T(A,Y,k),{modules:A,version:K,errorCorrectionLevel:Y,maskPattern:k,segments:j}}return yP.create=function(K,Y){if(typeof K>"u"||K==="")throw new Error("No input text");let k=e.M,j,V;return typeof Y<"u"&&(k=e.from(Y.errorCorrectionLevel,e.M),j=u.from(Y.version),V=o.from(Y.maskPattern),Y.toSJISFunc&&n.setToSJISFunction(Y.toSJISFunc)),L(K,j,k,V)},yP}var LP={},$P={},qK;function Qie(){return qK||(qK=1,function(n){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let r=t.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+t);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(s){return[s,s]}))),r.length===6&&r.push("F","F");const i=parseInt(r.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+r.slice(0,6).join("")}}n.getOptions=function(r){r||(r={}),r.color||(r.color={});const i=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,s=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:s,scale:s?4:o,margin:i,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},n.getScale=function(r,i){return i.width&&i.width>=r+i.margin*2?i.width/(r+i.margin*2):i.scale},n.getImageWidth=function(r,i){const s=n.getScale(r,i);return Math.floor((r+i.margin*2)*s)},n.qrToImageData=function(r,i,s){const o=i.modules.size,a=i.modules.data,c=n.getScale(o,s),u=Math.floor((o+s.margin*2)*c),d=s.margin*c,f=[s.color.light,s.color.dark];for(let m=0;m<u;m++)for(let w=0;w<u;w++){let y=(m*u+w)*4,b=s.color.light;if(m>=d&&w>=d&&m<u-d&&w<u-d){const E=Math.floor((m-d)/c),T=Math.floor((w-d)/c);b=f[a[E*o+T]?1:0]}r[y++]=b.r,r[y++]=b.g,r[y++]=b.b,r[y]=b.a}}}($P)),$P}var KK;function qDe(){return KK||(KK=1,function(n){const e=Qie();function t(i,s,o){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}n.render=function(s,o,a){let c=a,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=r()),c=e.getOptions(c);const d=e.getImageWidth(s.modules.size,c),f=u.getContext("2d"),m=f.createImageData(d,d);return e.qrToImageData(m.data,s,c),t(f,u,d),f.putImageData(m,0,0),u},n.renderToDataURL=function(s,o,a){let c=a;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=n.render(s,o,c),d=c.type||"image/png",f=c.rendererOpts||{};return u.toDataURL(d,f.quality)}}(LP)),LP}var UP={},YK;function KDe(){if(YK)return UP;YK=1;const n=Qie();function e(i,s){const o=i.a/255,a=s+'="'+i.hex+'"';return o<1?a+" "+s+'-opacity="'+o.toFixed(2).slice(1)+'"':a}function t(i,s,o){let a=i+s;return typeof o<"u"&&(a+=" "+o),a}function r(i,s,o){let a="",c=0,u=!1,d=0;for(let f=0;f<i.length;f++){const m=Math.floor(f%s),w=Math.floor(f/s);!m&&!u&&(u=!0),i[f]?(d++,f>0&&m>0&&i[f-1]||(a+=u?t("M",m+o,.5+w+o):t("m",c,0),c=0,u=!1),m+1<s&&i[f+1]||(a+=t("h",d),d=0)):c++}return a}return UP.render=function(s,o,a){const c=n.getOptions(o),u=s.modules.size,d=s.modules.data,f=u+c.margin*2,m=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",w="<path "+e(c.color.dark,"stroke")+' d="'+r(d,u,c.margin)+'"/>',y='viewBox="0 0 '+f+" "+f+'"',E='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+y+' shape-rendering="crispEdges">'+m+w+`</svg> 1033`;return typeof a=="function"&&a(null,E),E},UP}var GK;function YDe(){if(GK)return d2;GK=1;const n=NDe(),e=VDe(),t=qDe(),r=KDe();function i(s,o,a,c,u){const d=[].slice.call(arguments,1),f=d.length,m=typeof d[f-1]=="function";if(!m&&!n())throw new Error("Callback required as last argument");if(m){if(f<2)throw new Error("Too few arguments provided");f===2?(u=a,a=o,o=c=void 0):f===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=a,a=o,o=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(a=o,o=c=void 0):f===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(w,y){try{const b=e.create(a,c);w(s(b,o,c))}catch(b){y(b)}})}try{const w=e.create(a,c);u(null,s(w,o,c))}catch(w){u(w)}}return d2.create=e.create,d2.toCanvas=i.bind(null,t.render),d2.toDataURL=i.bind(null,t.renderToDataURL),d2.toString=i.bind(null,function(s,o,a){return r.render(s,a)}),d2}var jP={},ZK;function Xie(){return ZK||(ZK=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SOLANA_CHAINS=n.SOLANA_LOCALNET_CHAIN=n.SOLANA_TESTNET_CHAIN=n.SOLANA_DEVNET_CHAIN=n.SOLANA_MAINNET_CHAIN=void 0,n.isSolanaChain=e,n.SOLANA_MAINNET_CHAIN="solana:mainnet",n.SOLANA_DEVNET_CHAIN="solana:devnet",n.SOLANA_TESTNET_CHAIN="solana:testnet",n.SOLANA_LOCALNET_CHAIN="solana:localnet",n.SOLANA_CHAINS=[n.SOLANA_MAINNET_CHAIN,n.SOLANA_DEVNET_CHAIN,n.SOLANA_TESTNET_CHAIN,n.SOLANA_LOCALNET_CHAIN];function e(t){return n.SOLANA_CHAINS.includes(t)}}(jP)),jP}var Iu={},ly={},BI={},QK;function GDe(){if(QK)return BI;QK=1,Object.defineProperty(BI,"__esModule",{value:!0}),BI.getCommitment=n;function n(e){switch(e){case"processed":case"confirmed":case"finalized":case void 0:return e;case"recent":return"processed";case"single":case"singleGossip":return"confirmed";case"max":case"root":return"finalized";default:return}}return BI}var zP={},XK;function ZDe(){return XK||(XK=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.LOCALNET_ENDPOINT=n.TESTNET_ENDPOINT=n.DEVNET_ENDPOINT=n.MAINNET_ENDPOINT=void 0,n.getChainForEndpoint=t,n.getEndpointForChain=r;const e=Xie();n.MAINNET_ENDPOINT="https://api.mainnet-beta.solana.com",n.DEVNET_ENDPOINT="https://api.devnet.solana.com",n.TESTNET_ENDPOINT="https://api.testnet.solana.com",n.LOCALNET_ENDPOINT="http://localhost:8899";function t(i){return i.includes(n.MAINNET_ENDPOINT)?e.SOLANA_MAINNET_CHAIN:/\bdevnet\b/i.test(i)?e.SOLANA_DEVNET_CHAIN:/\btestnet\b/i.test(i)?e.SOLANA_TESTNET_CHAIN:/\blocalhost\b/i.test(i)||/\b127\.0\.0\.1\b/.test(i)?e.SOLANA_LOCALNET_CHAIN:e.SOLANA_MAINNET_CHAIN}function r(i,s){return s||(i===e.SOLANA_MAINNET_CHAIN?n.MAINNET_ENDPOINT:i===e.SOLANA_DEVNET_CHAIN?n.DEVNET_ENDPOINT:i===e.SOLANA_TESTNET_CHAIN?n.TESTNET_ENDPOINT:i===e.SOLANA_LOCALNET_CHAIN?n.LOCALNET_ENDPOINT:n.MAINNET_ENDPOINT)}}(zP)),zP}var af={},jA={},FP={},Ui={},za={},WP={},zA={},JK;function QDe(){return JK||(JK=1,Object.defineProperty(zA,"__esMo
1033dule",{value:!0}),zA.crypto=void 0,zA.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),zA}var eY;function q_(){return eY||(eY=1,function(n){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(n,"__esModule",{value:!0}),n.wrapXOFConstructorWithOpts=n.wrapConstructorWithOpts=n.wrapConstructor=n.Hash=n.nextTick=n.swap32IfBE=n.byteSwapIfBE=n.swap8IfBE=n.isLE=void 0,n.isBytes=t,n.anumber=r,n.abytes=i,n.ahash=s,n.aexists=o,n.aoutput=a,n.u8=c,n.u32=u,n.clean=d,n.createView=f,n.rotr=m,n.rotl=w,n.byteSwap=y,n.byteSwap32=b,n.bytesToHex=N,n.hexToBytes=L,n.asyncLoop=K,n.utf8ToBytes=Y,n.bytesToUtf8=k,n.toBytes=j,n.kdfInputToBytes=V,n.concatBytes=W,n.checkOpts=$,n.createHasher=_,n.createOptHasher=R,n.createXOFer=P,n.randomBytes=q;const e=QDe();function t(F){return F instanceof Uint8Array||ArrayBuffer.isView(F)&&F.constructor.name==="Uint8Array"}function r(F){if(!Number.isSafeInteger(F)||F<0)throw new Error("positive integer expected, got "+F)}function i(F,...z){if(!t(F))throw new Error("Uint8Array expected");if(z.length>0&&!z.includes(F.length))throw new Error("Uint8Array expected of length "+z+", got length="+F.length)}function s(F){if(typeof F!="function"||typeof F.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");r(F.outputLen),r(F.blockLen)}function o(F,z=!0){if(F.destroyed)throw new Error("Hash instance has been destroyed");if(z&&F.finished)throw new Error("Hash#digest() has already been called")}function a(F,z){i(F);const B=z.outputLen;if(F.length<B)throw new Error("digestInto() expects output buffer of length at least "+B)}function c(F){return new Uint8Array(F.buffer,F.byteOffset,F.byteLength)}function u(F){return new Uint32Array(F.buffer,F.byteOffset,Math.floor(F.byteLength/4))}function d(...F){for(let z=0;z<F.length;z++)F[z].fill(0)}function f(F){return new DataView(F.buffer,F.byteOffset,F.byteLength)}function m(F,z){return F<<32-z|F>>>z}function w(F,z){return F<<z|F>>>32-z>>>0}n.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function y(F){return F<<24&4278190080|F<<8&16711680|F>>>8&65280|F>>>24&255}n.swap8IfBE=n.isLE?F=>F:F=>y(F),n.byteSwapIfBE=n.swap8IfBE;function b(F){for(let z=0;z<F.length;z++)F[z]=y(F[z]);return F}n.swap32IfBE=n.isLE?F=>F:b;const E=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",T=Array.from({length:256},(F,z)=>z.toString(16).padStart(2,"0"));function N(F){if(i(F),E)return F.toHex();let z="";for(let B=0;B<F.length;B++)z+=T[F[B]];return z}const I={_0:48,_9:57,A:65,F:70,a:97,f:102};function H(F){if(F>=I._0&&F<=I._9)return F-I._0;if(F>=I.A&&F<=I.F)return F-(I.A-10);if(F>=I.a&&F<=I.f)return F-(I.a-10)}function L(F){if(typeof F!="string")throw new Error("hex string expected, got "+typeof F);if(E)return Uint8Array.fromHex(F);const z=F.length,B=z/2;if(z%2)throw new Error("hex string expected, got unpadded hex of length "+z);const C=new Uint8Array(B);for(let M=0,Z=0;M<B;M++,Z+=2){const J=H(F.charCodeAt(Z)),ae=H(F.charCodeAt(Z+1));if(J===void 0||ae===void 0){const we=F[Z]+F[Z+1];throw new Error('hex string expected, got non-hex character "'+we+'" at index '+Z)}C[M]=J*16+ae}return C}const U=async()=>{};n.nextTick=U;async function K(F,z,B){let C=Date.now();for(let M=0;M<F;M++){B(M);const Z=Date.now()-C;Z>=0&&Z<z||(await(0,n.nextTick)(),C+=Z)}}function Y(F){if(typeof F!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(F))}function k(F){return new TextDecoder().decode(F)}function j(F){return typeof F=="string"&&(F=Y(F)),i(F),F}function V(F){return typeof F=="string"&&(F=Y(F)),i(F),F}function W(...F){let z=0;for(let C=0;C<F.length;C++){const M=F[C];i(M),z+=M.length}const B=new Uint8Array(z);for(let C=0,M=0;C<F.length;C++){const Z=F[C];B.set(Z,M),M+=Z.length}return B}function $(F,z){if(z!==void 0&&{}.toString.call(z)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(F,z)}class A{}n.Hash=A;function _(F){const z=C=>F().update(j(C)).digest(),B=F();return z.outputLen=B.outputLen,z.blockLen=B.blockLen,z.create=()=>F(),z}function R(F){const z=(C,M)=>F(M).update(j(C)).digest(),B=F({});return z.outputLen=B.outputLen,z.blockLen=B.blockLen,z.create=C=>F(C),z}function P(F){const z=(C,M)=>F(M).update(j(C)).digest(),B=F({});return z.outputLen=B.outputLen,z.blockLen=B.blockLen,z.create=C=>F(C),z}n.wrapConstructor=_,n.wrapConstructorWithOpts=R,n.wrapXOFConstructorWithOpts=P;function q(F=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(F));if(e.crypto&&typeof e.crypto.randomBytes=="function")return Uint8Array.from(e.crypto.randomBytes(F));throw new Error("crypto.getRandomValues must be defined")}}(WP)),WP}var tY;function XDe(){if(tY)return za;tY=1,Object.defineProperty(za,"__esModule",{value:!0}),za.SHA512_IV=za.SHA384_IV=za.SHA224_IV=za.SHA256_IV=za.HashMD=void 0,za.setBigUint64=e,za.Chi=t,za.Maj=r;const n=q_();function e(s,o,a,c){if(typeof s.setBigUint64=="function")return s.setBigUint64(o,a,
vendor: 5,177 bytes, line 1033
1033c);const u=BigInt(32),d=BigInt(4294967295),f=Number(a>>u&d),m=Number(a&d),w=c?4:0,y=c?0:4;s.setUint32(o+w,f,c),s.setUint32(o+y,m,c)}function t(s,o,a){return s&o^~s&a}function r(s,o,a){return s&o^s&a^o&a}class i extends n.Hash{constructor(o,a,c,u){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=o,this.outputLen=a,this.padOffset=c,this.isLE=u,this.buffer=new Uint8Array(o),this.view=(0,n.createView)(this.buffer)}update(o){(0,n.aexists)(this),o=(0,n.toBytes)(o),(0,n.abytes)(o);const{view:a,buffer:c,blockLen:u}=this,d=o.length;for(let f=0;f<d;){const m=Math.min(u-this.pos,d-f);if(m===u){const w=(0,n.createView)(o);for(;u<=d-f;f+=u)this.process(w,f);continue}c.set(o.subarray(f,f+m),this.pos),this.pos+=m,f+=m,this.pos===u&&(this.process(a,0),this.pos=0)}return this.length+=o.length,this.roundClean(),this}digestInto(o){(0,n.aexists)(this),(0,n.aoutput)(o,this),this.finished=!0;const{buffer:a,view:c,blockLen:u,isLE:d}=this;let{pos:f}=this;a[f++]=128,(0,n.clean)(this.buffer.subarray(f)),this.padOffset>u-f&&(this.process(c,0),f=0);for(let E=f;E<u;E++)a[E]=0;e(c,u-8,BigInt(this.length*8),d),this.process(c,0);const m=(0,n.createView)(o),w=this.outputLen;if(w%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const y=w/4,b=this.get();if(y>b.length)throw new Error("_sha2: outputLen bigger than state");for(let E=0;E<y;E++)m.setUint32(4*E,b[E],d)}digest(){const{buffer:o,outputLen:a}=this;this.digestInto(o);const c=o.slice(0,a);return this.destroy(),c}_cloneInto(o){o||(o=new this.constructor),o.set(...this.get());const{blockLen:a,buffer:c,length:u,finished:d,destroyed:f,pos:m}=this;return o.destroyed=f,o.finished=d,o.length=u,o.pos=m,u%a&&o.buffer.set(c),o}clone(){return this._cloneInto()}}return za.HashMD=i,za.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),za.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),za.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),za.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),za}var ir={},nY;function JDe(){if(nY)return ir;nY=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.toBig=ir.shrSL=ir.shrSH=ir.rotrSL=ir.rotrSH=ir.rotrBL=ir.rotrBH=ir.rotr32L=ir.rotr32H=ir.rotlSL=ir.rotlSH=ir.rotlBL=ir.rotlBH=ir.add5L=ir.add5H=ir.add4L=ir.add4H=ir.add3L=ir.add3H=void 0,ir.add=T,ir.fromBig=t,ir.split=r;const n=BigInt(2**32-1),e=BigInt(32);function t(k,j=!1){return j?{h:Number(k&n),l:Number(k>>e&n)}:{h:Number(k>>e&n)|0,l:Number(k&n)|0}}function r(k,j=!1){const V=k.length;let W=new Uint32Array(V),$=new Uint32Array(V);for(let A=0;A<V;A++){const{h:_,l:R}=t(k[A],j);[W[A],$[A]]=[_,R]}return[W,$]}const i=(k,j)=>BigInt(k>>>0)<<e|BigInt(j>>>0);ir.toBig=i;const s=(k,j,V)=>k>>>V;ir.shrSH=s;const o=(k,j,V)=>k<<32-V|j>>>V;ir.shrSL=o;const a=(k,j,V)=>k>>>V|j<<32-V;ir.rotrSH=a;const c=(k,j,V)=>k<<32-V|j>>>V;ir.rotrSL=c;const u=(k,j,V)=>k<<64-V|j>>>V-32;ir.rotrBH=u;const d=(k,j,V)=>k>>>V-32|j<<64-V;ir.rotrBL=d;const f=(k,j)=>j;ir.rotr32H=f;const m=(k,j)=>k;ir.rotr32L=m;const w=(k,j,V)=>k<<V|j>>>32-V;ir.rotlSH=w;const y=(k,j,V)=>j<<V|k>>>32-V;ir.rotlSL=y;const b=(k,j,V)=>j<<V-32|k>>>64-V;ir.rotlBH=b;const E=(k,j,V)=>k<<V-32|j>>>64-V;ir.rotlBL=E;function T(k,j,V,W){const $=(j>>>0)+(W>>>0);return{h:k+V+($/2**32|0)|0,l:$|0}}const N=(k,j,V)=>(k>>>0)+(j>>>0)+(V>>>0);ir.add3L=N;const I=(k,j,V,W)=>j+V+W+(k/2**32|0)|0;ir.add3H=I;const H=(k,j,V,W)=>(k>>>0)+(j>>>0)+(V>>>0)+(W>>>0);ir.add4L=H;const L=(k,j,V,W,$)=>j+V+W+$+(k/2**32|0)|0;ir.add4H=L;const U=(k,j,V,W,$)=>(k>>>0)+(j>>>0)+(V>>>0)+(W>>>0)+($>>>0);ir.add5L=U;const K=(k,j,V,W,$,A)=>j+V+W+$+A+(k/2**32|0)|0;ir.add5H=K;const Y={fromBig:t,split:r,toBig:i,shrSH:s,shrSL:o,rotrSH:a,rotrSL:c,rotrBH:u,rotrBL:d,rotr32H:f,rotr32L:m,rotlSH:w,rotlSL:y,rotlBH:b,rotlBL:E,add:T,add3L:N,add3H:I,add4L:H,add4H:L,add5H:K,add5L:U};return ir.default=Y,ir}var rY;function e7e(){if(rY)return Ui;rY=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.sha512_224=Ui.sha512_256=Ui.sha384=Ui.sha512=Ui.sha224=Ui.sha256=Ui.SHA512_256=Ui.SHA512_224=Ui.SHA384=Ui.SHA512=Ui.SHA224=Ui.SHA256=void 0;const n=XDe(),e=JDe(),t=q_(),r=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
vendor: 2,451 bytes, line 1033
1033734187,3204031479,3329325298]),i=new Uint32Array(64);class s extends n.HashMD{constructor(I=32){super(64,I,8,!1),this.A=n.SHA256_IV[0]|0,this.B=n.SHA256_IV[1]|0,this.C=n.SHA256_IV[2]|0,this.D=n.SHA256_IV[3]|0,this.E=n.SHA256_IV[4]|0,this.F=n.SHA256_IV[5]|0,this.G=n.SHA256_IV[6]|0,this.H=n.SHA256_IV[7]|0}get(){const{A:I,B:H,C:L,D:U,E:K,F:Y,G:k,H:j}=this;return[I,H,L,U,K,Y,k,j]}set(I,H,L,U,K,Y,k,j){this.A=I|0,this.B=H|0,this.C=L|0,this.D=U|0,this.E=K|0,this.F=Y|0,this.G=k|0,this.H=j|0}process(I,H){for(let $=0;$<16;$++,H+=4)i[$]=I.getUint32(H,!1);for(let $=16;$<64;$++){const A=i[$-15],_=i[$-2],R=(0,t.rotr)(A,7)^(0,t.rotr)(A,18)^A>>>3,P=(0,t.rotr)(_,17)^(0,t.rotr)(_,19)^_>>>10;i[$]=P+i[$-7]+R+i[$-16]|0}let{A:L,B:U,C:K,D:Y,E:k,F:j,G:V,H:W}=this;for(let $=0;$<64;$++){const A=(0,t.rotr)(k,6)^(0,t.rotr)(k,11)^(0,t.rotr)(k,25),_=W+A+(0,n.Chi)(k,j,V)+r[$]+i[$]|0,P=((0,t.rotr)(L,2)^(0,t.rotr)(L,13)^(0,t.rotr)(L,22))+(0,n.Maj)(L,U,K)|0;W=V,V=j,j=k,k=Y+_|0,Y=K,K=U,U=L,L=_+P|0}L=L+this.A|0,U=U+this.B|0,K=K+this.C|0,Y=Y+this.D|0,k=k+this.E|0,j=j+this.F|0,V=V+this.G|0,W=W+this.H|0,this.set(L,U,K,Y,k,j,V,W)}roundClean(){(0,t.clean)(i)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,t.clean)(this.buffer)}}Ui.SHA256=s;class o extends s{constructor(){super(28),this.A=n.SHA224_IV[0]|0,this.B=n.SHA224_IV[1]|0,this.C=n.SHA224_IV[2]|0,this.D=n.SHA224_IV[3]|0,this.E=n.SHA224_IV[4]|0,this.F=n.SHA224_IV[5]|0,this.G=n.SHA224_IV[6]|0,this.H=n.SHA224_IV[7]|0}}Ui.SHA224=o;const a=e.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","0xf40e3585
10335771202a","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(N=>BigInt(N))),c=a[0],u=a[1],d=new Uint32Array(80),f=new Uint32Array(80);class m extends n.HashMD{constructor(I=64){super(128,I,16,!1),this.Ah=n.SHA512_IV[0]|0,this.Al=n.SHA512_IV[1]|0,this.Bh=n.SHA512_IV[2]|0,this.Bl=n.SHA512_IV[3]|0,this.Ch=n.SHA512_IV[4]|0,this.Cl=n.SHA512_IV[5]|0,this.Dh=n.SHA512_IV[6]|0,this.Dl=n.SHA512_IV[7]|0,this.Eh=n.SHA512_IV[8]|0,this.El=n.SHA512_IV[9]|0,this.Fh=n.SHA512_IV[10]|0,this.Fl=n.SHA512_IV[11]|0,this.Gh=n.SHA512_IV[12]|0,this.Gl=n.SHA512_IV[13]|0,this.Hh=n.SHA512_IV[14]|0,this.Hl=n.SHA512_IV[15]|0}get(){const{Ah:I,Al:H,Bh:L,Bl:U,Ch:K,Cl:Y,Dh:k,Dl:j,Eh:V,El:W,Fh:$,Fl:A,Gh:_,Gl:R,Hh:P,Hl:q}=this;return[I,H,L,U,K,Y,k,j,V,W,$,A,_,R,P,q]}set(I,H,L,U,K,Y,k,j,V,W,$,A,_,R,P,q){this.Ah=I|0,this.Al=H|0,this.Bh=L|0,this.Bl=U|0,this.Ch=K|0,this.Cl=Y|0,this.Dh=k|0,this.Dl=j|0,this.Eh=V|0,this.El=W|0,this.Fh=$|0,this.Fl=A|0,this.Gh=_|0,this.Gl=R|0,this.Hh=P|0,this.Hl=q|0}process(I,H){for(let B=0;B<16;B++,H+=4)d[B]=I.getUint32(H),f[B]=I.getUint32(H+=4);for(let B=16;B<80;B++){const C=d[B-15]|0,M=f[B-15]|0,Z=e.rotrSH(C,M,1)^e.rotrSH(C,M,8)^e.shrSH(C,M,7),J=e.rotrSL(C,M,1)^e.rotrSL(C,M,8)^e.shrSL(C,M,7),ae=d[B-2]|0,we=f[B-2]|0,he=e.rotrSH(ae,we,19)^e.rotrBH(ae,we,61)^e.shrSH(ae,we,6),xe=e.rotrSL(ae,we,19)^e.rotrBL(ae,we,61)^e.shrSL(ae,we,6),Se=e.add4L(J,xe,f[B-7],f[B-16]),Re=e.add4H(Se,Z,he,d[B-7],d[B-16]);d[B]=Re|0,f[B]=Se|0}let{Ah:L,Al:U,Bh:K,Bl:Y,Ch:k,Cl:j,Dh:V,Dl:W,Eh:$,El:A,Fh:_,Fl:R,Gh:P,Gl:q,Hh:F,Hl:z}=this;for(let B=0;B<80;B++){const C=e.rotrSH($,A,14)^e.rotrSH($,A,18)^e.rotrBH($,A,41),M=e.rotrSL($,A,14)^e.rotrSL($,A,18)^e.rotrBL($,A,41),Z=$&_^~$&P,J=A&R^~A&q,ae=e.add5L(z,M,J,u[B],f[B]),we=e.add5H(ae,F,C,Z,c[B],d[B]),he=ae|0,xe=e.rotrSH(L,U,28)^e.rotrBH(L,U,34)^e.rotrBH(L,U,39),Se=e.rotrSL(L,U,28)^e.rotrBL(L,U,34)^e.rotrBL(L,U,39),Re=L&K^L&k^K&k,et=U&Y^U&j^Y&j;F=P|0,z=q|0,P=_|0,q=R|0,_=$|0,R=A|0,{h:$,l:A}=e.add(V|0,W|0,we|0,he|0),V=k|0,W=j|0,k=K|0,j=Y|0,K=L|0,Y=U|0;const Me=e.add3L(he,Se,et);L=e.add3H(Me,we,xe,Re),U=Me|0}({h:L,l:U}=e.add(this.Ah|0,this.Al|0,L|0,U|0)),{h:K,l:Y}=e.add(this.Bh|0,this.Bl|0,K|0,Y|0),{h:k,l:j}=e.add(this.Ch|0,this.Cl|0,k|0,j|0),{h:V,l:W}=e.add(this.Dh|0,this.Dl|0,V|0,W|0),{h:$,l:A}=e.add(this.Eh|0,this.El|0,$|0,A|0),{h:_,l:R}=e.add(this.Fh|0,this.Fl|0,_|0,R|0),{h:P,l:q}=e.add(this.Gh|0,this.Gl|0,P|0,q|0),{h:F,l:z}=e.add(this.Hh|0,this.Hl|0,F|0,z|0),this.set(L,U,K,Y,k,j,V,W,$,A,_,R,P,q,F,z)}roundClean(){(0,t.clean)(d,f)}destroy(){(0,t.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Ui.SHA512=m;class w extends m{constructor(){super(48),this.Ah=n.SHA384_IV[0]|0,this.Al=n.SHA384_IV[1]|0,this.Bh=n.SHA384_IV[2]|0,this.Bl=n.SHA384_IV[3]|0,this.Ch=n.SHA384_IV[4]|0,this.Cl=n.SHA384_IV[5]|0,this.Dh=n.SHA384_IV[6]|0,this.Dl=n.SHA384_IV[7]|0,this.Eh=n.SHA384_IV[8]|0,this.El=n.SHA384_IV[9]|0,this.Fh=n.SHA384_IV[10]|0,this.Fl=n.SHA384_IV[11]|0,this.Gh=n.SHA384_IV[12]|0,this.Gl=n.SHA384_IV[13]|0,this.Hh=n.SHA384_IV[14]|0,this.Hl=n.SHA384_IV[15]|0}}Ui.SHA384=w;const y=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),b=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class E extends m{constructor(){super(28),this.Ah=y[0]|0,this.Al=y[1]|0,this.Bh=y[2]|0,this.Bl=y[3]|0,this.Ch=y[4]|0,this.Cl=y[5]|0,this.Dh=y[6]|0,this.Dl=y[7]|0,this.Eh=y[8]|0,this.El=y[9]|0,this.Fh=y[10]|0,this.Fl=y[11]|0,this.Gh=y[12]|0,this.Gl=y[13]|0,this.Hh=y[14]|0,this.Hl=y[15]|0}}Ui.SHA512_224=E;class T extends m{constructor(){super(32),this.Ah=b[0]|0,this.Al=b[1]|0,this.Bh=b[2]|0,this.Bl=b[3]|0,this.Ch=b[4]|0,this.Cl=b[5]|0,this.Dh=b[6]|0,this.Dl=b[7]|0,this.Eh=b[8]|0,this.El=b[9]|0,this.Fh=b[10]|0,this.Fl=b[11]|0,this.Gh=b[12]|0,this.Gl=b[13]|0,this.Hh=b[14]|0,this.Hl=b[15]|0}}return Ui.SHA512_256=T,Ui.sha256=(0,t.createHasher)(()=>new s),Ui.sha224=(0,t.createHasher)(()=>new o),Ui.sha512=(0,t.createHasher)(()=>new m),Ui.sha384=(0,t.createHasher)(()=>new w),Ui.sha512_256=(0,t.createHasher)(()=>new T),Ui.sha512_224=(0,t.createHasher)(()=>new E),Ui}var Nu={},HP={},iY;function dE(){return iY||(iY=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.notImplemented=n.bitMask=n.utf8ToBytes=n.randomBytes=n.isBytes=n.hexToBytes=n.concatBytes=n.bytesToUtf8=n.bytesToHex=n.anumber=n.abytes=void 0,n.abool=s,n._abool2=o,n._abytes2=a,n.numberToHexUnpadded=c,n.hexToNumber=u,n.bytesToNumberBE=d,n.bytesToNumberLE=f,n.numberToBytesBE=m,n.numberToBytesLE=w,n.numberToVarBytesBE=y,n.ensureBytes=b,n.equalBytes=E,n.copyBytes=T,n.asciiToBytes=N,n.inRange=H,n.aInRange=L,n.bitLen=U,n.bitGet=K,n.bitSet=Y,n.createHmacDrbg=j,n.validateObject=W,n.isHash=$,n._validateObject=A,n.memoized=R;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=q_();var t=q_();Object.defineProperty(n,"abytes",{enumerable:!0,get:function(){return t.abytes}}),Object.defineProperty(n,"anumber",{enumerable:!0,get:function(){return t.anumber}}),Object.defineProperty(n,"bytesToHex",{enumerable:!0,get:function(){return t.bytesToHex}}),Object.defineProperty(n,"bytesToUtf8",{enumerable:!0,get:function(){return t.bytesToUtf8}}),Object.defineProperty(n,"concatBytes",{enumerable:!0,get:function(){return t.concatBytes}}),Object.defineProperty(n,"hexToBytes",{enumerable:!0,get:function(){return t.hexToBytes}}),Object.defineProperty(n,"isBytes",{enumerable:!0,get:function(){return t.isBytes}}),Object.defineProperty(n,"randomBytes",{enumerable:!0,get:function(){return t.randomBytes}}),Object.defineProperty(n,"utf8ToBytes",{enumerable:!0,get:function(){return t.utf8ToBytes}});const r=BigInt(0),i=BigInt(1);function s(P,q){if(typeof q!="boolean")throw new Error(P+" boolean expected, got "+q)}function o(P,q=""){if(typeof P!="boolean"){const F=q&&`"${q}"`;throw new Error(F+"expected boolean, got type="+typeof P)}return P}function a(P,q,F=""){const z=(0,e.isBytes)(P),B=P==null?void 0:P.length,C=q!==void 0;if(!z||C&&B!==q){const M=F&&`"${F}" `,Z=C?` of length ${q}`:"",J=z?`length=${B}`:`type=${typeof P}`;throw new Error(M+"expected Uint8Array"+Z+", got "+J)}return P}function c(P){const q=P.toString(16);return q.length&1?"0"+q:q}function u(P){if(typeof P!="string")throw new Error("hex string expected, got "+typeof P);return P===""?r:BigInt("0x"+P)}function d(P){return u((0,e.bytesToHex)(P))}function f(P){return(0,e.abytes)(P),u((0,e.bytesToHex)(Uint8Array.from(P).reverse()))}function m(P,q){return(0,e.hexToBytes)(P.toString(16).padStart(q*2,"0"))}function w(P,q){return m(P,q).reverse()}function y(P){return(0,e.hexToBytes)(c(P))}function b(P,q,F){let z;if(typeof q=="string")try{z=(0,e.hexToBytes)(q)}catch(C){throw new Error(P+" must be hex string or Uint8Array, cause: "+C)}else if((0,e.isBytes)(q))z=Uint8Array.from(q);else throw new Error(P+" must be hex string or Uint8Array");const B=z.length;if(typeof F=="number"&&B!==F)throw new Error(P+" of length "+F+" expected, got "+B);return z}function E(P,q){if(P.length!==q.length)return!1;let F=0;for(let z=0;z<P.length;z++)F|=P[z]^q[z];return F===0}function T(P){return Uint8Array.from(P)}function N(P){return Uint8Array.from(P,(q,F)=>{const z=q.charCodeAt(0);if(q.length!==1||z>
vendor: 9,084 bytes, line 1033
1033127)throw new Error(`string contains non-ASCII character "${P[F]}" with code ${z} at position ${F}`);return z})}const I=P=>typeof P=="bigint"&&r<=P;function H(P,q,F){return I(P)&&I(q)&&I(F)&&q<=P&&P<F}function L(P,q,F,z){if(!H(q,F,z))throw new Error("expected valid "+P+": "+F+" <= n < "+z+", got "+q)}function U(P){let q;for(q=0;P>r;P>>=i,q+=1);return q}function K(P,q){return P>>BigInt(q)&i}function Y(P,q,F){return P|(F?i:r)<<BigInt(q)}const k=P=>(i<<BigInt(P))-i;n.bitMask=k;function j(P,q,F){if(typeof P!="number"||P<2)throw new Error("hashLen must be a number");if(typeof q!="number"||q<2)throw new Error("qByteLen must be a number");if(typeof F!="function")throw new Error("hmacFn must be a function");const z=Se=>new Uint8Array(Se),B=Se=>Uint8Array.of(Se);let C=z(P),M=z(P),Z=0;const J=()=>{C.fill(1),M.fill(0),Z=0},ae=(...Se)=>F(M,C,...Se),we=(Se=z(0))=>{M=ae(B(0),Se),C=ae(),Se.length!==0&&(M=ae(B(1),Se),C=ae())},he=()=>{if(Z++>=1e3)throw new Error("drbg: tried 1000 values");let Se=0;const Re=[];for(;Se<q;){C=ae();const et=C.slice();Re.push(et),Se+=C.length}return(0,e.concatBytes)(...Re)};return(Se,Re)=>{J(),we(Se);let et;for(;!(et=Re(he()));)we();return J(),et}}const V={bigint:P=>typeof P=="bigint",function:P=>typeof P=="function",boolean:P=>typeof P=="boolean",string:P=>typeof P=="string",stringOrUint8Array:P=>typeof P=="string"||(0,e.isBytes)(P),isSafeInteger:P=>Number.isSafeInteger(P),array:P=>Array.isArray(P),field:(P,q)=>q.Fp.isValid(P),hash:P=>typeof P=="function"&&Number.isSafeInteger(P.outputLen)};function W(P,q,F={}){const z=(B,C,M)=>{const Z=V[C];if(typeof Z!="function")throw new Error("invalid validator function");const J=P[B];if(!(M&&J===void 0)&&!Z(J,P))throw new Error("param "+String(B)+" is invalid. Expected "+C+", got "+J)};for(const[B,C]of Object.entries(q))z(B,C,!1);for(const[B,C]of Object.entries(F))z(B,C,!0);return P}function $(P){return typeof P=="function"&&Number.isSafeInteger(P.outputLen)}function A(P,q,F={}){if(!P||typeof P!="object")throw new Error("expected valid options object");function z(B,C,M){const Z=P[B];if(M&&Z===void 0)return;const J=typeof Z;if(J!==C||Z===null)throw new Error(`param "${B}" is invalid: expected ${C}, got ${J}`)}Object.entries(q).forEach(([B,C])=>z(B,C,!1)),Object.entries(F).forEach(([B,C])=>z(B,C,!0))}const _=()=>{throw new Error("not implemented")};n.notImplemented=_;function R(P){const q=new WeakMap;return(F,...z)=>{const B=q.get(F);if(B!==void 0)return B;const C=P(F,...z);return q.set(F,C),C}}}(HP)),HP}var rs={},sY;function s4(){if(sY)return rs;sY=1,Object.defineProperty(rs,"__esModule",{value:!0}),rs.isNegativeLE=void 0,rs.mod=f,rs.pow=m,rs.pow2=w,rs.invert=y,rs.tonelliShanks=I,rs.FpSqrt=H,rs.validateField=K,rs.FpPow=Y,rs.FpInvertBatch=k,rs.FpDiv=j,rs.FpLegendre=V,rs.FpIsSquare=W,rs.nLength=$,rs.Field=A,rs.FpSqrtOdd=_,rs.FpSqrtEven=R,rs.hashToPrivateScalar=P,rs.getFieldBytesLength=q,rs.getMinHashLength=F,rs.mapHashToField=z;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const n=dE(),e=BigInt(0),t=BigInt(1),r=BigInt(2),i=BigInt(3),s=BigInt(4),o=BigInt(5),a=BigInt(7),c=BigInt(8),u=BigInt(9),d=BigInt(16);function f(B,C){const M=B%C;return M>=e?M:C+M}function m(B,C,M){return Y(A(M),B,C)}function w(B,C,M){let Z=B;for(;C-- >e;)Z*=Z,Z%=M;return Z}function y(B,C){if(B===e)throw new Error("invert: expected non-zero number");if(C<=e)throw new Error("invert: expected positive modulus, got "+C);let M=f(B,C),Z=C,J=e,ae=t;for(;M!==e;){const he=Z/M,xe=Z%M,Se=J-ae*he;Z=M,M=xe,J=ae,ae=Se}if(Z!==t)throw new Error("invert: does not exist");return f(J,C)}function b(B,C,M){if(!B.eql(B.sqr(C),M))throw new Error("Cannot find square root")}function E(B,C){const M=(B.ORDER+t)/s,Z=B.pow(C,M);return b(B,Z,C),Z}function T(B,C){const M=(B.ORDER-o)/c,Z=B.mul(C,r),J=B.pow(Z,M),ae=B.mul(C,J),we=B.mul(B.mul(ae,r),J),he=B.mul(ae,B.sub(we,B.ONE));return b(B,he,C),he}function N(B){const C=A(B),M=I(B),Z=M(C,C.neg(C.ONE)),J=M(C,Z),ae=M(C,C.neg(Z)),we=(B+a)/d;return(he,xe)=>{let Se=he.pow(xe,we),Re=he.mul(Se,Z);const et=he.mul(Se,J),Me=he.mul(Se,ae),Fe=he.eql(he.sqr(Re),xe),ht=he.eql(he.sqr(et),xe);Se=he.cmov(Se,Re,Fe),Re=he.cmov(Me,et,ht);const Dt=he.eql(he.sqr(Re),xe),At=he.cmov(Se,Re,Dt);return b(he,At,xe),At}}function I(B){if(B<i)throw new Error("sqrt is not defined for small field");let C=B-t,M=0;for(;C%r===e;)C/=r,M++;let Z=r;const J=A(B);for(;V(J,Z)===1;)if(Z++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(M===1)return E;let ae=J.pow(Z,C);const we=(C+t)/r;return function(xe,Se){if(xe.is0(Se))return Se;if(V(xe,Se)!==1)throw new Error("Cannot find square root");let Re=M,et=xe.mul(xe.ONE,ae),Me=xe.pow(Se,C),Fe=xe.pow(Se,we);for(;!xe.eql(Me,xe.ONE);){if(xe.is0(Me))return xe.ZERO;let ht=1,Dt=xe.sqr(Me);for(;!xe.eql(Dt,xe.ONE);)if(ht++,Dt=xe.sqr(Dt),ht===Re)throw new Error("Cannot find square root");const At=t<<BigInt(Re-ht-1),Wt=xe.pow(et,At);Re=ht,et=xe.sqr(Wt),Me=xe.mul(Me,et),Fe=xe.mul(Fe,Wt)}return Fe}}function H(B){return B%s===i?E:B%c===o?T:B%d===u?N(B):I(B)}const L=(B,C)=>(f(B,C)&t)===t;rs.isNegativeLE=L;const U=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function K(B){const C={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},M=U.reduce((Z,J)=>(Z[J]="function",Z),C);return(0,n._validateObject)(B,M),B}function Y(B,C,M){if(M<e)throw new Error("invalid exponent, negatives unsupported");if(M===e)return B.ONE;if(M===t)return C;let Z=B.ONE,J=C;for(;M>e;)M&t&&(Z=B.mul(Z,J)),J=B.sqr(J),M>>=t;return Z}function k(B,C,M=!1){const Z=new Array(C.length).fill(M?B.ZERO:void 0),J=C.reduce((we,he,xe)=>B.is0(he)?we:(Z[xe]=we,B.mul(we,he)),B.ONE),ae=B.inv(J);return C.reduceRight((we,he,xe)=>B.is0(he)?we:(Z[xe]=B.mul(we,Z[xe]),B.mul(we,he)),ae),Z}function j(B,C,M){return B.mul(C,typeof M=="bigint"?y(M,B.ORDER):B.inv(M))}function V(B,C){const M=(B.ORDER-t)/r,Z=B.pow(C,M),J=B.eql(Z,B.ONE),ae=B.eql(Z,B.ZERO),we=B.eql(Z,B.neg(B.ONE));if(!J&&!ae&&!we)throw new Error("invalid Legendre symbol result");return J?1:ae?0:-1}function W(B,C){return V(B,C)===1}function $(B,C){C!==void 0&&(0,n.anumber)(C);const M=C!==void 0?C:B.toString(2).length,Z=Math.ceil(M/8);return{nBitLength:M,nByteLength:Z}}function A(B,C,M=!1,Z={}){if(B<=e)throw new Error("invalid field: expected ORDER > 0, got "+B);let J,ae,we=!1,he;if(typeof C=="object"&&C!=null){if(Z.sqrt||M)throw new Error("cannot specify opts in two arguments");const Me=C;Me.BITS&&(J=Me.BITS),Me.sqrt&&(ae=Me.sqrt),typeof Me.isLE=="boolean"&&(M=Me.isLE),typeof Me.modFromBytes=="boolean"&&(we=Me.modFromBytes),he=Me.allowedLengths}else typeof C=="number"&&(J=C),Z.sqrt&&(ae=Z.sqrt);const{nBitLength:xe,nByteLength:Se}=$(B,J);if(Se>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let Re;const et=Object.freeze({ORDER:B,isLE:M,BITS:xe,BYTES:Se,MASK:(0,n.bitMask)(xe),ZERO:e,ONE:t,allowedLengths:he,create:Me=>f(Me,B),isValid:Me=>{if(typeof Me!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof Me);return e<=Me&&Me<B},is0:Me=>Me===e,isValidNot0:Me=>!et.is0(Me)&&et.isValid(Me),isOdd:Me=>(Me&t)===t,neg:Me=>f(-Me,B),eql:(Me,Fe)=>Me===Fe,sqr:Me=>f(Me*Me,B),add:(Me,Fe)=>f(Me+Fe,B),sub:(Me,Fe)=>f(Me-Fe,B),mul:(Me,Fe)=>f(Me*Fe,B),pow:(Me,Fe)=>Y(et,Me,Fe),div:(Me,Fe)=>f(Me*y(Fe,B),B),sqrN:Me=>Me*Me,addN:(Me,Fe)=>Me+Fe,subN:(Me,Fe)=>Me-Fe,mulN:(Me,Fe)=>Me*Fe,inv:Me=>y(Me,B),sqrt:ae||(Me=>(Re||(Re=H(B)),Re(et,Me))),toBytes:Me=>M?(0,n.numberToBytesLE)(Me,Se):(0,n.numberToBytesBE)(Me,Se),fromBytes:(Me,Fe=!0)=>{if(he){if(!he.includes(Me.length)||Me.length>Se)throw new Error("Field.fromBytes: expected "+he+" bytes, got "+Me.length);const Dt=new Uint8Array(Se);Dt.set(Me,M?0:Dt.length-Me.length),Me=Dt}if(Me.length!==Se)throw new Error("Field.fromBytes: expected "+Se+" bytes, got "+Me.length);let ht=M?(0,n.bytesToNumberLE)(Me):(0,n.bytesToNumberBE)(Me);if(we&&(ht=f(ht,B)),!Fe&&!et.isValid(ht))throw new Error("invalid field element: outside of range 0..ORDER");return ht},invertBatch:Me=>k(et,Me),cmov:(Me,Fe,ht)=>ht?Fe:Me});return Object.freeze(et)}function _(B,C){if(!B.isOdd)throw new Error("Field doesn't have isOdd");const M=B.sqrt(C);return B.isOdd(M)?M:B.neg(M)}function R(B,C){if(!B.isOdd)throw new Error("Field doesn't have isOdd");const M=B.sqrt(C);return B.isOdd(M)?B.neg(M):M}function P(B,C,M=!1){B=(0,n.ensureBytes)("privateHash",B);const Z=B.length,J=$(C).nByteLength+8;if(J<24||Z<J||Z>1024)throw new Error("hashToPrivateScalar: expected "+J+"-1024 bytes of input, got "+Z);const ae=M?(0,n.bytesToNumberLE)(B):(0,n.bytesToNumberBE)(B);return f(ae,C-t)+t}function q(B){if(typeof B!="bigint")throw new Error("field order must be bigint");const C=B.toString(2).length;return Math.ceil(C/8)}function F(B){const C=q(B);return C+Math.ceil(C/2)}function z(B,C,M=!1){const Z=B.length,J=q(C),ae=F(C);if(Z<16||Z<ae||Z>1024)throw new Error("expected "+ae+"-1024 bytes of input, got "+Z);const we=M?(0,n.bytesToNumberLE)(B):(0,n.bytesToNumberBE)(B),he=f(we,C-t)+t;return M?(0,n.numberToBytesLE)(he,J):(0,n.numberToBytesBE)(he,J)}return rs}var oY;
1033function Jie(){if(oY)return Nu;oY=1,Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.wNAF=void 0,Nu.negateCt=i,Nu.normalizeZ=s,Nu.mulEndoUnsafe=E,Nu.pippenger=T,Nu.precomputeMSMUnsafe=N,Nu.validateBasic=I,Nu._createCurveFields=L;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const n=dE(),e=s4(),t=BigInt(0),r=BigInt(1);function i(U,K){const Y=K.negate();return U?Y:K}function s(U,K){const Y=(0,e.FpInvertBatch)(U.Fp,K.map(k=>k.Z));return K.map((k,j)=>U.fromAffine(k.toAffine(Y[j])))}function o(U,K){if(!Number.isSafeInteger(U)||U<=0||U>K)throw new Error("invalid window size, expected [1.."+K+"], got W="+U)}function a(U,K){o(U,K);const Y=Math.ceil(K/U)+1,k=2**(U-1),j=2**U,V=(0,n.bitMask)(U),W=BigInt(U);return{windows:Y,windowSize:k,mask:V,maxNumber:j,shiftBy:W}}function c(U,K,Y){const{windowSize:k,mask:j,maxNumber:V,shiftBy:W}=Y;let $=Number(U&j),A=U>>W;$>k&&($-=V,A+=r);const _=K*k,R=_+Math.abs($)-1,P=$===0,q=$<0,F=K%2!==0;return{nextN:A,offset:R,isZero:P,isNeg:q,isNegF:F,offsetF:_}}function u(U,K){if(!Array.isArray(U))throw new Error("array expected");U.forEach((Y,k)=>{if(!(Y instanceof K))throw new Error("invalid point at index "+k)})}function d(U,K){if(!Array.isArray(U))throw new Error("array of scalars expected");U.forEach((Y,k)=>{if(!K.isValid(Y))throw new Error("invalid scalar at index "+k)})}const f=new WeakMap,m=new WeakMap;function w(U){return m.get(U)||1}function y(U){if(U!==t)throw new Error("invalid wNAF")}class b{constructor(K,Y){this.BASE=K.BASE,this.ZERO=K.ZERO,this.Fn=K.Fn,this.bits=Y}_unsafeLadder(K,Y,k=this.ZERO){let j=K;for(;Y>t;)Y&r&&(k=k.add(j)),j=j.double(),Y>>=r;return k}precomputeWindow(K,Y){const{windows:k,windowSize:j}=a(Y,this.bits),V=[];let W=K,$=W;for(let A=0;A<k;A++){$=W,V.push($);for(let _=1;_<j;_++)$=$.add(W),V.push($);W=$.double()}return V}wNAF(K,Y,k){if(!this.Fn.isValid(k))throw new Error("invalid scalar");let j=this.ZERO,V=this.BASE;const W=a(K,this.bits);for(let $=0;$<W.windows;$++){const{nextN:A,offset:_,isZero:R,isNeg:P,isNegF:q,offsetF:F}=c(k,$,W);k=A,R?V=V.add(i(q,Y[F])):j=j.add(i(P,Y[_]))}return y(k),{p:j,f:V}}wNAFUnsafe(K,Y,k,j=this.ZERO){const V=a(K,this.bits);for(let W=0;W<V.windows&&k!==t;W++){const{nextN:$,offset:A,isZero:_,isNeg:R}=c(k,W,V);if(k=$,!_){const P=Y[A];j=j.add(R?P.negate():P)}}return y(k),j}getPrecomputes(K,Y,k){let j=f.get(Y);return j||(j=this.precomputeWindow(Y,K),K!==1&&(typeof k=="function"&&(j=k(j)),f.set(Y,j))),j}cached(K,Y,k){const j=w(K);return this.wNAF(j,this.getPrecomputes(j,K,k),Y)}unsafe(K,Y,k,j){const V=w(K);return V===1?this._unsafeLadder(K,Y,j):this.wNAFUnsafe(V,this.getPrecomputes(V,K,k),Y,j)}createCache(K,Y){o(Y,this.bits),m.set(K,Y),f.delete(K)}hasCache(K){return w(K)!==1}}Nu.wNAF=b;function E(U,K,Y,k){let j=K,V=U.ZERO,W=U.ZERO;for(;Y>t||k>t;)Y&r&&(V=V.add(j)),k&r&&(W=W.add(j)),j=j.double(),Y>>=r,k>>=r;return{p1:V,p2:W}}function T(U,K,Y,k){u(Y,U),d(k,K);const j=Y.length,V=k.length;if(j!==V)throw new Error("arrays of points and scalars must have equal length");const W=U.ZERO,$=(0,n.bitLen)(BigInt(j));let A=1;$>12?A=$-3:$>4?A=$-2:$>0&&(A=2);const _=(0,n.bitMask)(A),R=new Array(Number(_)+1).fill(W),P=Math.floor((K.BITS-1)/A)*A;let q=W;for(let F=P;F>=0;F-=A){R.fill(W);for(let B=0;B<V;B++){const C=k[B],M=Number(C>>BigInt(F)&_);R[M]=R[M].add(Y[B])}let z=W;for(let B=R.length-1,C=W;B>0;B--)C=C.add(R[B]),z=z.add(C);if(q=q.add(z),F!==0)for(let B=0;B<A;B++)q=q.double()}return q}function N(U,K,Y,k){o(k,K.BITS),u(Y,U);const j=U.ZERO,V=2**k-1,W=Math.ceil(K.BITS/k),$=(0,n.bitMask)(k),A=Y.map(_=>{const R=[];for(let P=0,q=_;P<V;P++)R.push(q),q=q.add(_);return R});return _=>{if(d(_,K),_.length>Y.length)throw new Error("array of scalars must be smaller than array of points");let R=j;for(let P=0;P<W;P++){if(R!==j)for(let F=0;F<k;F++)R=R.double();const q=BigInt(W*k-(P+1)*k);for(let F=0;F<_.length;F++){const z=_[F],B=Number(z>>q&$);B&&(R=R.add(A[F][B-1]))}}return R}}function I(U){return(0,e.validateField)(U.Fp),(0,n.validateObject)(U,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(U.n,U.nBitLength),...U,p:U.Fp.ORDER})}function H(U,K,Y){if(K){if(K.ORDER!==U)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,e.validateField)(K),K}else return(0,e.Field)(U,{isLE:Y})}function L(U,K,Y={},k){if(k===void 0&&(k=U==="edwards"),!K||typeof K!="object")throw new Error(`expected valid ${U} CURVE object`);for(const A of["p","n","h"]){const _=K[A];if(!(typeof _=="bigint"&&_>t))throw new Error(`CURVE.${A} must be positive bigint`)}const j=H(K.p,Y.Fp,k),V=H(K.n,Y.Fn,k),$=["Gx","Gy","a",U==="weierstrass"?"b":"d"];for(const A of $)if(!j.isValid(K[A]))throw new Error(`CURVE.${A} must be valid field element of CURVE.Fp`);return K=Object.freeze(Object.assign({},K)),{CURVE:K,Fp:j,Fn:V}}return Nu}var Um={},aY;function t7e(){if(aY)return Um;
1033aY=1,Object.defineProperty(Um,"__esModule",{value:!0}),Um.PrimeEdwardsPoint=void 0,Um.edwards=c,Um.eddsa=d,Um.twistedEdwards=w;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const n=dE(),e=Jie(),t=s4(),r=BigInt(0),i=BigInt(1),s=BigInt(2),o=BigInt(8);function a(y,b,E,T){const N=y.sqr(E),I=y.sqr(T),H=y.add(y.mul(b.a,N),I),L=y.add(y.ONE,y.mul(b.d,y.mul(N,I)));return y.eql(H,L)}function c(y,b={}){const E=(0,e._createCurveFields)("edwards",y,b,b.FpFnLE),{Fp:T,Fn:N}=E;let I=E.CURVE;const{h:H}=I;(0,n._validateObject)(b,{},{uvRatio:"function"});const L=s<<BigInt(N.BYTES*8)-i,U=A=>T.create(A),K=b.uvRatio||((A,_)=>{try{return{isValid:!0,value:T.sqrt(T.div(A,_))}}catch{return{isValid:!1,value:r}}});if(!a(T,I,I.Gx,I.Gy))throw new Error("bad curve params: generator point");function Y(A,_,R=!1){const P=R?i:r;return(0,n.aInRange)("coordinate "+A,_,P,L),_}function k(A){if(!(A instanceof W))throw new Error("ExtendedPoint expected")}const j=(0,n.memoized)((A,_)=>{const{X:R,Y:P,Z:q}=A,F=A.is0();_==null&&(_=F?o:T.inv(q));const z=U(R*_),B=U(P*_),C=T.mul(q,_);if(F)return{x:r,y:i};if(C!==i)throw new Error("invZ was invalid");return{x:z,y:B}}),V=(0,n.memoized)(A=>{const{a:_,d:R}=I;if(A.is0())throw new Error("bad point: ZERO");const{X:P,Y:q,Z:F,T:z}=A,B=U(P*P),C=U(q*q),M=U(F*F),Z=U(M*M),J=U(B*_),ae=U(M*U(J+C)),we=U(Z+U(R*U(B*C)));if(ae!==we)throw new Error("bad point: equation left != right (1)");const he=U(P*q),xe=U(F*z);if(he!==xe)throw new Error("bad point: equation left != right (2)");return!0});class W{constructor(_,R,P,q){this.X=Y("x",_),this.Y=Y("y",R),this.Z=Y("z",P,!0),this.T=Y("t",q),Object.freeze(this)}static CURVE(){return I}static fromAffine(_){if(_ instanceof W)throw new Error("extended point not allowed");const{x:R,y:P}=_||{};return Y("x",R),Y("y",P),new W(R,P,i,U(R*P))}static fromBytes(_,R=!1){const P=T.BYTES,{a:q,d:F}=I;_=(0,n.copyBytes)((0,n._abytes2)(_,P,"point")),(0,n._abool2)(R,"zip215");const z=(0,n.copyBytes)(_),B=_[P-1];z[P-1]=B&-129;const C=(0,n.bytesToNumberLE)(z),M=R?L:T.ORDER;(0,n.aInRange)("point.y",C,r,M);const Z=U(C*C),J=U(Z-i),ae=U(F*Z-q);let{isValid:we,value:he}=K(J,ae);if(!we)throw new Error("bad point: invalid y coordinate");const xe=(he&i)===i,Se=(B&128)!==0;if(!R&&he===r&&Se)throw new Error("bad point: x=0 and x_0=1");return Se!==xe&&(he=U(-he)),W.fromAffine({x:he,y:C})}static fromHex(_,R=!1){return W.fromBytes((0,n.ensureBytes)("point",_),R)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(_=8,R=!0){return $.createCache(this,_),R||this.multiply(s),this}assertValidity(){V(this)}equals(_){k(_);const{X:R,Y:P,Z:q}=this,{X:F,Y:z,Z:B}=_,C=U(R*B),M=U(F*q),Z=U(P*B),J=U(z*q);return C===M&&Z===J}is0(){return this.equals(W.ZERO)}negate(){return new W(U(-this.X),this.Y,this.Z,U(-this.T))}double(){const{a:_}=I,{X:R,Y:P,Z:q}=this,F=U(R*R),z=U(P*P),B=U(s*U(q*q)),C=U(_*F),M=R+P,Z=U(U(M*M)-F-z),J=C+z,ae=J-B,we=C-z,he=U(Z*ae),xe=U(J*we),Se=U(Z*we),Re=U(ae*J);return new W(he,xe,Re,Se)}add(_){k(_);const{a:R,d:P}=I,{X:q,Y:F,Z:z,T:B}=this,{X:C,Y:M,Z,T:J}=_,ae=U(q*C),we=U(F*M),he=U(B*P*J),xe=U(z*Z),Se=U((q+F)*(C+M)-ae-we),Re=xe-he,et=xe+he,Me=U(we-R*ae),Fe=U(Se*Re),ht=U(et*Me),Dt=U(Se*Me),At=U(Re*et);return new W(Fe,ht,At,Dt)}subtract(_){return this.add(_.negate())}multiply(_){if(!N.isValidNot0(_))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:R,f:P}=$.cached(this,_,q=>(0,e.normalizeZ)(W,q));return(0,e.normalizeZ)(W,[R,P])[0]}multiplyUnsafe(_,R=W.ZERO){if(!N.isValid(_))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return _===r?W.ZERO:this.is0()||_===i?this:$.unsafe(this,_,P=>(0,e.normalizeZ)(W,P),R)}isSmallOrder(){return this.multiplyUnsafe(H).is0()}isTorsionFree(){return $.unsafe(this,I.n).is0()}toAffine(_){return j(this,_)}clearCofactor(){return H===i?this:this.multiplyUnsafe(H)}toBytes(){const{x:_,y:R}=this.toAffine(),P=T.toBytes(R);return P[P.length-1]|=_&i?128:0,P}toHex(){return(0,n.bytesToHex)(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(_){return(0,e.normalizeZ)(W,_)}static msm(_,R){return(0,e.pippenger)(W,N,_,R)}
1033_setWindowSize(_){this.precompute(_)}toRawBytes(){return this.toBytes()}}W.BASE=new W(I.Gx,I.Gy,i,U(I.Gx*I.Gy)),W.ZERO=new W(r,i,i,r),W.Fp=T,W.Fn=N;const $=new e.wNAF(W,N.BITS);return W.BASE.precompute(8),W}class u{constructor(b){this.ep=b}static fromBytes(b){(0,n.notImplemented)()}static fromHex(b){(0,n.notImplemented)()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(b){return this.ep.toAffine(b)}toHex(){return(0,n.bytesToHex)(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(b){return this.assertSame(b),this.init(this.ep.add(b.ep))}subtract(b){return this.assertSame(b),this.init(this.ep.subtract(b.ep))}multiply(b){return this.init(this.ep.multiply(b))}multiplyUnsafe(b){return this.init(this.ep.multiplyUnsafe(b))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(b,E){return this.init(this.ep.precompute(b,E))}toRawBytes(){return this.toBytes()}}Um.PrimeEdwardsPoint=u;function d(y,b,E={}){if(typeof b!="function")throw new Error('"hash" function param is required');(0,n._validateObject)(E,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:T}=E,{BASE:N,Fp:I,Fn:H}=y,L=E.randomBytes||n.randomBytes,U=E.adjustScalarBytes||(M=>M),K=E.domain||((M,Z,J)=>{if((0,n._abool2)(J,"phflag"),Z.length||J)throw new Error("Contexts/pre-hash are not supported");return M});function Y(M){return H.create((0,n.bytesToNumberLE)(M))}function k(M){const Z=P.secretKey;M=(0,n.ensureBytes)("private key",M,Z);const J=(0,n.ensureBytes)("hashed private key",b(M),2*Z),ae=U(J.slice(0,Z)),we=J.slice(Z,2*Z),he=Y(ae);return{head:ae,prefix:we,scalar:he}}function j(M){const{head:Z,prefix:J,scalar:ae}=k(M),we=N.multiply(ae),he=we.toBytes();return{head:Z,prefix:J,scalar:ae,point:we,pointBytes:he}}function V(M){return j(M).pointBytes}function W(M=Uint8Array.of(),...Z){const J=(0,n.concatBytes)(...Z);return Y(b(K(J,(0,n.ensureBytes)("context",M),!!T)))}function $(M,Z,J={}){M=(0,n.ensureBytes)("message",M),T&&(M=T(M));const{prefix:ae,scalar:we,pointBytes:he}=j(Z),xe=W(J.context,ae,M),Se=N.multiply(xe).toBytes(),Re=W(J.context,Se,he,M),et=H.create(xe+Re*we);if(!H.isValid(et))throw new Error("sign failed: invalid s");
1033const Me=(0,n.concatBytes)(Se,H.toBytes(et));return(0,n._abytes2)(Me,P.signature,"result")}const A={zip215:!0};function _(M,Z,J,ae=A){const{context:we,zip215:he}=ae,xe=P.signature;M=(0,n.ensureBytes)("signature",M,xe),Z=(0,n.ensureBytes)("message",Z),J=(0,n.ensureBytes)("publicKey",J,P.publicKey),he!==void 0&&(0,n._abool2)(he,"zip215"),T&&(Z=T(Z));const Se=xe/2,Re=M.subarray(0,Se),et=(0,n.bytesToNumberLE)(M.subarray(Se,xe));let Me,Fe,ht;try{Me=y.fromBytes(J,he),Fe=y.fromBytes(Re,he),ht=N.multiplyUnsafe(et)}catch{return!1}if(!he&&Me.isSmallOrder())return!1;const Dt=W(we,Fe.toBytes(),Me.toBytes(),Z);return Fe.add(Me.multiplyUnsafe(Dt)).subtract(ht).clearCofactor().is0()}const R=I.BYTES,P={secretKey:R,publicKey:R,signature:2*R,seed:R};function q(M=L(P.seed)){return(0,n._abytes2)(M,P.seed,"seed")}function F(M){const Z=C.randomSecretKey(M);return{secretKey:Z,publicKey:V(Z)}}function z(M){return(0,n.isBytes)(M)&&M.length===H.BYTES}function B(M,Z){try{return!!y.fromBytes(M,Z)}catch{return!1}}const C={getExtendedPublicKey:j,randomSecretKey:q,isValidSecretKey:z,isValidPublicKey:B,toMontgomery(M){const{y:Z}=y.fromBytes(M),J=P.publicKey,ae=J===32;if(!ae&&J!==57)throw new Error("only defined for 25519 and 448");const we=ae?I.div(i+Z,i-Z):I.div(Z-i,Z+i);return I.toBytes(we)},toMontgomeryPriv(M){const Z=P.secretKey;(0,n._abytes2)(M,Z);const J=b(M.subarray(0,Z));return U(J).subarray(0,Z)},randomPrivateKey:q,precompute(M=8,Z=y.BASE){return Z.precompute(M,!1)}};return Object.freeze({keygen:F,getPublicKey:V,sign:$,verify:_,utils:C,Point:y,lengths:P})}function f(y){const b={a:y.a,d:y.d,p:y.Fp.ORDER,n:y.n,h:y.h,Gx:y.Gx,Gy:y.Gy},E=y.Fp,T=(0,t.Field)(b.n,y.nBitLength,!0),N={Fp:E,Fn:T,uvRatio:y.uvRatio},I={randomBytes:y.randomBytes,adjustScalarBytes:y.adjustScalarBytes,domain:y.domain,prehash:y.prehash,mapToCurve:y.mapToCurve};return{CURVE:b,curveOpts:N,hash:y.hash,eddsaOpts:I}}function m(y,b){const E=b.Point;return Object.assign({},b,{ExtendedPoint:E,CURVE:y,nBitLength:E.Fn.BITS,nByteLength:E.Fn.BYTES})}function w(y){const{CURVE:b,curveOpts:E,hash:T,eddsaOpts:N}=f(y),I=c(b,E),H=d(I,T,N);return m(y,H)}return Um}var VP={},cY;function n7e(){return cY||(cY=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n._DST_scalar=void 0,n.expand_message_xmd=c,n.expand_message_xof=u,n.hash_to_field=d,n.isogenyMap=f,n.createHasher=m;const e=dE(),t=s4(),r=e.bytesToNumberBE;function i(w,y){if(o(w),o(y),w<0||w>=1<<8*y)throw new Error("invalid I2OSP input: "+w);const b=Array.from({length:y}).fill(0);for(let E=y-1;E>=0;E--)b[E]=w&255,w>>>=8;return new Uint8Array(b)}function s(w,y){const b=new Uint8Array(w.length);for(let E=0;E<w.length;E++)b[E]=w[E]^y[E];return b}function o(w){if(!Number.isSafeInteger(w))throw new Error("number expected")}function a(w){if(!(0,e.isBytes)(w)&&typeof w!="string")throw new Error("DST must be Uint8Array or string");return typeof w=="string"?(0,e.utf8ToBytes)(w):w}function c(w,y,b,E){(0,e.abytes)(w),o(b),y=a(y),y.length>255&&(y=E((0,e.concatBytes)((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-"),y)));const{outputLen:T,blockLen:N}=E,I=Math.ceil(b/T);if(b>65535||I>255)throw new Error("expand_message_xmd: invalid lenInBytes");const H=(0,e.concatBytes)(y,i(y.length,1)),L=i(0,N),U=i(b,2),K=new Array(I),Y=E((0,e.concatBytes)(L,w,U,i(0,1),H));K[0]=E((0,e.concatBytes)(Y,i(1,1),H));for(let j=1;j<=I;j++){const V=[s(Y,K[j-1]),i(j+1,1),H];K[j]=E((0,e.concatBytes)(...V))}return(0,e.concatBytes)(...K).slice(0,b)}function u(w,y,b,E,T){if((0,e.abytes)(w),o(b),y=a(y),y.length>255){const N=Math.ceil(2*E/8);y=T.create({dkLen:N}).update((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(y).digest()}if(b>65535||y.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return T.create({dkLen:b}).update(w).update(i(b,2)).update(y).update(i(y.length,1)).digest()}function d(w,y,b){(0,e._validateObject)(b,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:E,k:T,m:N,hash:I,expand:H,DST:L}=b;if(!(0,e.isHash)(b.hash))throw new Error("expected valid hash");(0,e.abytes)(w),o(y);const U=E.toString(2).length,K=Math.ceil((U+T)/8),Y=y*N*K;let k;if(H==="xmd")k=c(w,L,Y,I);else if(H==="xof")k=u(w,L,Y,T,I);else if(H==="_internal_pass")k=w;else throw new Error('expand must be "xmd" or "xof"');const j=new Array(y);for(let V=0;V<y;V++){const W=new Array(N);for(let $=0;$<N;$++){const A=K*($+V*N),_=k.subarray(A,A+K);W[$]=(0,t.mod)(r(_),E)}j[V]=W}return j}function f(w,y){const b=y.map(E=>Array.from(E).reverse());return(E,T)=>{const[N,I,H,L]=b.map(Y=>Y.reduce((k,j)=>w.add(w.mul(k,E),j))),[U,K]=(0,t.FpInvertBatch)(w,[I,L],!0);return E=w.mul(N,U),T=w.mul(T,w.mul(H,K)),{x:E,y:T}}}n._DST_scalar=(0,e.utf8ToBytes)("HashToScalar-");function m(w,y,b){if(typeof y!="function")throw new Error("mapToCurve() must be defined");function E(N){return w.fromAffine(y(N))}function T(N){const I=N.clearCofactor();return I.equals(w.ZERO)?w.ZERO:(I.assertValidity(),I)}return{defaults:b,hashToCurve(N,I){const H=Object.assign({},b,I),L=d(N,2,H),U=E(L[0]),K=E(L[1]);return T(U.add(K))},encodeToCurve(N,I){const H=b.encodeDST?{DST:b.encodeDST}:{},L=Object.assign({},b,H,I),U=d(N,1,L),K=E(U[0]);return T(K)},mapToCurve(N){if(!Array.isArray(N))throw new Error("expected array of bigints");for(const I of N)if(typeof I!="bigint")throw new Error("expected array of bigints");return T(E(N))},hashToScalar(N,I){const H=w.Fn.ORDER,L=Object.assign({},b,{p:H,m:1,DST:n._DST_scalar},I);return d(N,1,L)[0][0]}}}}(VP)),VP}var LI={},lY;function r7e(){if(lY)return LI;lY=1,Object.defineProperty(LI,"__esModule",{value:!0}),LI.montgomery=o;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const n=dE(),e=s4(),t=BigInt(0),r=BigInt(1),i=BigInt(2);function s(a){return(0,n._validateObject)(a,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...a})}function o(a){const c=s(a),{P:u,type:d,adjustScalarBytes:f,powPminus2:m,randomBytes:w}=c,y=d==="x25519";if(!y&&d!=="x448")throw new Error("invalid type");const b=w||n.randomBytes,E=y?255:448,T=y?32:56,N=BigInt(y?9:5),I=BigInt(y?121665:39081),H=y?i**BigInt(254):i**BigInt(447),L=y?BigInt(8)*i**BigInt(251)-r:BigInt(4)*i**BigInt(445)-r,U=H+L+r,K=z=>(0,e.mod)(z,u),Y=k(N);function k(z){return(0,n.numberToBytesLE)(K(z),T)}function j(z){const B=(0,n.ensureBytes)("u coordinate",z,T);return y&&(B[31]&=127),K((0,n.bytesToNumberLE)(B))}function V(z){return(0,n.bytesToNumberLE)(f((0,n.ensureBytes)("scalar",z,T)))}function W(z,B){const C=_(j(B),V(z));if(C===t)throw new Error("invalid private or public key received");return k(C)}function $(z){return W(z,Y)}function A(z,B,C){const M=K(z*(B-C));return B=K(B-M),C=K(C+M),{x_2:B,x_3:C}}function _(z,B){(0,n.aInRange)("u",z,t,u),(0,n.aInRange)("scalar",B,H,U);const C=B,M=z;let Z=r,J=t,ae=z,we=r,he=t;for(let Se=BigInt(E-1);Se>=t;Se--){const Re=C>>Se&r;he^=Re,{x_2:Z,x_3:ae}=A(he,Z,ae),{x_2:J,x_3:we}=A(he,J,we),he=Re;
1033const et=Z+J,Me=K(et*et),Fe=Z-J,ht=K(Fe*Fe),Dt=Me-ht,At=ae+we,Wt=ae-we,yn=K(Wt*et),Yt=K(At*Fe),Jt=yn+Yt,bn=yn-Yt;ae=K(Jt*Jt),we=K(M*K(bn*bn)),Z=K(Me*ht),J=K(Dt*(Me+K(I*Dt)))}({x_2:Z,x_3:ae}=A(he,Z,ae)),{x_2:J,x_3:we}=A(he,J,we);const xe=m(J);return K(Z*xe)}const R={secretKey:T,publicKey:T,seed:T},P=(z=b(T))=>((0,n.abytes)(z,R.seed),z);function q(z){const B=P(z);return{secretKey:B,publicKey:$(B)}}return{keygen:q,getSharedSecret:(z,B)=>W(z,B),getPublicKey:z=>$(z),scalarMult:W,scalarMultBase:$,utils:{randomSecretKey:P,randomPrivateKey:P},GuBytes:Y.slice(),lengths:R}}return LI}var uY;function i7e(){return uY||(uY=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.hash_to_ristretto255=n.hashToRistretto255=n.encodeToCurve=n.hashToCurve=n.RistrettoPoint=n.edwardsToMontgomery=n.ED25519_TORSION_SUBGROUP=n.ristretto255_hasher=n.ristretto255=n.ed25519_hasher=n.x25519=n.ed25519ph=n.ed25519ctx=n.ed25519=void 0,n.edwardsToMontgomeryPub=ae,n.edwardsToMontgomeryPriv=we;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=e7e(),t=q_(),r=Jie(),i=t7e(),s=n7e(),o=s4(),a=r7e(),c=dE(),u=BigInt(0),d=BigInt(1),f=BigInt(2),m=BigInt(3),w=BigInt(5),y=BigInt(8),b=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),E={p:b,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:y,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function T(he){const xe=BigInt(10),Se=BigInt(20),Re=BigInt(40),et=BigInt(80),Me=b,ht=he*he%Me*he%Me,Dt=(0,o.pow2)(ht,f,Me)*ht%Me,At=(0,o.pow2)(Dt,d,Me)*he%Me,Wt=(0,o.pow2)(At,w,Me)*At%Me,yn=(0,o.pow2)(Wt,xe,Me)*Wt%Me,Yt=(0,o.pow2)(yn,Se,Me)*yn%Me,Jt=(0,o.pow2)(Yt,Re,Me)*Yt%Me,bn=(0,o.pow2)(Jt,et,Me)*Jt%Me,Kt=(0,o.pow2)(bn,et,Me)*Jt%Me,En=(0,o.pow2)(Kt,xe,Me)*Wt%Me;return{pow_p_5_8:(0,o.pow2)(En,f,Me)*he%Me,b2:ht}}function N(he){return he[0]&=248,he[31]&=127,he[31]|=64,he}const I=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function H(he,xe){const Se=b,Re=(0,o.mod)(xe*xe*xe,Se),et=(0,o.mod)(Re*Re*xe,Se),Me=T(he*et).pow_p_5_8;let Fe=(0,o.mod)(he*Re*Me,Se);const ht=(0,o.mod)(xe*Fe*Fe,Se),Dt=Fe,At=(0,o.mod)(Fe*I,Se),Wt=ht===he,yn=ht===(0,o.mod)(-he,Se),Yt=ht===(0,o.mod)(-he*I,Se);return Wt&&(Fe=Dt),(yn||Yt)&&(Fe=At),(0,o.isNegativeLE)(Fe,Se)&&(Fe=(0,o.mod)(-Fe,Se)),{isValid:Wt||yn,value:Fe}}const L=(0,o.Field)(E.p,{isLE:!0}),U=(0,o.Field)(E.n,{isLE:!0}),K={...E,Fp:L,hash:e.sha512,adjustScalarBytes:N,uvRatio:H};n.ed25519=(0,i.twistedEdwards)(K);function Y(he,xe,Se){if(xe.length>255)throw new Error("Context is too big");return(0,t.concatBytes)((0,t.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([Se?1:0,xe.length]),xe,he)}n.ed25519ctx=(0,i.twistedEdwards)({...K,domain:Y}),n.ed25519ph=(0,i.twistedEdwards)(Object.assign({},K,{domain:Y,prehash:e.sha512})),n.x25519=(()=>{const he=L.ORDER;return(0,a.montgomery)({P:he,type:"x25519",powPminus2:xe=>{const{pow_p_5_8:Se,b2:Re}=T(xe);return(0,o.mod)((0,o.pow2)(Se,m,he)*Re,he)},adjustScalarBytes:N})})();const k=(b+m)/y,j=L.pow(f,k),V=L.sqrt(L.neg(L.ONE));function W(he){const xe=(b-w)/y,Se=BigInt(486662);let Re=L.sqr(he);Re=L.mul(Re,f);let et=L.add(Re,L.ONE),Me=L.neg(Se),Fe=L.sqr(et),ht=L.mul(Fe,et),Dt=L.mul(Re,Se);Dt=L.mul(Dt,Me),Dt=L.add(Dt,Fe),Dt=L.mul(Dt,Me);let At=L.sqr(ht);Fe=L.sqr(At),At=L.mul(At,ht),At=L.mul(At,Dt),Fe=L.mul(Fe,At);let Wt=L.pow(Fe,xe);Wt=L.mul(Wt,At);let yn=L.mul(Wt,V);Fe=L.sqr(Wt),Fe=L.mul(Fe,ht);let Yt=L.eql(Fe,Dt),Jt=L.cmov(yn,Wt,Yt),bn=L.mul(Me,Re),Kt=L.mul(Wt,he);Kt=L.mul(Kt,j);let En=L.mul(Kt,V),Xe=L.mul(Dt,Re);Fe=L.sqr(Kt),Fe=L.mul(Fe,ht);let at=L.eql(Fe,Xe),rt=L.cmov(En,Kt,at);Fe=L.sqr(Jt),Fe=L.mul(Fe,ht);let lt=L.eql(Fe,Dt),yt=L.cmov(bn,Me,lt),oe=L.cmov(rt,Jt,lt),Q=L.isOdd(oe);return oe=L.cmov(oe,L.neg(oe),lt!==Q),{xMn:yt,xMd:et,yMn:oe,yMd:d}}const $=(0,o.FpSqrtEven)(L,L.neg(BigInt(486664)));function A(he){const{xMn:xe,xMd:Se,yMn:Re,yMd:et}=W(he);let Me=L.mul(xe,et);Me=L.mul(Me,$);let Fe=L.mul(Se,Re),ht=L.sub(xe,Se),Dt=L.add(xe,Se),At=L.mul(Fe,Dt),Wt=L.eql(At,L.ZERO);Me=L.cmov(Me,L.ZERO,Wt),Fe=L.cmov(Fe,L.ONE,Wt),ht=L.cmov(ht,L.ONE,Wt),Dt=L.cmov(Dt,L.ONE,Wt);const[yn,Yt]=(0,o.FpInvertBatch)(L,[Fe,Dt],!0);return{x:L.mul(Me,yn),y:L.mul(ht,Yt)}}n.ed25519_hasher=(0,s.createHasher)(n.ed25519.Point,he=>A(he[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:b,m:1,k:128,expand:"xmd",hash:e.sha512});const _=I,R=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),P=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),q=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),F=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),z=he=>H(d,he),B=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),C=he=>n.ed25519.Point.Fp.create((0,c.bytesToNumberLE)(he)&B);function M(he){const{d:xe}=E,Se=b,Re=Xe=>L.create(Xe),et=Re(_*he*he),Me=Re((et+d)*q);let Fe=BigInt(-1);const ht=Re((Fe-xe*et)*Re(et+xe));let{isValid:Dt,value:At}=H(Me,ht),Wt=Re(At*he);(0,o.isNegativeLE)(Wt,Se)||(Wt=Re(-Wt)),Dt||(At=Wt),Dt||(Fe=et);const yn=Re(Fe*(et-d)*F-ht),Yt=At*At,Jt=Re((At+At)*ht),bn=Re(yn*R),Kt=Re(d-Yt),En=Re(d+Yt);return new n.ed25519.Point(Re(Jt*En),Re(Kt*bn),Re(bn*En),Re(Jt*Kt))}function Z(he){(0,t.abytes)(he,64);const xe=C(he.subarray(0,32)),Se=M(xe),Re=C(he.subarray(32,64)),et=M(Re);
1033return new J(Se.add(et))}class J extends i.PrimeEdwardsPoint{constructor(xe){super(xe)}static fromAffine(xe){return new J(n.ed25519.Point.fromAffine(xe))}assertSame(xe){if(!(xe instanceof J))throw new Error("RistrettoPoint expected")}init(xe){return new J(xe)}static hashToCurve(xe){return Z((0,c.ensureBytes)("ristrettoHash",xe,64))}static fromBytes(xe){(0,t.abytes)(xe,32);const{a:Se,d:Re}=E,et=b,Me=lt=>L.create(lt),Fe=C(xe);if(!(0,c.equalBytes)(L.toBytes(Fe),xe)||(0,o.isNegativeLE)(Fe,et))throw new Error("invalid ristretto255 encoding 1");const ht=Me(Fe*Fe),Dt=Me(d+Se*ht),At=Me(d-Se*ht),Wt=Me(Dt*Dt),yn=Me(At*At),Yt=Me(Se*Re*Wt-yn),{isValid:Jt,value:bn}=z(Me(Yt*yn)),Kt=Me(bn*At),En=Me(bn*Kt*Yt);let Xe=Me((Fe+Fe)*Kt);(0,o.isNegativeLE)(Xe,et)&&(Xe=Me(-Xe));const at=Me(Dt*En),rt=Me(Xe*at);if(!Jt||(0,o.isNegativeLE)(rt,et)||at===u)throw new Error("invalid ristretto255 encoding 2");return new J(new n.ed25519.Point(Xe,at,d,rt))}static fromHex(xe){return J.fromBytes((0,c.ensureBytes)("ristrettoHex",xe,32))}static msm(xe,Se){return(0,r.pippenger)(J,n.ed25519.Point.Fn,xe,Se)}toBytes(){let{X:xe,Y:Se,Z:Re,T:et}=this.ep;const Me=b,Fe=En=>L.create(En),ht=Fe(Fe(Re+Se)*Fe(Re-Se)),Dt=Fe(xe*Se),At=Fe(Dt*Dt),{value:Wt}=z(Fe(ht*At)),yn=Fe(Wt*ht),Yt=Fe(Wt*Dt),Jt=Fe(yn*Yt*et);let bn;if((0,o.isNegativeLE)(et*Jt,Me)){let En=Fe(Se*_),Xe=Fe(xe*_);xe=En,Se=Xe,bn=Fe(yn*P)}else bn=Yt;(0,o.isNegativeLE)(xe*Jt,Me)&&(Se=Fe(-Se));let Kt=Fe((Re-Se)*bn);return(0,o.isNegativeLE)(Kt,Me)&&(Kt=Fe(-Kt)),L.toBytes(Kt)}equals(xe){this.assertSame(xe);const{X:Se,Y:Re}=this.ep,{X:et,Y:Me}=xe.ep,Fe=At=>L.create(At),ht=Fe(Se*Me)===Fe(Re*et),Dt=Fe(Re*Me)===Fe(Se*et);return ht||Dt}is0(){return this.equals(J.ZERO)}}J.BASE=new J(n.ed25519.Point.BASE),J.ZERO=new J(n.ed25519.Point.ZERO),J.Fp=L,J.Fn=U,n.ristretto255={Point:J},n.ristretto255_hasher={hashToCurve(he,xe){const Se=(xe==null?void 0:xe.DST)||"ristretto255_XMD:SHA-512_R255MAP_RO_",Re=(0,s.expand_message_xmd)(he,Se,64,e.sha512);return Z(Re)},hashToScalar(he,xe={DST:s._DST_scalar}){const Se=(0,s.expand_message_xmd)(he,xe.DST,64,e.sha512);return U.create((0,c.bytesToNumberLE)(Se))}},n.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];function ae(he){return n.ed25519.utils.toMontgomery((0,c.ensureBytes)("pub",he))}n.edwardsToMontgomery=ae;function we(he){return n.ed25519.utils.toMontgomeryPriv((0,c.ensureBytes)("pub",he))}n.RistrettoPoint=J,n.hashToCurve=n.ed25519_hasher.hashToCurve,n.encodeToCurve=n.ed25519_hasher.encodeToCurve,n.hashToRistretto255=n.ristretto255_hasher.hashToCurve,n.hash_to_ristretto255=n.ristretto255_hasher.hashToCurve}(FP)),FP}var FA={},dY;function ese(){if(dY)return FA;dY=1,Object.defineProperty(FA,"__esModule",{value:!0}),FA.arraysEqual=n,FA.bytesEqual=e;function n(t,r){if(t===r)return!0;const i=t.length;if(i!==r.length)return!1;for(let s=0;s<i;s++)if(t[s]!==r[s])return!1;return!0}function e(t,r){return n(t,r)}return FA}var hY;function tse(){if(hY)return jA;hY=1,Object.defineProperty(jA,"__esModule",{value:!0}),jA.verifyMessageSignature=t,jA.verifySignMessage=r;const n=i7e(),e=ese();function t({message:i,signedMessage:s,signature:o,publicKey:a}){return(0,e.bytesEqual)(i,s)&&n.ed25519.verify(o,s,a)}function r(i,s){const{message:o,account:{publicKey:a}}=i,{signedMessage:c,signature:u}=s;return t({message:o,signedMessage:c,signature:u,publicKey:a})}return jA}var fY;function s7e(){if(fY)return af;fY=1,Object.defineProperty(af,"__esModule",{value:!0}),af.verifySignIn=t,af.deriveSignInMessage=r,af.deriveSignInMessageText=i,af.parseSignInMessage=s,af.parseSignInMessageText=H,af.createSignInMessage=L,af.createSignInMessageText=U;const n=tse(),e=ese();function t(K,Y){const{signedMessage:k,signature:j,account:{publicKey:V}}=Y,W=r(K,Y);return!!W&&(0,n.verifyMessageSignature)({message:W,signedMessage:k,signature:j,publicKey:V})}function r(K,Y){const k=i(K,Y);return k?new TextEncoder().encode(k):null}function i(K,Y){const k=s(Y.signedMessage);if(!k||K.domain&&K.domain!==k.domain||K.address&&K.address!==k.address||K.statement!==k.statement||K.uri!==k.uri||K.version!==k.version||K.chainId!==k.chainId||K.nonce!==k.nonce||K.issuedAt!==k.issuedAt||K.expirationTime!==k.expirationTime||K.notBefore!==k.notBefore||K.requestId!==k.requestId)return null;if(K.resources){if(!k.resources||!(0,e.arraysEqual)(K.resources,k.resources))return null}else if(k.resources)return null;return U(k)}function s(K){const Y=new TextDecoder().decode(K);return H(Y)}const o="(?<domain>[^\\n]+?) wants you to sign in with your Solana account:\\n",a="(?<address>[^\\n]+)(?:\\n|$)",c="(?:\\n(?<statement>[\\S\\s]*?)(?:\\n|$))??",N="(?:\\nURI: (?<uri>[^\\n]+))?(?:\\nVersion: (?<version>[^\\n]+))?(?:\\nChain ID: (?<chainId>[^\\n]+))?(?:\\nNonce: (?<nonce>[^\\n]+))?(?:\\nIssued At: (?<issuedAt>[^\\n]+))?(?:\\nExpiration Time: (?<expirationTime>[^\\n]+))?(?:\\nNot Before: (?<notBefore>[^\\n]+))?(?:\\nRequest ID: (?<requestId>[^\\n]+))?(?:\\nResources:(?<resources>(?:\\n- [^\\n]+)*))?",I=new RegExp(`^${o}${a}${c}${N}\\n*$`);function H(K){var Y;
1033const k=I.exec(K);if(!k)return null;const j=k.groups;return j?{domain:j.domain,address:j.address,statement:j.statement,uri:j.uri,version:j.version,nonce:j.nonce,chainId:j.chainId,issuedAt:j.issuedAt,expirationTime:j.expirationTime,notBefore:j.notBefore,requestId:j.requestId,resources:(Y=j.resources)===null||Y===void 0?void 0:Y.split(` 1034- `).slice(1)}:null}function L(K){const Y=U(K);return new TextEncoder().encode(Y)}function U(K){let Y=`${K.domain} wants you to sign in with your Solana account: 1035`;Y+=`${K.address}`,K.statement&&(Y+=` 1036 1037${K.statement}`);const k=[];if(K.uri&&k.push(`URI: ${K.uri}`),K.version&&k.push(`Version: ${K.version}`),K.chainId&&k.push(`Chain ID: ${K.chainId}`),K.nonce&&k.push(`Nonce: ${K.nonce}`),K.issuedAt&&k.push(`Issued At: ${K.issuedAt}`),K.expirationTime&&k.push(`Expiration Time: ${K.expirationTime}`),K.notBefore&&k.push(`Not Before: ${K.notBefore}`),K.requestId&&k.push(`Request ID: ${K.requestId}`),K.resources){k.push("Resources:");for(const j of K.resources)k.push(`- ${j}`)}return k.length&&(Y+=` 1038 1039${k.join(` 1040`)}`),Y}return af}var pY;function o7e(){return pY||(pY=1,function(n){var e=ly&&ly.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),t=ly&&ly.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(n,"__esModule",{value:!0}),t(GDe(),n),t(ZDe(),n),t(s7e(),n),t(tse(),n)}(ly)),ly}var gY;function a7e(){if(gY)return Iu;gY=1,Object.defineProperty(Iu,"__esModule",{value:!0});var n=o7e();const e={ERROR_ASSOCIATION_PORT_OUT_OF_RANGE:"ERROR_ASSOCIATION_PORT_OUT_OF_RANGE",ERROR_REFLECTOR_ID_OUT_OF_RANGE:"ERROR_REFLECTOR_ID_OUT_OF_RANGE",ERROR_FORBIDDEN_WALLET_BASE_URL:"ERROR_FORBIDDEN_WALLET_BASE_URL",ERROR_SECURE_CONTEXT_REQUIRED:"ERROR_SECURE_CONTEXT_REQUIRED",ERROR_SESSION_CLOSED:"ERROR_SESSION_CLOSED",ERROR_SESSION_TIMEOUT:"ERROR_SESSION_TIMEOUT",ERROR_WALLET_NOT_FOUND:"ERROR_WALLET_NOT_FOUND",ERROR_INVALID_PROTOCOL_VERSION:"ERROR_INVALID_PROTOCOL_VERSION",ERROR_BROWSER_NOT_SUPPORTED:"ERROR_BROWSER_NOT_SUPPORTED"};class t extends Error{constructor(...at){const[rt,lt,yt]=at;super(lt),this.code=rt,this.data=yt,this.name="SolanaMobileWalletAdapterError"}}const r={ERROR_AUTHORIZATION_FAILED:-1,ERROR_INVALID_PAYLOADS:-2,ERROR_NOT_SIGNED:-3,ERROR_NOT_SUBMITTED:-4,ERROR_TOO_MANY_PAYLOADS:-5,ERROR_ATTEST_ORIGIN_ANDROID:-100};class i extends Error{constructor(...at){const[rt,lt,yt,oe]=at;super(yt),this.code=lt,this.data=oe,this.jsonRpcMessageId=rt,this.name="SolanaMobileWalletAdapterProtocolError"}}function s(Xe,at,rt,lt){function yt(oe){return oe instanceof rt?oe:new rt(function(Q){Q(oe)})}return new(rt||(rt=Promise))(function(oe,Q){function ee(Te){try{Ee(lt.next(Te))}catch(De){Q(De)}}function fe(Te){try{Ee(lt.throw(Te))}catch(De){Q(De)}}function Ee(Te){Te.done?oe(Te.value):yt(Te.value).then(ee,fe)}Ee((lt=lt.apply(Xe,[])).next())})}function o(Xe){return window.btoa(Xe)}function a(Xe,at){const rt=window.btoa(String.fromCharCode.call(null,...Xe));return at?rt.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):rt}function c(Xe){return new Uint8Array(window.atob(Xe).split("").map(at=>at.charCodeAt(0)))}function u(Xe,at){return s(this,void 0,void 0,function*(){const rt=yield crypto.subtle.exportKey("raw",Xe),lt=yield crypto.subtle.sign({hash:"SHA-256",name:"ECDSA"},at,rt),yt=new Uint8Array(rt.byteLength+lt.byteLength);return yt.set(new Uint8Array(rt),0),yt.set(new Uint8Array(lt),rt.byteLength),yt})}function d(Xe){return n.createSignInMessageText(Xe)}function f(Xe){return o(d(Xe))}const m="solana:signTransactions",w="solana:cloneAuthorization",y="solana:signInWithSolana";function b(Xe,at){return new Proxy({},{get(rt,lt){return lt==="then"?null:(rt[lt]==null&&(rt[lt]=function(yt){return s(this,void 0,void 0,function*(){const{method:oe,params:Q}=E(lt,yt,Xe),ee=yield at(oe,Q);return oe==="authorize"&&Q.sign_in_payload&&!ee.sign_in_result&&(ee.sign_in_result=yield N(Q.sign_in_payload,ee,at)),T(lt,ee,Xe)})}),rt[lt])},defineProperty(){return!1},deleteProperty(){return!1}})}function E(Xe,at,rt){let lt=at,yt=Xe.toString().replace(/[A-Z]/g,oe=>`_${oe.toLowerCase()}`).toLowerCase();switch(Xe){case"authorize":{let{chain:oe}=lt;
1040if(rt==="legacy"){switch(oe){case"solana:testnet":{oe="testnet";break}case"solana:devnet":{oe="devnet";break}case"solana:mainnet":{oe="mainnet-beta";break}default:oe=lt.cluster}lt.cluster=oe}else{switch(oe){case"testnet":case"devnet":{oe=`solana:${oe}`;break}case"mainnet-beta":{oe="solana:mainnet";break}}lt.chain=oe}}case"reauthorize":{const{auth_token:oe,identity:Q}=lt;if(oe)switch(rt){case"legacy":{yt="reauthorize",lt={auth_token:oe,identity:Q};break}default:{yt="authorize";break}}break}}return{method:yt,params:lt}}function T(Xe,at,rt){switch(Xe){case"getCapabilities":{const lt=at;switch(rt){case"legacy":{const yt=[m];return lt.supports_clone_authorization===!0&&yt.push(w),Object.assign(Object.assign({},lt),{features:yt})}case"v1":return Object.assign(Object.assign({},lt),{supports_sign_and_send_transactions:!0,supports_clone_authorization:lt.features.includes(w)})}}}return at}function N(Xe,at,rt){var lt;return s(this,void 0,void 0,function*(){const yt=(lt=Xe.domain)!==null&<!==void 0?lt:window.location.host,oe=at.accounts[0].address,Q=f(Object.assign(Object.assign({},Xe),{domain:yt,address:oe})),ee=yield rt("sign_messages",{addresses:[oe],payloads:[Q]});return{address:oe,signed_message:Q,signature:ee.signed_payloads[0].slice(Q.length)}})}const I=4;function H(Xe){if(Xe>=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");const at=new ArrayBuffer(I);return new DataView(at).setUint32(0,Xe,!1),new Uint8Array(at)}const L=12,U=65;function K(Xe,at,rt){return s(this,void 0,void 0,function*(){const lt=H(at),yt=new Uint8Array(L);crypto.getRandomValues(yt);const oe=yield crypto.subtle.encrypt(k(lt,yt),rt,new TextEncoder().encode(Xe)),Q=new Uint8Array(lt.byteLength+yt.byteLength+oe.byteLength);return Q.set(new Uint8Array(lt),0),Q.set(new Uint8Array(yt),lt.byteLength),Q.set(new Uint8Array(oe),lt.byteLength+yt.byteLength),Q})}function Y(Xe,at){return s(this,void 0,void 0,function*(){const rt=Xe.slice(0,I),lt=Xe.slice(I,I+L),yt=Xe.slice(I+L),oe=yield crypto.subtle.decrypt(k(rt,lt),at,yt);return V().decode(oe)})}function k(Xe,at){return{additionalData:Xe,iv:at,name:"AES-GCM",tagLength:128}}let j;function V(){return j===void 0&&(j=new TextDecoder("utf-8")),j}function W(){return s(this,void 0,void 0,function*(){return yield crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"])})}function $(){return s(this,void 0,void 0,function*(){return yield crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"])})}function A(Xe){let at="";const rt=new Uint8Array(Xe),lt=rt.byteLength;for(let yt=0;yt<lt;yt++)at+=String.fromCharCode(rt[yt]);return window.btoa(at)}function _(){return R(49152+Math.floor(Math.random()*16384))}function R(Xe){if(Xe<49152||Xe>65535)throw new t(e.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,`Association port number must be between 49152 and 65535. ${Xe} given.`,{port:Xe});return Xe}function P(Xe){return Xe.replace(/[/+=]/g,at=>({"/":"_","+":"-","=":"."})[at])}const q="solana-wallet";function F(Xe){return Xe.replace(/(^\/+|\/+$)/g,"").split("/")}function z(Xe,at){let rt=null;if(at){try{rt=new URL(at)}catch{}if((rt==null?void 0:rt.protocol)!=="https:")throw new t(e.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}rt||(rt=new URL(`${q}:/`));const lt=Xe.startsWith("/")?Xe:[...F(rt.pathname),...F(Xe)].join("/");return new URL(lt,rt)}function B(Xe,at,rt,lt=["v1"]){return s(this,void 0,void 0,function*(){const yt=R(at),oe=yield crypto.subtle.exportKey("raw",Xe),Q=A(oe),ee=z("v1/associate/local",rt);return ee.searchParams.set("association",P(Q)),ee.searchParams.set("port",`${yt}`),lt.forEach(fe=>{ee.searchParams.set("v",fe)}),ee})}function C(Xe,at,rt,lt,yt=["v1"]){return s(this,void 0,void 0,function*(){const oe=yield crypto.subtle.exportKey("raw",Xe),Q=A(oe),ee=z("v1/associate/remote",lt);return ee.searchParams.set("association",P(Q)),ee.searchParams.set("reflector",`${at}`),ee.searchParams.set("id",`${a(rt,!0)}`),yt.forEach(fe=>{ee.searchParams.set("v",fe)}),ee})}function M(Xe,at){return s(this,void 0,void 0,function*(){const rt=JSON.stringify(Xe),lt=Xe.id;return K(rt,lt,at)})}function Z(Xe,at){return s(this,void 0,void 0,function*(){const rt=yield Y(Xe,at),lt=JSON.parse(rt);
1040if(Object.hasOwnProperty.call(lt,"error"))throw new i(lt.id,lt.error.code,lt.error.message);return lt})}function J(Xe,at,rt){return s(this,void 0,void 0,function*(){const[lt,yt]=yield Promise.all([crypto.subtle.exportKey("raw",at),crypto.subtle.importKey("raw",Xe.slice(0,U),{name:"ECDH",namedCurve:"P-256"},!1,[])]),oe=yield crypto.subtle.deriveBits({name:"ECDH",public:yt},rt,256),Q=yield crypto.subtle.importKey("raw",oe,"HKDF",!1,["deriveKey"]);return yield crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(lt),info:new Uint8Array},Q,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"])})}function ae(Xe,at){return s(this,void 0,void 0,function*(){const rt=yield Y(Xe,at),lt=JSON.parse(rt);let yt="legacy";if(Object.hasOwnProperty.call(lt,"v"))switch(lt.v){case 1:case"1":case"v1":yt="v1";break;case"legacy":yt="legacy";break;default:throw new t(e.ERROR_INVALID_PROTOCOL_VERSION,`Unknown/unsupported protocol version: ${lt.v}`)}return{protocol_version:yt}})}const we={Firefox:0,Other:1};function he(Xe){return Xe}function xe(){return navigator.userAgent.indexOf("Firefox/")!==-1?we.Firefox:we.Other}function Se(){return new Promise((Xe,at)=>{function rt(){clearTimeout(yt),window.removeEventListener("blur",lt)}function lt(){rt(),Xe()}window.addEventListener("blur",lt);const yt=setTimeout(()=>{rt(),at()},3e3)})}let Re=null;function et(Xe){Re==null&&(Re=document.createElement("iframe"),Re.style.display="none",document.body.appendChild(Re)),Re.contentWindow.location.href=Xe.toString()}function Me(Xe){return s(this,void 0,void 0,function*(){if(Xe.protocol==="https:")window.location.assign(Xe);else try{const at=xe();switch(at){case we.Firefox:et(Xe);break;case we.Other:{const rt=Se();window.location.assign(Xe),yield rt;break}default:}}catch{throw new t(e.ERROR_WALLET_NOT_FOUND,"Found no installed wallet that supports the mobile wallet protocol.")}})}function Fe(Xe,at){return s(this,void 0,void 0,function*(){const rt=_(),lt=yield B(Xe,rt,at);return yield Me(lt),rt})}const ht={retryDelayScheduleMs:[150,150,200,500,500,750,750,1e3],timeoutMs:3e4},Dt="com.solana.mobilewalletadapter.v1",At="com.solana.mobilewalletadapter.v1.base64";function Wt(){if(typeof window>"u"||window.isSecureContext!==!0)throw new t(e.ERROR_SECURE_CONTEXT_REQUIRED,"The mobile wallet adapter protocol must be used in a secure context (`https`).")}function yn(Xe){let at;try{at=new URL(Xe)}catch{throw new t(e.ERROR_FORBIDDEN_WALLET_BASE_URL,"Invalid base URL supplied by wallet")}if(at.protocol!=="https:")throw new t(e.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}function Yt(Xe){return new DataView(Xe).getUint32(0,!1)}function Jt(Xe){var at=new Uint8Array(Xe),rt=Xe.byteLength,lt=10,yt=0,oe=0,Q;do{if(oe>=rt||oe>lt)throw new RangeError("Failed to decode varint");Q=at[oe++],yt|=(Q&127)<<7*oe}while(Q>=128);return{value:yt,offset:oe}}function bn(Xe){let{value:at,offset:rt}=Jt(Xe);return new Uint8Array(Xe.slice(rt,rt+at))}function Kt(Xe,at){return s(this,void 0,void 0,function*(){Wt();const rt=yield W(),yt=`ws://localhost:${yield Fe(rt.publicKey,at==null?void 0:at.baseUri)}/solana-wallet`;let oe;const Q=(()=>{const Te=[...ht.retryDelayScheduleMs];return()=>Te.length>1?Te.shift():Te[0]})();let ee=1,fe=0,Ee={__type:"disconnected"};return new Promise((Te,De)=>{let vt;const jt={},kt=()=>s(this,void 0,void 0,function*(){if(Ee.__type!=="connecting"){console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${Ee.__type}\`.`);return}vt.removeEventListener("open",kt);const{associationKeypair:tr}=Ee,Cn=yield $();vt.send(yield u(Cn.publicKey,tr.privateKey)),Ee={__type:"hello_req_sent",associationPublicKey:tr.publicKey,ecdhPrivateKey:Cn.privateKey}}),dn=tr=>{tr.wasClean?Ee={__type:"disconnected"}:De(new t(e.ERROR_SESSION_CLOSED,`The wallet session dropped unexpectedly (${tr.code}: ${tr.reason}).`,{closeEvent:tr})),vn()},Ut=tr=>s(this,void 0,void 0,function*(){vn(),Date.now()-oe>=ht.timeoutMs?De(new t(e.ERROR_SESSION_TIMEOUT,`Failed to connect to the wallet websocket at ${yt}.`)):(yield new Promise(Cn=>{const de=Q();Xn=window.setTimeout(Cn,de)}),kn())}),_n=tr=>s(this,void 0,void 0,function*(){const Cn=yield tr.data.arrayBuffer();switch(Ee.__type){case"connecting":if(Cn.byteLength!==0)throw new Error("Encountered unexpected message while connecting");const de=yield $();vt.send(yield u(de.publicKey,rt.privateKey)),Ee={__type:"hello_req_sent",associationPublicKey:rt.publicKey,ecdhPrivateKey:de.privateKey};break;case"connected":try{const te=Cn.slice(0,I),re=Yt(te);
1040if(re!==fe+1)throw new Error("Encrypted message has invalid sequence number");fe=re;const ye=yield Z(Cn,Ee.sharedSecret),Ce=jt[ye.id];delete jt[ye.id],Ce.resolve(ye.result)}catch(te){if(te instanceof i){const re=jt[te.jsonRpcMessageId];delete jt[te.jsonRpcMessageId],re.reject(te)}else throw te}break;case"hello_req_sent":{if(Cn.byteLength===0){const ke=yield $();vt.send(yield u(ke.publicKey,rt.privateKey)),Ee={__type:"hello_req_sent",associationPublicKey:rt.publicKey,ecdhPrivateKey:ke.privateKey};break}const te=yield J(Cn,Ee.associationPublicKey,Ee.ecdhPrivateKey),re=Cn.slice(U),ye=re.byteLength!==0?yield s(this,void 0,void 0,function*(){const ke=re.slice(0,I),Ye=Yt(ke);if(Ye!==fe+1)throw new Error("Encrypted message has invalid sequence number");return fe=Ye,ae(re,te)}):{protocol_version:"legacy"};Ee={__type:"connected",sharedSecret:te,sessionProperties:ye};const Ce=b(ye.protocol_version,(ke,Ye)=>s(this,void 0,void 0,function*(){const Bn=ee++;return vt.send(yield M({id:Bn,jsonrpc:"2.0",method:ke,params:Ye??{}},te)),new Promise((Rn,mn)=>{jt[Bn]={resolve(or){switch(ke){case"authorize":case"reauthorize":{const{wallet_uri_base:gn}=or;if(gn!=null)try{yn(gn)}catch(Rr){mn(Rr);return}break}}Rn(or)},reject:mn}})}));try{Te(yield Xe(Ce))}catch(ke){De(ke)}finally{vn(),vt.close()}break}}});let vn,Xn;const kn=()=>{vn&&vn(),Ee={__type:"connecting",associationKeypair:rt},oe===void 0&&(oe=Date.now()),vt=new WebSocket(yt,[Dt]),vt.addEventListener("open",kt),vt.addEventListener("close",dn),vt.addEventListener("error",Ut),vt.addEventListener("message",_n),vn=()=>{window.clearTimeout(Xn),vt.removeEventListener("open",kt),vt.removeEventListener("close",dn),vt.removeEventListener("error",Ut),vt.removeEventListener("message",_n)}};kn()})})}function En(Xe){return s(this,void 0,void 0,function*(){Wt();const at=yield W(),rt=`wss://${Xe==null?void 0:Xe.remoteHostAuthority}/reflect`;let lt;const yt=(()=>{const dn=[...ht.retryDelayScheduleMs];return()=>dn.length>1?dn.shift():dn[0]})();let oe=1,Q=0,ee,fe={__type:"disconnected"},Ee,Te,De=dn=>s(this,void 0,void 0,function*(){if(ee=="base64"){const Ut=yield dn.data;return c(Ut).buffer}else return yield dn.data.arrayBuffer()});const vt=yield new Promise((dn,Ut)=>{const _n=()=>s(this,void 0,void 0,function*(){if(fe.__type!=="connecting"){console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${fe.__type}\`.`);return}Ee.protocol.includes(At)?ee="base64":ee="binary",Ee.removeEventListener("open",_n)}),vn=de=>{de.wasClean?fe={__type:"disconnected"}:Ut(new t(e.ERROR_SESSION_CLOSED,`The wallet session dropped unexpectedly (${de.code}: ${de.reason}).`,{closeEvent:de})),Te()},Xn=de=>s(this,void 0,void 0,function*(){Te(),Date.now()-lt>=ht.timeoutMs?Ut(new t(e.ERROR_SESSION_TIMEOUT,`Failed to connect to the wallet websocket at ${rt}.`)):(yield new Promise(te=>{const re=yt();tr=window.setTimeout(te,re)}),Cn())}),kn=de=>s(this,void 0,void 0,function*(){const te=yield De(de);if(fe.__type==="connecting"){if(te.byteLength==0)throw new Error("Encountered unexpected message while connecting");const re=bn(te);fe={__type:"reflector_id_received",reflectorId:re};const ye=yield C(at.publicKey,Xe.remoteHostAuthority,re,Xe==null?void 0:Xe.baseUri);Ee.removeEventListener("message",kn),dn(ye)}});let tr;const Cn=()=>{Te&&Te(),fe={__type:"connecting",associationKeypair:at},lt===void 0&&(lt=Date.now()),Ee=new WebSocket(rt,[Dt,At]),Ee.addEventListener("open",_n),Ee.addEventListener("close",vn),Ee.addEventListener("error",Xn),Ee.addEventListener("message",kn),Te=()=>{window.clearTimeout(tr),Ee.removeEventListener("open",_n),Ee.removeEventListener("close",vn),Ee.removeEventListener("error",Xn),Ee.removeEventListener("message",kn)}};Cn()});let jt=!1,kt;return{associationUrl:vt,close:()=>{Ee.close(),kt()},wallet:new Promise((dn,Ut)=>{const _n={},vn=Xn=>s(this,void 0,void 0,function*(){const kn=yield De(Xn);switch(fe.__type){case"reflector_id_received":if(kn.byteLength!==0)throw new Error("Encountered unexpected message while awaiting reflection");const tr=yield $(),Cn=yield u(tr.publicKey,at.privateKey);ee=="base64"?Ee.send(a(Cn)):Ee.send(Cn),fe={__type:"hello_req_sent",associationPublicKey:at.publicKey,ecdhPrivateKey:tr.privateKey};break;case"connected":try{const de=kn.slice(0,I),te=Yt(de);
1040if(te!==Q+1)throw new Error("Encrypted message has invalid sequence number");Q=te;const re=yield Z(kn,fe.sharedSecret),ye=_n[re.id];delete _n[re.id],ye.resolve(re.result)}catch(de){if(de instanceof i){const te=_n[de.jsonRpcMessageId];delete _n[de.jsonRpcMessageId],te.reject(de)}else throw de}break;case"hello_req_sent":{const de=yield J(kn,fe.associationPublicKey,fe.ecdhPrivateKey),te=kn.slice(U),re=te.byteLength!==0?yield s(this,void 0,void 0,function*(){const Ce=te.slice(0,I),ke=Yt(Ce);if(ke!==Q+1)throw new Error("Encrypted message has invalid sequence number");return Q=ke,ae(te,de)}):{protocol_version:"legacy"};fe={__type:"connected",sharedSecret:de,sessionProperties:re};const ye=b(re.protocol_version,(Ce,ke)=>s(this,void 0,void 0,function*(){const Ye=oe++,Bn=yield M({id:Ye,jsonrpc:"2.0",method:Ce,params:ke??{}},de);return ee=="base64"?Ee.send(a(Bn)):Ee.send(Bn),new Promise((Rn,mn)=>{_n[Ye]={resolve(or){switch(Ce){case"authorize":case"reauthorize":{const{wallet_uri_base:gn}=or;if(gn!=null)try{yn(gn)}catch(Rr){mn(Rr);return}break}}Rn(or)},reject:mn}})}));jt=!0;try{dn(ye)}catch(Ce){Ut(Ce)}break}}});Ee.addEventListener("message",vn),kt=()=>{Ee.removeEventListener("message",vn),Te(),jt||Ut(new t(e.ERROR_SESSION_CLOSED,"The wallet session was closed before connection.",{closeEvent:new CloseEvent("socket was closed before connection")}))}})}})}return Iu.SolanaCloneAuthorization=w,Iu.SolanaMobileWalletAdapterError=t,Iu.SolanaMobileWalletAdapterErrorCode=e,Iu.SolanaMobileWalletAdapterProtocolError=i,Iu.SolanaMobileWalletAdapterProtocolErrorCode=r,Iu.SolanaSignInWithSolana=y,Iu.SolanaSignTransactions=m,Iu.startRemoteScenario=En,Iu.transact=Kt,Iu}var nse=a7e(),qP,mY;function c7e(){if(mY)return qP;mY=1;function n(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(t[o]!==255)throw new TypeError(s+" is ambiguous");t[o]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function f(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var b=0,E=0,T=0,N=y.length;T!==N&&y[T]===0;)T++,b++;for(var I=(N-T)*d+1>>>0,H=new Uint8Array(I);T!==N;){for(var L=y[T],U=0,K=I-1;(L!==0||U<E)&&K!==-1;K--,U++)L+=256*H[K]>>>0,H[K]=L%a>>>0,L=L/a>>>0;if(L!==0)throw new Error("Non-zero carry");E=U,T++}for(var Y=I-E;Y!==I&&H[Y]===0;)Y++;for(var k=c.repeat(b);Y<I;++Y)k+=e.charAt(H[Y]);return k}function m(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var b=0,E=0,T=0;y[b]===c;)E++,b++;for(var N=(y.length-b)*u+1>>>0,I=new Uint8Array(N);y[b];){var H=y.charCodeAt(b);if(H>255)return;var L=t[H];if(L===255)return;for(var U=0,K=N-1;(L!==0||U<T)&&K!==-1;K--,U++)L+=a*I[K]>>>0,I[K]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");T=U,b++}for(var Y=N-T;Y!==N&&I[Y]===0;)Y++;for(var k=new Uint8Array(E+(N-Y)),j=E;Y!==N;)k[j++]=I[Y++];return k}function w(y){var b=m(y);if(b)return b;throw new Error("Non-base"+a+" character")}return{encode:f,decodeUnsafe:m,decode:w}}return qP=n,qP}var KP,wY;function l7e(){return wY||(wY=1,KP=c7e()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),KP}var u7e=l7e();const d7e=xo(u7e);function YP(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function OS(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(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?s(d.value):i(d.value).then(a,c)}u((r=r.apply(n,[])).next())})}function rse(n){return window.btoa(String.fromCharCode.call(null,...n))}function GP(n){return new Uint8Array(window.atob(n).split("").map(e=>e.charCodeAt(0)))}function yY(n){const e="version"in n?n.serialize():n.serialize({requireAllSignatures:!1,verifySignatures:!1});return rse(e)}function h7e(n){const t=n[0]*Ax+1;return hR.deserializeMessageVersion(n.slice(t,n.length))==="legacy"?Wr.from(n):w1.deserialize(n)}function f7e(n,e){return OS(this,void 0,void 0,function*(){const t=r=>n(ise(r));return yield nse.transact(t,e)})}function p7e(n){return OS(this,void 0,void 0,function*(){const{wallet:e,close:t,associationUrl:r}=yield nse.startRemoteScenario(n);return{wallet:e.then(s=>ise(s)),close:t,associationUrl:r}})}function ise(n){return new Proxy({},{get(e,t){if(e[t]==null)switch(t){case"signAndSendTransactions":e[t]=function(r){var{minContextSlot:i,commitment:s,skipPreflight:o,maxRetries:a,waitForCommitmentToSendNextTransaction:c,transactions:u}=r,d=YP(r,["minContextSlot","commitment","skipPreflight","maxRetries","waitForCommitmentToSendNextTransaction","transactions"]);return OS(this,void 0,void 0,function*(){const f=u.map(yY),m={min_context_slot:i,commitment:s,skip_preflight:o,max_retries:a,wait_for_c
1040ommitment_to_send_next_transaction:c},{signatures:w}=yield n.signAndSendTransactions(Object.assign(Object.assign(Object.assign({},d),Object.values(m).some(b=>b!=null)?{options:m}:null),{payloads:f}));return w.map(GP).map(d7e.encode)})};break;case"signMessages":e[t]=function(r){var{payloads:i}=r,s=YP(r,["payloads"]);return OS(this,void 0,void 0,function*(){const o=i.map(rse),{signed_payloads:a}=yield n.signMessages(Object.assign(Object.assign({},s),{payloads:o}));return a.map(GP)})};break;case"signTransactions":e[t]=function(r){var{transactions:i}=r,s=YP(r,["transactions"]);return OS(this,void 0,void 0,function*(){const o=i.map(yY),{signed_payloads:a}=yield n.signTransactions(Object.assign(Object.assign({},s),{payloads:o}));return a.map(GP).map(h7e)})};break;default:{e[t]=n[t];break}}return e[t]},defineProperty(){return!1},deleteProperty(){return!1}})}const g7e=Object.freeze(Object.defineProperty({__proto__:null,startRemoteScenario:p7e,transact:f7e},Symbol.toStringTag,{value:"Module"})),m7e=Vx(g7e);var ZP,bY;function w7e(){if(bY)return ZP;bY=1;function n(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(t[o]!==255)throw new TypeError(s+" is ambiguous");t[o]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function f(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var b=0,E=0,T=0,N=y.length;T!==N&&y[T]===0;)T++,b++;for(var I=(N-T)*d+1>>>0,H=new Uint8Array(I);T!==N;){for(var L=y[T],U=0,K=I-1;(L!==0||U<E)&&K!==-1;K--,U++)L+=256*H[K]>>>0,H[K]=L%a>>>0,L=L/a>>>0;if(L!==0)throw new Error("Non-zero carry");E=U,T++}for(var Y=I-E;Y!==I&&H[Y]===0;)Y++;for(var k=c.repeat(b);Y<I;++Y)k+=e.charAt(H[Y]);return k}function m(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var b=0,E=0,T=0;y[b]===c;)E++,b++;for(var N=(y.length-b)*u+1>>>0,I=new Uint8Array(N);y[b];){var H=y.charCodeAt(b);if(H>255)return;var L=t[H];if(L===255)return;for(var U=0,K=N-1;(L!==0||U<T)&&K!==-1;K--,U++)L+=a*I[K]>>>0,I[K]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");T=U,b++}for(var Y=N-T;Y!==N&&I[Y]===0;)Y++;for(var k=new Uint8Array(E+(N-Y)),j=E;Y!==N;)k[j++]=I[Y++];return k}function w(y){var b=m(y);if(b)return b;throw new Error("Non-base"+a+" character")}return{encode:f,decodeUnsafe:m,decode:w}}return ZP=n,ZP}var QP,vY;function y7e(){return vY||(vY=1,QP=w7e()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),QP}var xY;function b7e(){if(xY)return Bd;xY=1,Object.defineProperty(Bd,"__esModule",{value:!0});var n=jU(),e=qie,t=YDe(),r=Vie(),i=Xie(),s=m7e,o=y7e();function a(sn){return sn&&typeof sn=="object"&&"default"in sn?sn:{default:sn}}var c=a(t),u=a(o);function d(sn,ft,$e,Pe){function xt(Et){return Et instanceof $e?Et:new $e(function(hn){hn(Et)})}return new($e||($e=Promise))(function(Et,hn){function $n(wa){try{Br(Pe.next(wa))}catch(dd){hn(dd)}}function pi(wa){try{Br(Pe.throw(wa))}catch(dd){hn(dd)}}function Br(wa){wa.done?Et(wa.value):xt(wa.value).then($n,pi)}Br((Pe=Pe.apply(sn,[])).next())})}function f(sn,ft,$e,Pe){if($e==="a"&&!Pe)throw new TypeError("Private accessor was defined without a getter");if(typeof ft=="function"?sn!==ft||!Pe:!ft.has(sn))throw new TypeError("Cannot read private member from an object whose class did not declare it");return $e==="m"?Pe:$e==="a"?Pe.call(sn):Pe?Pe.value:ft.get(sn)}function m(sn,ft,$e,Pe,xt){if(typeof ft=="function"?sn!==ft||!0:!ft.has(sn))throw new TypeError("Cannot write private member to an object whose class did not declare it");return ft.set(sn,$e),$e}var w,y,b,E,T,N,I,H;const L=` 1041<div class="mobile-wallet-adapter-embedded-modal-container" role="dialog" aria-modal="true" aria-labelledby="modal-title"> 1042 <div data-modal-close style="position: absolute; width: 100%; height: 100%;"></div> 1043 <div class="mobile-wallet-adapter-embedded-modal-card"> 1044 <div> 1045 <button data-modal-close class="mobile-wallet-adapter-embedded-modal-close"> 1046 <svg width="14" height="14"> 1047 <path d="M 6.7125,8.3036995 1.9082,13.108199 c -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 C 0.1056,12.896899 0,12.631699 0,12.312499 c 0,-0.3192 0.1056,-0.5844 0.3167,-0.7958 L 5.1212,6.7124995 0.3167,1.9082 C 0.1056,1.6969 0,1.4317 0,1.1125 0,0.7933 0.1056,0.5281 0.3167,0.3167 0.5281,0.1056 0.7933,0 1.1125,0 1.4317,0 1.6969,0.1056 1.9082,0.3167 L 6.7125,5.1212 11.5167,0.3167 C 11.7281,0.1056 11.9933,0 12.3125,0 c 0.3192,0 0.5844,0.1056 0.7957,0.3167 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 L 8.3037001,6.7124995 13.1082,11.516699 c 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 z" /> 1048 </svg> 1049 </button> 1050 </div> 1051 <div class="mobile-wallet-adapter-embedded-modal-content"></div> 1052 </div> 1053</div> 1054`,U=` 1055.mobile-wallet-adapter-embedded-modal-container { 1056 display: flex; /* Use flexbox to center content */ 1057 justify-content: center; /* Center horizontally */ 1058 align-items: center; /* Center vertically */ 1059 position: fixed;
1059 /* Stay in place */ 1060 z-index: 1; /* Sit on top */ 1061 left: 0; 1062 top: 0; 1063 width: 100%; /* Full width */ 1064 height: 100%; /* Full height */ 1065 background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ 1066 overflow-y: auto; /* enable scrolling */ 1067} 1068 1069.mobile-wallet-adapter-embedded-modal-card { 1070 display: flex; 1071 flex-direction: column; 1072 margin: auto 20px; 1073 max-width: 780px; 1074 padding: 20px; 1075 border-radius: 24px; 1076 background: #ffffff; 1077 font-family: "Inter Tight", "PT Sans", Calibri, sans-serif; 1078 transform: translateY(-200%); 1079 animation: slide-in 0.5s forwards; 1080} 1081 1082@keyframes slide-in { 1083 100% { transform: translateY(0%); } 1084} 1085 1086.mobile-wallet-adapter-embedded-modal-close { 1087 display: flex; 1088 align-items: center; 1089 justify-content: center; 1090 width: 32px; 1091 height: 32px; 1092 cursor: pointer; 1093 background: #e4e9e9; 1094 border: none; 1095 border-radius: 50%; 1096} 1097 1098.mobile-wallet-adapter-embedded-modal-close:focus-visible { 1099 outline-color: red; 1100} 1101 1102.mobile-wallet-adapter-embedded-modal-close svg { 1103 fill: #546266; 1104 transition: fill 200ms ease 0s; 1105} 1106 1107.mobile-wallet-adapter-embedded-modal-close:hover svg { 1108 fill: #fff; 1109} 1110`,K=` 1111<link rel="preconnect" href="https://fonts.googleapis.com"> 1112<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> 1113<link href="https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet"> 1114`;class Y{constructor(){w.add(this),y.set(this,null),b.set(this,{}),E.set(this,!1),this.dom=null,this.open=()=>{console.debug("Modal open"),f(this,w,"m",N).call(this),f(this,y,"f")&&(f(this,y,"f").style.display="flex")},this.close=(ft=void 0)=>{var $e;console.debug("Modal close"),f(this,w,"m",I).call(this),f(this,y,"f")&&(f(this,y,"f").style.display="none"),($e=f(this,b,"f").close)===null||$e===void 0||$e.forEach(Pe=>Pe(ft))},H.set(this,ft=>{ft.key==="Escape"&&this.close(ft)}),this.init=this.init.bind(this),m(this,y,document.getElementById("mobile-wallet-adapter-embedded-root-ui"))}init(){return d(this,void 0,void 0,function*(){console.log("Injecting modal"),f(this,w,"m",T).call(this)})}addEventListener(ft,$e){var Pe;return!((Pe=f(this,b,"f")[ft])===null||Pe===void 0)&&Pe.push($e)||(f(this,b,"f")[ft]=[$e]),()=>this.removeEventListener(ft,$e)}removeEventListener(ft,$e){var Pe;f(this,b,"f")[ft]=(Pe=f(this,b,"f")[ft])===null||Pe===void 0?void 0:Pe.filter(xt=>$e!==xt)}}y=new WeakMap,b=new WeakMap,E=new WeakMap,H=new WeakMap,w=new WeakSet,T=function(){if(document.getElementById("mobile-wallet-adapter-embedded-root-ui")){f(this,y,"f")||m(this,y,document.getElementById("mobile-wallet-adapter-embedded-root-ui"));return}m(this,y,document.createElement("div")),f(this,y,"f").id="mobile-wallet-adapter-embedded-root-ui",f(this,y,"f").innerHTML=L,f(this,y,"f").style.display="none";const ft=f(this,y,"f").querySelector(".mobile-wallet-adapter-embedded-modal-content");ft&&(ft.innerHTML=this.contentHtml);const $e=document.createElement("style");$e.id="mobile-wallet-adapter-embedded-modal-styles",$e.textContent=U+this.contentStyles;const Pe=document.createElement("div");Pe.innerHTML=K,this.dom=Pe.attachShadow({mode:"closed"}),this.dom.appendChild($e),this.dom.appendChild(f(this,y,"f")),document.body.appendChild(Pe)},N=function(){if(!f(this,y,"f")||f(this,E,"f"))return;[...f(this,y,"f").querySelectorAll("[data-modal-close]")].forEach($e=>$e==null?void 0:$e.addEventListener("click",this.close)),window.addEventListener("load",this.close),document.addEventListener("keydown",f(this,H,"f")),m(this,E,!0)},I=function(){if(!f(this,E,"f")||(window.removeEventListener("load",this.close),document.removeEventListener("keydown",f(this,H,"f")),!f(this,y,"f")))return;[...f(this,y,"f").querySelectorAll("[data-modal-close]")].forEach($e=>$e==null?void 0:$e.removeEventListener("click",this.close)),m(this,E,!1)};class k extends Y{constructor(){super(...arguments),this.contentStyles=V,this.contentHtml=j}initWithQR(ft){const $e=Object.create(null,{init:{get:()=>super.init}});return d(this,void 0,void 0,function*(){$e.init.call(this),this.populateQRCode(ft)})}populateQRCode(ft){var $e;return d(this,void 0,void 0,function*(){const Pe=($e=this.dom)===null||$e===void 0?void 0:$e.getElementById("mobile-wallet-adapter-embedded-modal-qr-code-container");if(Pe){const xt=yield c.default.toCanvas(ft,{width:200,margin:0});Pe.firstElementChild!==null?Pe.replaceChild(xt,Pe.firstElementChild):Pe.appendChild(xt)}else console.error("QRCode Container not found")})}}const j=` 1115<div class="mobile-wallet-adapter-embedded-modal-qr-content"> 1116 <div> 1117 <svg class="mobile-wallet-adapter-embedded-modal-icon" width="100%" height="100%"> 1118 <circle r="52" cx="53" cy="53" fill="#99b3be" stroke="#000000" stroke-width="2"/> 1119 <path d="m 53,82.7305 c -3.3116,0 -6.1361,-1.169 -8.4735,-3.507 -2.338,-2.338 -3.507,-5.1625 -3.507,-8.4735 0,-3.3116 1.169,-6.1364 3.507,-8.4744 2.3374,-2.338 5.1619,-3.507 8.4735,-3.507 3.3116,0 6.1361,1.169 8.4735,3.507 2.338,2.338 3.507,5.1628 3.507,8.4744 0,3.311 -1.169,6.1355 -3.507,8.4735 -2.3374,2.338 -5.1619,3.507 -8.4735,3.507 z m 0.007,-5.25 c 1.8532,0 3.437,-0.6598 4.7512,-1.9793 1.3149,-1.3195 1.9723,-2.9058
11191.9723,-4.7591 0,-1.8526 -0.6598,-3.4364 -1.9793,-4.7512 -1.3195,-1.3149 -2.9055,-1.9723 -4.7582,-1.9723 -1.8533,0 -3.437,0.6598 -4.7513,1.9793 -1.3148,1.3195 -1.9722,2.9058 -1.9722,4.7591 0,1.8527 0.6597,3.4364 1.9792,4.7512 1.3195,1.3149 2.9056,1.9723 4.7583,1.9723 z m -28,-33.5729 -3.85,-3.6347 c 4.1195,-4.025 8.8792,-7.1984 14.2791,-9.52 5.4005,-2.3223 11.2551,-3.4834 17.5639,-3.4834 6.3087,0 12.1634,1.1611 17.5639,3.4834 5.3999,2.3216 10.1596,5.495 14.2791,9.52 l -3.85,3.6347 C 77.2999,40.358 73.0684,37.5726 68.2985,35.5514 63.5292,33.5301 58.4296,32.5195 53,32.5195 c -5.4297,0 -10.5292,1.0106 -15.2985,3.0319 -4.7699,2.0212 -9.0014,4.8066 -12.6945,8.3562 z m 44.625,10.8771 c -2.2709,-2.1046 -4.7962,-3.7167 -7.5758,-4.8361 -2.7795,-1.12 -5.7983,-1.68 -9.0562,-1.68 -3.2579,0 -6.2621,0.56 -9.0125,1.68 -2.7504,1.1194 -5.2903,2.7315 -7.6195,4.8361 L 32.5189,51.15 c 2.8355,-2.6028 5.9777,-4.6086 9.4263,-6.0174 3.4481,-1.4087 7.133,-2.1131 11.0548,-2.1131 3.9217,0 7.5979,0.7044 11.0285,2.1131 3.43,1.4088 6.5631,3.4146 9.3992,6.0174 z"/> 1120 </svg> 1121 <div class="mobile-wallet-adapter-embedded-modal-title">Remote Mobile Wallet Adapter</div> 1122 </div> 1123 <div> 1124 <div> 1125 <h4 class="mobile-wallet-adapter-embedded-modal-qr-label"> 1126 Open your wallet and scan this code 1127 </h4> 1128 </div> 1129 <div id="mobile-wallet-adapter-embedded-modal-qr-code-container" class="mobile-wallet-adapter-embedded-modal-qr-code-container"></div> 1130 </div> 1131</div> 1132<div class="mobile-wallet-adapter-embedded-modal-divider"><hr></div> 1133<div class="mobile-wallet-adapter-embedded-modal-footer"> 1134 <div class="mobile-wallet-adapter-embedded-modal-subtitle"> 1135 Follow the instructions on your device. When you're finished, this screen will update. 1136 </div> 1137 <div class="mobile-wallet-adapter-embedded-modal-progress-badge"> 1138 <div> 1139 <div class="spinner"> 1140 <div class="leftWrapper"> 1141 <div class="left"> 1142 <div class="circle"></div> 1143 </div> 1144 </div> 1145 <div class="rightWrapper"> 1146 <div class="right"> 1147 <div class="circle"></div> 1148 </div> 1149 </div> 1150 </div> 1151 </div> 1152 <div>Waiting for scan</div> 1153 </div> 1154</div> 1155`,V=` 1156.mobile-wallet-adapter-embedded-modal-qr-content { 1157 display: flex; 1158 margin-top: 10px; 1159 padding: 10px; 1160} 1161 1162.mobile-wallet-adapter-embedded-modal-qr-content > div:first-child { 1163 display: flex; 1164 flex-direction: column; 1165 flex: 2; 1166 margin-top: auto; 1167 margin-right: 30px; 1168} 1169 1170.mobile-wallet-adapter-embedded-modal-qr-content > div:nth-child(2) { 1171 display: flex; 1172 flex-direction: column; 1173 flex: 1; 1174 margin-left: auto; 1175} 1176 1177.mobile-wallet-adapter-embedded-modal-footer { 1178 display: flex; 1179 padding: 10px; 1180} 1181 1182.mobile-wallet-adapter-embedded-modal-icon {} 1183 1184.mobile-wallet-adapter-embedded-modal-title { 1185 color: #000000; 1186 font-size: 2.5em; 1187 font-weight: 600; 1188} 1189 1190.mobile-wallet-adapter-embedded-modal-qr-label { 1191 text-align: right; 1192 color: #000000; 1193} 1194 1195.mobile-wallet-adapter-embedded-modal-qr-code-container { 1196 margin-left: auto; 1197} 1198 1199.mobile-wallet-adapter-embedded-modal-divider { 1200 margin-top: 20px; 1201 padding-left: 10px; 1202 padding-right: 10px; 1203} 1204 1205.mobile-wallet-adapter-embedded-modal-divider hr { 1206 border-top: 1px solid #D9DEDE; 1207} 1208 1209.mobile-wallet-adapter-embedded-modal-subtitle { 1210 margin: auto; 1211 margin-right: 60px; 1212 padding: 20px; 1213 color: #6E8286; 1214} 1215 1216.mobile-wallet-adapter-embedded-modal-progress-badge { 1217 display: flex; 1218 background: #F7F8F8; 1219 height: 56px; 1220 min-width: 200px; 1221 margin: auto; 1222 padding-left: 20px; 1223 padding-right: 20px; 1224 border-radius: 18px; 1225 color: #A8B6B8; 1226 align-items: center; 1227} 1228 1229.mobile-wallet-adapter-embedded-modal-progress-badge > div:first-child { 1230 margin-left: auto; 1231 margin-right: 20px; 1232} 1233 1234.mobile-wallet-adapter-embedded-modal-progress-badge > div:nth-child(2) { 1235 margin-right: auto; 1236} 1237 1238/* Smaller screens */ 1239@media all and (max-width: 600px) { 1240 .mobile-wallet-adapter-embedded-modal-card { 1241 text-align: center; 1242 } 1243 .mobile-wallet-adapter-embedded-modal-qr-content { 1244 flex-direction: column; 1245 } 1246 .mobile-wallet-adapter-embedded-modal-qr-content > div:first-child { 1247 margin: auto; 1248 } 1249 .mobile-wallet-adapter-embedded-modal-qr-content > div:nth-child(2) { 1250 margin: auto; 1251 flex: 2 auto; 1252 } 1253 .mobile-wallet-adapter-embedded-modal-footer { 1254 flex-direction: column; 1255 } 1256 .mobile-wallet-adapter-embedded-modal-icon { 1257 display: none; 1258 } 1259 .mobile-wallet-adapter-embedded-modal-title { 1260 font-size: 1.5em; 1261 } 1262 .mobile-wallet-adapter-embedded-modal-subtitle { 1263 margin-right: unset; 1264 } 1265 .mobile-wallet-adapter-embedded-modal-qr-label { 1266 text-align: center; 1267 } 1268 .mobile-wallet-adapter-embedded-modal-qr-code-container { 1269 margin: auto; 1270 } 1271} 1272 1273/* Spinner */ 1274@keyframes spinLeft { 1275 0% { 1276 transform: rotate(20deg); 1277 } 1278 50% { 1279 transform: rotate(160deg); 1280 } 1281 100% { 1282 transform: rotate(20deg); 1283 } 1284} 1285@keyframes spinRight { 1286 0% { 1287 transform: rotate(160deg); 1288 } 1289 50% { 1290 transform: rotate(20deg); 1291 } 1292 100% { 1293 transform: rotate(160deg); 1294 } 1295} 1296@keyframes spin { 1297 0% { 1298 transform: rotate(0deg); 1299 } 1300 100% { 1301 transform: rotate(2520deg); 1302 } 1303} 1304 1305.spinner { 1306 position: relative; 1307 width: 1.5em; 1308 height: 1.5em; 1309 margin: auto; 1310 animation: spin 10s linear infinite; 1311} 1312.spinner::before { 1313 content: ""; 1314 position: absolute; 1315 top: 0; 1316 bottom: 0; 1317 left: 0; 1318 right: 0; 1319} 1320.right, .rightWrapper, .left, .leftWrapper { 1321 position: absolute; 1322 top: 0; 1323 overflow: hidden; 1324 width: .75em; 1325 height: 1.5em; 1326} 1327.left, .leftWrapper { 1328 left: 0; 1329} 1330.right { 1331 left: -12px; 1332} 1333.rightWrapper { 1334 right: 0; 1335} 1336.circle { 1337 border: .125em solid #A8B6B8; 1338 width: 1.25em; /* 1.5em - 2*0.125em border */ 1339 height: 1.25em; /* 1.5em - 2*0.125em border */ 1340 border-radius: 0.75em; /* 0.5*1.5em spinner size 8 */ 1341} 1342.left { 1343 transform-origin: 100% 50%; 1344 animation: spinLeft 2.5s cubic-bezier(.2,0,.8,1) infinite; 1345} 1346.right { 1347 transform-origin: 100% 50%; 1348 animation: spinRight 2.5s cubic-bezier(.2,0,.8,1) infinite; 1349} 1350`,W="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDIuNUgxN0MxNy44Mjg0IDIuNSAxOC41IDMuMTc
1350xNTcgMTguNSA0VjIwQzE4LjUgMjAuODI4NCAxNy44Mjg0IDIxLjUgMTcgMjEuNUg3QzYuMTcxNTcgMjEuNSA1LjUgMjAuODI4NCA1LjUgMjBWNEM1LjUgMy4xNzE1NyA2LjE3MTU3IDIuNSA3IDIuNVpNMyA0QzMgMS43OTA4NiA0Ljc5MDg2IDAgNyAwSDE3QzE5LjIwOTEgMCAyMSAxLjc5MDg2IDIxIDRWMjBDMjEgMjIuMjA5MSAxOS4yMDkxIDI0IDE3IDI0SDdDNC43OTA4NiAyNCAzIDIyLjIwOTEgMyAyMFY0Wk0xMSA0LjYxNTM4QzEwLjQ0NzcgNC42MTUzOCAxMCA1LjA2MzEgMTAgNS42MTUzOFY2LjM4NDYyQzEwIDYuOTM2OSAxMC40NDc3IDcuMzg0NjIgMTEgNy4zODQ2MkgxM0MxMy41NTIzIDcuMzg0NjIgMTQgNi45MzY5IDE0IDYuMzg0NjJWNS42MTUzOEMxNCA1LjA2MzEgMTMuNTUyMyA0LjYxNTM4IDEzIDQuNjE1MzhIMTFaIiBmaWxsPSIjRENCOEZGIi8+Cjwvc3ZnPgo=";function $(sn){return"version"in sn}function A(sn){return window.btoa(String.fromCharCode.call(null,...sn))}function _(sn){return new Uint8Array(window.atob(sn).split("").map(ft=>ft.charCodeAt(0)))}var R,P,q,F,z,B,C,M,Z,J,ae,we,he,xe,Se,Re,et,Me,Fe,ht,Dt,At,Wt,yn,Yt,Jt,bn,Kt,En,Xe,at,rt,lt,yt,oe,Q,ee,fe,Ee,Te,De,vt,jt,kt,dn,Ut,_n,vn,Xn,kn,tr,Cn,de,te,re,ye,Ce,ke,Ye,Bn,Rn,mn,or,gn,Rr,ga,Kr,Yr,ki,Sl;const uu="Mobile Wallet Adapter",ma=64,Ja=[n.SolanaSignAndSendTransaction,n.SolanaSignTransaction,n.SolanaSignMessage,n.SolanaSignIn];class _l{constructor(ft){R.add(this),P.set(this,{}),q.set(this,"1.0.0"),F.set(this,uu),z.set(this,"https://solanamobile.com/wallets"),B.set(this,W),C.set(this,void 0),M.set(this,void 0),Z.set(this,void 0),J.set(this,!1),ae.set(this,0),we.set(this,[]),he.set(this,void 0),xe.set(this,void 0),Se.set(this,void 0),Re.set(this,($e,Pe)=>{var xt;return!((xt=f(this,P,"f")[$e])===null||xt===void 0)&&xt.push(Pe)||(f(this,P,"f")[$e]=[Pe]),()=>f(this,R,"m",Me).call(this,$e,Pe)}),Fe.set(this,({silent:$e}={})=>d(this,void 0,void 0,function*(){if(f(this,J,"f")||this.connected)return{accounts:this.accounts};m(this,J,!0);try{if($e){const Pe=yield f(this,Z,"f").get();if(Pe)yield f(this,Dt,"f").call(this,Pe);else return{accounts:this.accounts}}else yield f(this,ht,"f").call(this)}catch(Pe){throw new Error(Pe instanceof Error&&Pe.message||"Unknown error")}finally{m(this,J,!1)}return{accounts:this.accounts}})),ht.set(this,$e=>d(this,void 0,void 0,function*(){try{const Pe=yield f(this,Z,"f").get();if(Pe)return f(this,Dt,"f").call(this,Pe),Pe;const xt=yield f(this,he,"f").select(f(this,we,"f"));return yield f(this,Yt,"f").call(this,Et=>d(this,void 0,void 0,function*(){const[hn,$n]=yield Promise.all([Et.getCapabilities(),Et.authorize({chain:xt,identity:f(this,C,"f"),sign_in_payload:$e})]),pi=f(this,bn,"f").call(this,$n.accounts),Br=Object.assign(Object.assign({},$n),{accounts:pi,chain:xt});return Promise.all([f(this,At,"f").call(this,hn),f(this,Z,"f").set(Br),f(this,Dt,"f").call(this,Br)]),Br}))}catch(Pe){throw new Error(Pe instanceof Error&&Pe.message||"Unknown error")}})),Dt.set(this,$e=>d(this,void 0,void 0,function*(){var Pe;const xt=f(this,M,"f")==null||((Pe=f(this,M,"f"))===null||Pe===void 0?void 0:Pe.accounts.length)!==$e.accounts.length||f(this,M,"f").accounts.some((Et,hn)=>Et.address!==$e.accounts[hn].address);m(this,M,$e),xt&&f(this,R,"m",et).call(this,"change",{accounts:this.accounts})})),At.set(this,$e=>d(this,void 0,void 0,function*(){const Pe=$e.features.includes("solana:signTransactions"),xt=$e.supports_sign_and_send_transactions,Et=n.SolanaSignAndSendTransaction in this.features!==xt||n.SolanaSignTransaction in this.features!==Pe;m(this,xe,Object.assign(Object.assign({},(xt||!xt&&!Pe)&&{[n.SolanaSignAndSendTransaction]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:f(this,Xe,"f")}}),Pe&&{[n.SolanaSignTransaction]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:f(this,at,"f")}})),Et&&f(this,R,"m",et).call(this,"change",{features:this.features})})),Wt.set(this,($e,Pe,xt)=>d(this,void 0,void 0,function*(){try{const Et=yield $e.authorize({auth_token:Pe,identity:f(this,C,"f"),chain:xt}),hn=f(this,bn,"f").call(this,Et.accounts),$n=Object.assign(Object.assign({},Et),{accounts:hn,chain:xt});Promise.all([f(this,Z,"f").set($n),f(this,Dt,"f").call(this,$n)])}catch(Et){throw f(this,yn,"f").call(this),new Error(Et instanceof Error&&Et.message||"Unknown error")}})),yn.set(this,()=>d(this,void 0,void 0,function*(){var $e;f(this,Z,"f").clear(),m(this,J,!1),m(this,ae,($e=f(this,ae,"f"),$e++,$e)),m(this,M,void 0),f(this,R,"m",et).call(this,"change",{accounts:this.accounts})})),Yt.set(this,$e=>d(this,void 0,void 0,function*(){var Pe;const xt=(Pe=f(this,M,"f"))===null||Pe===void 0?void 0:Pe.wallet_uri_base,Et=xt?{baseUri:xt}:void 0,hn=f(this,ae,"f");try{return yield s.transact($e,Et)}catch($n){throw f(this,ae,"f")!==hn&&(yield new Promise(()=>{})),$n instanceof Error&&$n.name==="SolanaMobileWalletAdapterError"&&$n.code==="ERROR_WALLET_NOT_FOUND"&&(yield f(this,Se,"f").call(this,this)),$n}})),Jt.set(this,()=>{if(!f(this,M,"f"))throw new Error("Wallet not connected");return{authToken:f(this,M,"f").auth_token,chain:f(this,M,"f").chain}}),bn.set(this,$e=>$e.map(Pe=>{var xt,Et;const hn=_(Pe.address);return{address:u.default.encode(hn),publicKey:hn,label:Pe.label,icon:Pe.icon,chains:(xt=Pe.chains)!==null&&xt!==void 0?xt:f(this,we,"f"),features:(Et=Pe.features)!==null&&Et!==void 0?Et:Ja}})),Kt.set(this,$e=>d(this,void 0,void 0,function*(){const{authToken:Pe,chain:xt}=f(this,Jt,"f").call(this);try{return yield f(this,Yt,"f").call(this,Et=>d(this,void 0,void 0,function*(){return yield f(this,Wt,"f").call(this,Et,Pe,xt),yield Et.signTransactions({transactions:$e})}))}catch(Et){throw new Error(Et instanceof Error&&Et.message||"Unknown error")}})),En.set(this,($e,Pe)=>d(this,void 0,void 0,function*(){const{authToken:xt,chain:Et}=f(this,Jt,"f").call(this);try{return yield f(this,Yt,"f").call(this,hn=>
1350d(this,void 0,void 0,function*(){const[$n,pi]=yield Promise.all([hn.getCapabilities(),f(this,Wt,"f").call(this,hn,xt,Et)]);if($n.supports_sign_and_send_transactions)return(yield hn.signAndSendTransactions(Object.assign(Object.assign({},Pe),{transactions:[$e]})))[0];throw new Error("connected wallet does not support signAndSendTransaction")}))}catch(hn){throw new Error(hn instanceof Error&&hn.message||"Unknown error")}})),Xe.set(this,(...$e)=>d(this,void 0,void 0,function*(){const Pe=[];for(const xt of $e){const Et=e.VersionedTransaction.deserialize(xt.transaction),hn=yield f(this,En,"f").call(this,Et,xt.options);Pe.push({signature:u.default.decode(hn)})}return Pe})),at.set(this,(...$e)=>d(this,void 0,void 0,function*(){const Pe=$e.map(({transaction:Et})=>e.VersionedTransaction.deserialize(Et));return(yield f(this,Kt,"f").call(this,Pe)).map(Et=>({signedTransaction:$(Et)?Et.serialize():new Uint8Array(Et.serialize({requireAllSignatures:!1,verifySignatures:!1}))}))})),rt.set(this,(...$e)=>d(this,void 0,void 0,function*(){const{authToken:Pe,chain:xt}=f(this,Jt,"f").call(this),Et=$e.map(({account:$n})=>A($n.publicKey)),hn=$e.map(({message:$n})=>$n);try{return yield f(this,Yt,"f").call(this,$n=>d(this,void 0,void 0,function*(){return yield f(this,Wt,"f").call(this,$n,Pe,xt),(yield $n.signMessages({addresses:Et,payloads:hn})).map(Br=>({signedMessage:Br,signature:Br.slice(-ma)}))}))}catch($n){throw new Error($n instanceof Error&&$n.message||"Unknown error")}})),lt.set(this,(...$e)=>d(this,void 0,void 0,function*(){const Pe=[];if($e.length>1)for(const xt of $e)Pe.push(yield f(this,yt,"f").call(this,xt));else return[yield f(this,yt,"f").call(this,$e[0])];return Pe})),yt.set(this,$e=>d(this,void 0,void 0,function*(){var Pe,xt;m(this,J,!0);try{const Et=yield f(this,ht,"f").call(this,Object.assign(Object.assign({},$e),{domain:(Pe=$e==null?void 0:$e.domain)!==null&&Pe!==void 0?Pe:window.location.host}));if(!Et.sign_in_result)throw new Error("Sign in failed, no sign in result returned by wallet");const hn=Et.sign_in_result.address;return{account:Object.assign(Object.assign({},(xt=Et.accounts.find(pi=>pi.address==hn))!==null&&xt!==void 0?xt:{address:hn}),{publicKey:_(hn)}),signedMessage:_(Et.sign_in_result.signed_message),signature:_(Et.sign_in_result.signature)}}catch(Et){throw new Error(Et instanceof Error&&Et.message||"Unknown error")}finally{m(this,J,!1)}})),m(this,Z,ft.authorizationCache),m(this,C,ft.appIdentity),m(this,we,ft.chains),m(this,he,ft.chainSelector),m(this,Se,ft.onWalletNotFound),m(this,xe,{[n.SolanaSignAndSendTransaction]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:f(this,Xe,"f")}})}get version(){return f(this,q,"f")}get name(){return f(this,F,"f")}get url(){return f(this,z,"f")}get icon(){return f(this,B,"f")}get chains(){return f(this,we,"f")}get features(){return Object.assign({[r.StandardConnect]:{version:"1.0.0",connect:f(this,Fe,"f")},[r.StandardDisconnect]:{version:"1.0.0",disconnect:f(this,yn,"f")},[r.StandardEvents]:{version:"1.0.0",on:f(this,Re,"f")},[n.SolanaSignMessage]:{version:"1.0.0",signMessage:f(this,rt,"f")},[n.SolanaSignIn]:{version:"1.0.0",signIn:f(this,lt,"f")}},f(this,xe,"f"))}get accounts(){var ft,$e;return($e=(ft=f(this,M,"f"))===null||ft===void 0?void 0:ft.accounts)!==null&&$e!==void 0?$e:[]}get connected(){return!!f(this,M,"f")}get isAuthorized(){return!!f(this,M,"f")}get currentAuthorization(){return f(this,M,"f")}get cachedAuthorizationResult(){return f(this,Z,"f").get()}}P=new WeakMap,q=new WeakMap,F=new WeakMap,z=new WeakMap,B=new WeakMap,C=new WeakMap,M=new WeakMap,Z=new WeakMap,J=new WeakMap,ae=new WeakMap,we=new WeakMap,he=new WeakMap,xe=new WeakMap,Se=new WeakMap,Re=new WeakMap,Fe=new WeakMap,ht=new WeakMap,Dt=new WeakMap,At=new WeakMap,Wt=new WeakMap,yn=new WeakMap,Yt=new WeakMap,Jt=new WeakMap,bn=new WeakMap,Kt=new WeakMap,En=new WeakMap,Xe=new WeakMap,at=new WeakMap,rt=new WeakMap,lt=new WeakMap,yt=new WeakMap,R=new WeakSet,et=function(ft,...$e){var Pe;(Pe=f(this,P,"f")[ft])===null||Pe===void 0||Pe.forEach(xt=>xt.apply(null,$e))},Me=function(ft,$e){var Pe;f(this,P,"f")[ft]=(Pe=f(this,P,"f")[ft])===null||Pe===void 0?void 0:Pe.filter(xt=>$e!==xt)};class sd{constructor(ft){oe.add(this),Q.set(this,{}),ee.set(this,"1.0.0"),fe.set(this,uu),Ee.set(this,"https://solanamobile.com/wallets"),Te.set(this,W),De.set(this,void 0),vt.set(this,void 0),jt.set(this,void 0),kt.set(this,!1),dn.set(this,0),Ut.set(this,[]),_n.set(this,void 0),vn.set(this,void 0),Xn.set(this,void 0),kn.set(this,void 0),tr.set(this,void 0),Cn.set(this,($e,Pe)=>{var xt;return!((xt=f(this,Q,"f")[$e])===null||xt===void 0)&&xt.push(Pe)||(f(this,Q,"f")[$e]=[Pe]),()=>f(this,oe,"m",te).call(this,$e,Pe)}),re.set(this,({silent:$e}={})=>d(this,void 0,void 0,function*(){if(f(this,kt,"f")||this.connected)return{accounts:this.accounts};m(this,kt,!0);try{yield f(this,ye,"f").call(this)}catch(Pe){throw new Error(Pe instanceof Error&&Pe.message||"Unknown error")}finally{m(this,kt,!1)}return{accounts:this.accounts}})),ye.set(this,$e=>d(this,void 0,void 0,function*(){try{const Pe=yield f(this,jt,"f").get();if(Pe)return f(this,Ce,"f").call(this,Pe),Pe;f(this,tr,"f")&&m(this,tr,void 0,"f");const xt=yield f(this,_n,"f").select(f(this,Ut,"f"));return yield f(this,Rn,"f").call(this,Et=>d(this,void 0,void 0,function*(){const[hn,$n]=yield Promise.all([Et.getCapabilities(),Et.authorize({chain:xt,identity:f(this,De,"f"),sign_in_payload:$e})]),pi=f(this,or,"f").call(this,$n.accounts),Br=Object.assign(Object.assign({},$n),{accounts:pi,chain:xt});return Promise.all([f(this,ke,"f").call(this,hn),f(this,jt,"f").set(Br),f(this,Ce,"f").call(this,Br)]),Br}))}catch(Pe){throw new Error(Pe instanceof Error&&Pe.message||"Unknown error")}})),Ce.set(this,$e=>d(this,void 0,void 0,function*(){var Pe;const xt=f(this,vt,"f")==null||((Pe=f(this,vt,"f"))===null||Pe===void 0?void 0:Pe.accounts.length)!==$e.accounts.length||f(this,vt,"f").accounts.some((Et,hn)=>Et.address!==$e.accounts[hn].address);m(this,vt,$e),xt&&f(this,oe,"m",de).call(this,"change",{accounts:this.accounts})})),ke.set(this,$e=>d(this,void 0,void 0,function*(){const Pe=$e.features.includes("solana:signTransactions"),xt=$e.supports_sign_and_send_transactions||$e.features.includes("solana:signAndSendTransaction"),Et=n.SolanaSignAndSendTransaction in this.features!==xt||n.SolanaSignTransaction in this.features!==Pe;m(this,vn,Object.assign(Object.assign({},xt&&{[n.SolanaSignAndSendTransaction]:{version:"1.0.0",supportedTransactionVersions:$e.supported_transaction_versions,signAndSendTransaction:f(this,ga,"f")}}),Pe&&{[n.SolanaSignTransaction]:{version:"1.0.0",supportedTransactionVersions:$e.supported_transaction_versions,signTransaction:f(this,Kr,"f")}})),Et&&f(this,oe,"m",de).call(this,"change",{features:this.features})})),Ye.set(this,($e,Pe,xt)=>d(this,void 0,void 0,function*(){try{const Et=yield $e.authorize({auth_token:Pe,identity:f(this,De,"f")}),hn=f(this,or,"f").call(this,Et.accounts),$n=Object.assign(Object.assign({},Et),{accounts:hn,chain:xt});Promise.all([f(this,jt,"f").set($n),f(this,Ce,"f").call(this,$n)])}catch(Et){throw f(this,Bn,"f").call(this),new Error(Et instanceof Error&&Et.message||"Unknown error")}})),Bn.set(this,()=>d(this,void 0,void 0,function*(){var $e,Pe;($e=f(this,tr,"f"))===null||$e===void 0||$e.close(),f(this,jt,"f").clear(),m(this,kt,!1),m(this,dn,(Pe=f(this,dn,"f"),Pe++,Pe)),m(this,vt,void 0),m(this,tr,void 0),f(this,oe,"m",de).call(this,"change",{accounts:this.accounts})})),Rn.set(this,$e=>d(this,void 0,void 0,function*(){var Pe;const xt=(Pe=f(this,vt,"f"))===null||Pe===void 0?void 0:Pe.wallet_uri_base,hn=Object.assign(Object.assign({},xt?{baseUri:xt}:void 0),{remoteHostAuthority:f(this,kn,"f")}),$n=f(this,dn,"f"),pi=new k;if(f(this,tr,"f"))return $e(f(this,tr,"f").wallet);try{const{associationUrl:Br,close:wa,wallet:dd}=yield s.startRemoteScenario(hn),F0=pi.addEventListener("close",pb=>{pb&&wa()});return pi.initWithQR(Br.toString()),pi.open(),m(this,tr,{close:wa,wallet:yield dd},"f"),F0(),pi.close(),yield $e(f(this,tr,"f").wallet)}catch(Br){throw pi.close(),f(this,dn,"f")!==$n&&(yield new Promise(()=>{})),Br instanceof Error&&Br.name==="SolanaMobileWalletAdapterError"&&Br.code==="ERROR_WALLET_NOT_FOUND"&&(yield f(this,Xn,"f").call(this,this)),Br}})),mn.set(this,()=>{if(!f(this,vt,"f"))throw new Error("Wallet not connected");return{authToken:f(this,vt,"f").auth_token,chain:f(this,vt,"f").chain}}),or.set(this,$e=>$e.map(Pe=>{var xt,Et;const hn=_(Pe.address);return{address:u.default.encode(hn),publicKey:hn,label:Pe.label,icon:Pe.icon,chains:(xt=Pe.chains)!==null&&xt!==void 0?xt:f(this,Ut,"f"),features:(Et=Pe.features)!==null&&Et!==void 0?Et:Ja}})),gn.set(this,$e=>d(this,void 0,void 0,function*(){const{authToken:Pe,chain:xt}=f(this,mn,"f").call(this);try{return yield f(this,Rn,"f").call(this,Et=>d(this,void 0,void 0,function*(){return yield f(this,Ye,"f").call(this,Et,Pe,xt),yield Et.signTransactions({transactions:$e})}))}catch(Et){throw new Error(Et instanceof Error&&Et.message||"Unknown error")}})),Rr.set(this,($e,Pe)=>d(this,void 0,void 0,function*(){const{authToken:xt,chain:Et}=f(this,mn,"f").call(this);try{return yield f(this,Rn,"f").call(this,hn=>
1350d(this,void 0,void 0,function*(){const[$n,pi]=yield Promise.all([hn.getCapabilities(),f(this,Ye,"f").call(this,hn,xt,Et)]);if($n.supports_sign_and_send_transactions)return(yield hn.signAndSendTransactions(Object.assign(Object.assign({},Pe),{transactions:[$e]})))[0];throw new Error("connected wallet does not support signAndSendTransaction")}))}catch(hn){throw new Error(hn instanceof Error&&hn.message||"Unknown error")}})),ga.set(this,(...$e)=>d(this,void 0,void 0,function*(){const Pe=[];for(const xt of $e){const Et=e.VersionedTransaction.deserialize(xt.transaction),hn=yield f(this,Rr,"f").call(this,Et,xt.options);Pe.push({signature:u.default.decode(hn)})}return Pe})),Kr.set(this,(...$e)=>d(this,void 0,void 0,function*(){const Pe=$e.map(({transaction:Et})=>e.VersionedTransaction.deserialize(Et));return(yield f(this,gn,"f").call(this,Pe)).map(Et=>({signedTransaction:$(Et)?Et.serialize():new Uint8Array(Et.serialize({requireAllSignatures:!1,verifySignatures:!1}))}))})),Yr.set(this,(...$e)=>d(this,void 0,void 0,function*(){const{authToken:Pe,chain:xt}=f(this,mn,"f").call(this),Et=$e.map(({account:$n})=>A($n.publicKey)),hn=$e.map(({message:$n})=>$n);try{return yield f(this,Rn,"f").call(this,$n=>d(this,void 0,void 0,function*(){return yield f(this,Ye,"f").call(this,$n,Pe,xt),(yield $n.signMessages({addresses:Et,payloads:hn})).map(Br=>({signedMessage:Br,signature:Br.slice(-ma)}))}))}catch($n){throw new Error($n instanceof Error&&$n.message||"Unknown error")}})),ki.set(this,(...$e)=>d(this,void 0,void 0,function*(){const Pe=[];if($e.length>1)for(const xt of $e)Pe.push(yield f(this,Sl,"f").call(this,xt));else return[yield f(this,Sl,"f").call(this,$e[0])];return Pe})),Sl.set(this,$e=>d(this,void 0,void 0,function*(){var Pe,xt;m(this,kt,!0);try{const Et=yield f(this,ye,"f").call(this,Object.assign(Object.assign({},$e),{domain:(Pe=$e==null?void 0:$e.domain)!==null&&Pe!==void 0?Pe:window.location.host}));if(!Et.sign_in_result)throw new Error("Sign in failed, no sign in result returned by wallet");const hn=Et.sign_in_result.address;return{account:Object.assign(Object.assign({},(xt=Et.accounts.find(pi=>pi.address==hn))!==null&&xt!==void 0?xt:{address:hn}),{publicKey:_(hn)}),signedMessage:_(Et.sign_in_result.signed_message),signature:_(Et.sign_in_result.signature)}}catch(Et){throw new Error(Et instanceof Error&&Et.message||"Unknown error")}finally{m(this,kt,!1)}})),m(this,jt,ft.authorizationCache),m(this,De,ft.appIdentity),m(this,Ut,ft.chains),m(this,_n,ft.chainSelector),m(this,kn,ft.remoteHostAuthority),m(this,Xn,ft.onWalletNotFound),m(this,vn,{[n.SolanaSignAndSendTransaction]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:f(this,ga,"f")}})}get version(){return f(this,ee,"f")}get name(){return f(this,fe,"f")}get url(){return f(this,Ee,"f")}get icon(){return f(this,Te,"f")}get chains(){return f(this,Ut,"f")}get features(){return Object.assign({[r.StandardConnect]:{version:"1.0.0",connect:f(this,re,"f")},[r.StandardDisconnect]:{version:"1.0.0",disconnect:f(this,Bn,"f")},[r.StandardEvents]:{version:"1.0.0",on:f(this,Cn,"f")},[n.SolanaSignMessage]:{version:"1.0.0",signMessage:f(this,Yr,"f")},[n.SolanaSignIn]:{version:"1.0.0",signIn:f(this,ki,"f")}},f(this,vn,"f"))}get accounts(){var ft,$e;return($e=(ft=f(this,vt,"f"))===null||ft===void 0?void 0:ft.accounts)!==null&&$e!==void 0?$e:[]}get connected(){return!!f(this,tr,"f")&&!!f(this,vt,"f")}get isAuthorized(){return!!f(this,vt,"f")}get currentAuthorization(){return f(this,vt,"f")}get cachedAuthorizationResult(){return f(this,jt,"f").get()}}Q=new WeakMap,ee=new WeakMap,fe=new WeakMap,Ee=new WeakMap,Te=new WeakMap,De=new WeakMap,vt=new WeakMap,jt=new WeakMap,kt=new WeakMap,dn=new WeakMap,Ut=new WeakMap,_n=new WeakMap,vn=new WeakMap,Xn=new WeakMap,kn=new WeakMap,tr=new WeakMap,Cn=new WeakMap,re=new WeakMap,ye=new WeakMap,Ce=new WeakMap,ke=new WeakMap,Ye=new WeakMap,Bn=new WeakMap,Rn=new WeakMap,mn=new WeakMap,or=new WeakMap,gn=new WeakMap,Rr=new WeakMap,ga=new WeakMap,Kr=new WeakMap,Yr=new WeakMap,ki=new WeakMap,Sl=new WeakMap,oe=new WeakSet,de=function(ft,...$e){var Pe;(Pe=f(this,Q,"f")[ft])===null||Pe===void 0||Pe.forEach(xt=>xt.apply(null,$e))},te=function(ft,$e){var Pe;f(this,Q,"f")[ft]=(Pe=f(this,Q,"f")[ft])===null||Pe===void 0?void 0:Pe.filter(xt=>$e!==xt)};var Cl=function(sn,ft,$e,Pe,xt){if(Pe==="m")throw new TypeError("Private method is not writable");if(Pe==="a"&&!xt)throw new TypeError("Private accessor was defined without a setter");if(typeof ft=="function"?sn!==ft||!xt:!ft.has(sn))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Pe==="a"?xt.call(sn,$e):xt?xt.value=$e:ft.set(sn,$e),$e},ep=function(sn,ft,$e,Pe){if($e==="a"&&!Pe)throw new TypeError("Private accessor was defined without a getter");if(typeof ft=="function"?sn!==ft||!Pe:!ft.has(sn))throw new TypeError("Cannot read private member from an object whose class did not declare it");return $e==="m"?Pe:$e==="a"?Pe.call(sn):Pe?Pe.value:ft.get(sn)},ec;
1350function Tl(sn){const ft=({register:$e})=>$e(sn);try{window.dispatchEvent(new Ao(ft))}catch($e){console.error(`wallet-standard:register-wallet event could not be dispatched 1351`,$e)}try{window.addEventListener("wallet-standard:app-ready",({detail:$e})=>ft($e))}catch($e){console.error(`wallet-standard:app-ready event listener could not be added 1352`,$e)}}class Ao extends Event{constructor(ft){super("wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),ec.set(this,void 0),Cl(this,ec,ft,"f")}get detail(){return ep(this,ec,"f")}get type(){return"wallet-standard:register-wallet"}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}ec=new WeakMap;function du(){return typeof window<"u"&&window.isSecureContext&&typeof document<"u"&&/android/i.test(navigator.userAgent)}function od(){return typeof window<"u"&&window.isSecureContext&&typeof document<"u"&&!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function Mc(sn){du()?Tl(new _l(sn)):od()&&sn.remoteHostAuthority!==void 0&&Tl(new sd(Object.assign(Object.assign({},sn),{remoteHostAuthority:sn.remoteHostAuthority})))}const ad="To use mobile wallet adapter, you must have a compatible mobile wallet application installed on your device.",cd="This browser appears to be incompatible with mobile wallet adapter. Open this page in a compatible mobile browser app and try again.";class tp extends Y{constructor(){super(...arguments),this.contentStyles=$o,this.contentHtml=ld}initWithError(ft){super.init(),this.populateError(ft)}populateError(ft){var $e,Pe;const xt=($e=this.dom)===null||$e===void 0?void 0:$e.getElementById("mobile-wallet-adapter-error-message"),Et=(Pe=this.dom)===null||Pe===void 0?void 0:Pe.getElementById("mobile-wallet-adapter-error-action");if(xt){if(ft.name==="SolanaMobileWalletAdapterError")switch(ft.code){case"ERROR_WALLET_NOT_FOUND":xt.innerHTML=ad,Et&&Et.addEventListener("click",()=>{window.location.href="https://solanamobile.com/wallets"});return;case"ERROR_BROWSER_NOT_SUPPORTED":xt.innerHTML=cd,Et&&(Et.style.display="none");return}xt.innerHTML=`An unexpected error occurred: ${ft.message}`}else console.log("Failed to locate error dialog element")}}const ld=` 1353<svg class="mobile-wallet-adapter-embedded-modal-error-icon" xmlns="http://www.w3.org/2000/svg" height="50px" viewBox="0 -960 960 960" width="50px" fill="#000000"><path d="M 280,-80 Q 197,-80 138.5,-138.5 80,-197 80,-280 80,-363 138.5,-421.5 197,-480 280,-480 q 83,0 141.5,58.5 58.5,58.5 58.5,141.5 0,83 -58.5,141.5 Q 363,-80 280,-80 Z M 824,-120 568,-376 Q 556,-389 542.5,-402.5 529,-416 516,-428 q 38,-24 61,-64 23,-40 23,-88 0,-75 -52.5,-127.5 Q 495,-760 420,-760 345,-760 292.5,-707.5 240,-655 240,-580 q 0,6 0.5,11.5 0.5,5.5 1.5,11.5 -18,2 -39.5,8 -21.5,6 -38.5,14 -2,-11 -3,-22 -1,-11 -1,-23 0,-109 75.5,-184.5 Q 311,-840 420,-840 q 109,0 184.5,75.5 75.5,75.5 75.5,184.5 0,43 -13.5,81.5 Q 653,-460 629,-428 l 251,252 z m -615,-61 71,-71 70,71 29,-28 -71,-71 71,-71 -28,-28 -71,71 -71,-71 -28,28 71,71 -71,71 z"/></svg> 1354<div class="mobile-wallet-adapter-embedded-modal-title">We can't find a wallet.</div> 1355<div id="mobile-wallet-adapter-error-message" class="mobile-wallet-adapter-embedded-modal-subtitle"></div> 1356<div> 1357 <button data-error-action id="mobile-wallet-adapter-error-action" class="mobile-wallet-adapter-embedded-modal-error-action"> 1358 Find a wallet 1359 </button> 1360</div> 1361`,$o=` 1362.mobile-wallet-adapter-embedded-modal-content { 1363 text-align: center; 1364} 1365 1366.mobile-wallet-adapter-embedded-modal-error-icon { 1367 margin-top: 24px; 1368} 1369 1370.mobile-wallet-adapter-embedded-modal-title { 1371 margin: 18px 100px auto 100px; 1372 color: #000000; 1373 font-size: 2.75em; 1374 font-weight: 600; 1375} 1376 1377.mobile-wallet-adapter-embedded-modal-subtitle { 1378 margin: 30px 60px 40px 60px; 1379 color: #000000; 1380 font-size: 1.25em; 1381 font-weight: 400; 1382} 1383 1384.mobile-wallet-adapter-embedded-modal-error-action { 1385 display: block; 1386 width: 100%; 1387 height: 56px; 1388 /*margin-top: 40px;*/ 1389 font-size: 1.25em; 1390 /*line-height: 24px;*/ 1391 /*letter-spacing: -1%;*/ 1392 background: #000000; 1393 color: #FFFFFF; 1394 border-radius: 18px; 1395} 1396 1397/* Smaller screens */ 1398@media all and (max-width: 600px) { 1399 .mobile-wallet-adapter-embedded-modal-title { 1400 font-size: 1.5em; 1401 margin-right: 12px; 1402 margin-left: 12px; 1403 } 1404 .mobile-wallet-adapter-embedded-modal-subtitle { 1405 margin-right: 12px; 1406 margin-left: 12px; 1407 } 1408} 1409`;function Mg(){return d(this,void 0,void 0,function*(){if(typeof window<"u"){const sn=window.navigator.userAgent.toLowerCase(),ft=new tp;sn.includes("wv")?ft.initWithError({name:"SolanaMobileWalletAdapterError",code:"ERROR_BROWSER_NOT_SUPPORTED",message:""}):ft.initWithError({name:"SolanaMobileWalletAdapterError",code:"ERROR_WALLET_NOT_FOUND",message:""}),ft.open()}})}function j0(){return()=>d(this,void 0,void 0,function*(){Mg()})}const xh="SolanaMobileWalletAdapterDefaultAuthorizationCache";function z0(){let sn;try{sn=window.localStorage}catch{}return{clear(){return d(this,void 0,void 0,function*(){if(sn)try{sn.removeItem(xh)}catch{}})},get(){return d(this,void 0,void 0,function*(){if(sn)try{const ft
1409=JSON.parse(sn.getItem(xh));if(ft&&ft.accounts){const $e=ft.accounts.map(Pe=>Object.assign(Object.assign({},Pe),{publicKey:"publicKey"in Pe?new Uint8Array(Object.values(Pe.publicKey)):new e.PublicKey(Pe.address).toBytes()}));return Object.assign(Object.assign({},ft),{accounts:$e})}else return ft||void 0}catch{}})},set(ft){return d(this,void 0,void 0,function*(){if(sn)try{sn.setItem(xh,JSON.stringify(ft))}catch{}})}}}function ud(){return{select(sn){return d(this,void 0,void 0,function*(){return sn.length===1?sn[0]:sn.includes(i.SOLANA_MAINNET_CHAIN)?i.SOLANA_MAINNET_CHAIN:sn[0]})}}}return Bd.LocalSolanaMobileWalletAdapterWallet=_l,Bd.RemoteSolanaMobileWalletAdapterWallet=sd,Bd.SolanaMobileWalletAdapterWalletName=uu,Bd.createDefaultAuthorizationCache=z0,Bd.createDefaultChainSelector=ud,Bd.createDefaultWalletNotFoundHandler=j0,Bd.defaultErrorModalWalletNotFoundHandler=Mg,Bd.registerMwa=Mc,Bd}var EY;function v7e(){if(EY)return sf;EY=1,Object.defineProperty(sf,"__esModule",{value:!0});var n=IDe(),e=qie,t=jU(),r=b7e();function i(B,C,M,Z){function J(ae){return ae instanceof M?ae:new M(function(we){we(ae)})}return new(M||(M=Promise))(function(ae,we){function he(Re){try{Se(Z.next(Re))}catch(et){we(et)}}function xe(Re){try{Se(Z.throw(Re))}catch(et){we(et)}}function Se(Re){Re.done?ae(Re.value):J(Re.value).then(he,xe)}Se((Z=Z.apply(B,[])).next())})}function s(B,C,M,Z){if(M==="a"&&!Z)throw new TypeError("Private accessor was defined without a getter");if(typeof C=="function"?B!==C||!Z:!C.has(B))throw new TypeError("Cannot read private member from an object whose class did not declare it");return M==="m"?Z:M==="a"?Z.call(B):Z?Z.value:C.get(B)}function o(B,C,M,Z,J){if(typeof C=="function"?B!==C||!0:!C.has(B))throw new TypeError("Cannot write private member to an object whose class did not declare it");return C.set(B,M),M}const a="standard:connect",c="standard:disconnect",u="standard:events";function d(B){return window.btoa(String.fromCharCode.call(null,...B))}function f(){return typeof window<"u"&&window.isSecureContext&&typeof document<"u"&&/android/i.test(navigator.userAgent)}var m,w,y,b,E,T,N,I,H,L,U,K,Y;const k="Mobile Wallet Adapter",j=64;function V(B){return"version"in B}function W(B){switch(B){case"mainnet-beta":return"solana:mainnet";case"testnet":return"solana:testnet";case"devnet":return"solana:devnet";default:return B}}class $ extends n.BaseSignInMessageSignerWalletAdapter{constructor(C,M){super(),m.add(this),this.supportedTransactionVersions=new Set(["legacy",0]),w.set(this,void 0),y.set(this,!1),b.set(this,f()?n.WalletReadyState.Loadable:n.WalletReadyState.Unsupported),E.set(this,void 0),T.set(this,void 0),N.set(this,void 0),I.set(this,Z=>i(this,void 0,void 0,function*(){if(Z.accounts&&Z.accounts.length>0){s(this,m,"m",L).call(this);const J=yield s(this,E,"f").call(this,Z.accounts);J!==s(this,T,"f")&&(o(this,T,J),o(this,N,void 0),this.emit("connect",this.publicKey))}})),o(this,E,Z=>i(this,void 0,void 0,function*(){var J;const ae=yield M.addressSelector.select(Z.map(({publicKey:we})=>d(we)));return(J=Z.find(({publicKey:we})=>d(we)===ae))!==null&&J!==void 0?J:Z[0]})),o(this,w,C),s(this,w,"f").features[u].on("change",s(this,I,"f")),this.name=s(this,w,"f").name,this.icon=s(this,w,"f").icon,this.url=s(this,w,"f").url}get publicKey(){var C;if(!s(this,N,"f")&&s(this,T,"f"))try{o(this,N,new e.PublicKey(s(this,T,"f").publicKey),"f")}catch(M){throw new n.WalletPublicKeyError(M instanceof Error&&(M==null?void 0:M.message)||"Unknown error",M)}return(C=s(this,N,"f"))!==null&&C!==void 0?C:null}get connected(){return s(this,w,"f").connected}get connecting(){return s(this,y,"f")}get readyState(){return s(this,b,"f")}autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(){return i(this,void 0,void 0,function*(){return yield this.autoConnect()})}autoConnect(){return i(this,void 0,void 0,function*(){s(this,m,"m",H).call(this,!0)})}connect(){return i(this,void 0,void 0,function*(){s(this,m,"m",H).call(this)})}performAuthorization(C){return i(this,void 0,void 0,function*(){try{const M=yield s(this,w,"f").cachedAuthorizationResult;return M?(yield s(this,w,"f").features[a].connect({silent:!0}
1409),M):(C?yield s(this,w,"f").features[t.SolanaSignIn].signIn(C):yield s(this,w,"f").features[a].connect(),yield yield s(this,w,"f").cachedAuthorizationResult)}catch(M){throw new n.WalletConnectionError(M instanceof Error&&M.message||"Unknown error",M)}})}disconnect(){return i(this,void 0,void 0,function*(){return yield s(this,m,"m",Y).call(this,()=>i(this,void 0,void 0,function*(){o(this,y,!1),o(this,N,void 0),o(this,T,void 0),yield s(this,w,"f").features[c].disconnect(),this.emit("disconnect")}))})}signIn(C){return i(this,void 0,void 0,function*(){return s(this,m,"m",Y).call(this,()=>i(this,void 0,void 0,function*(){var M;if(s(this,b,"f")!==n.WalletReadyState.Installed&&s(this,b,"f")!==n.WalletReadyState.Loadable)throw new n.WalletNotReadyError;o(this,y,!0);try{const Z=yield s(this,w,"f").features[t.SolanaSignIn].signIn(Object.assign(Object.assign({},C),{domain:(M=C==null?void 0:C.domain)!==null&&M!==void 0?M:window.location.host}));if(Z.length>0)return Z[0];throw new Error("Sign in failed, no sign in result returned by wallet")}catch(Z){throw new n.WalletConnectionError(Z instanceof Error&&Z.message||"Unknown error",Z)}finally{o(this,y,!1)}}))})}signMessage(C){return i(this,void 0,void 0,function*(){return yield s(this,m,"m",Y).call(this,()=>i(this,void 0,void 0,function*(){const M=s(this,m,"m",U).call(this);try{return(yield s(this,w,"f").features[t.SolanaSignMessage].signMessage({account:M,message:C}))[0].signature}catch(Z){throw new n.WalletSignMessageError(Z==null?void 0:Z.message,Z)}}))})}sendTransaction(C,M,Z){return i(this,void 0,void 0,function*(){return yield s(this,m,"m",Y).call(this,()=>i(this,void 0,void 0,function*(){const J=s(this,m,"m",U).call(this);try{let ae=function(){let we;switch(M.commitment){case"confirmed":case"finalized":case"processed":we=M.commitment;break;default:we="finalized"}let he;switch(Z==null?void 0:Z.preflightCommitment){case"confirmed":case"finalized":case"processed":he=Z.preflightCommitment;break;case void 0:he=we;break;default:he="finalized"}return(he==="finalized"?2:he==="confirmed"?1:0)<(we==="finalized"?2:we==="confirmed"?1:0)?he:we};if(t.SolanaSignAndSendTransaction in s(this,w,"f").features){const we=W(s(this,w,"f").currentAuthorization.chain),[he]=(yield s(this,w,"f").features[t.SolanaSignAndSendTransaction].signAndSendTransaction({account:J,transaction:C.serialize(),chain:we,options:Z?{skipPreflight:Z.skipPreflight,maxRetries:Z.maxRetries}:void 0})).map(xe=>d(xe.signature));return he}else{const[we]=yield s(this,m,"m",K).call(this,[C]);if(V(we))return yield M.sendTransaction(we);{const he=we.serialize();return yield M.sendRawTransaction(he,Object.assign(Object.assign({},Z),{preflightCommitment:ae()}))}}}catch(ae){throw new n.WalletSendTransactionError(ae==null?void 0:ae.message,ae)}}))})}signTransaction(C){return i(this,void 0,void 0,function*(){return yield s(this,m,"m",Y).call(this,()=>i(this,void 0,void 0,function*(){const[M]=yield s(this,m,"m",K).call(this,[C]);return M}))})}signAllTransactions(C){return i(this,void 0,void 0,function*(){return yield s(this,m,"m",Y).call(this,()=>i(this,void 0,void 0,function*(){return yield s(this,m,"m",K).call(this,C)}))})}}w=new WeakMap,y=new WeakMap,b=new WeakMap,E=new WeakMap,T=new WeakMap,N=new WeakMap,I=new WeakMap,m=new WeakSet,H=function(C=!1){return i(this,void 0,void 0,function*(){if(!(this.connecting||this.connected))return yield s(this,m,"m",Y).call(this,()=>i(this,void 0,void 0,function*(){if(s(this,b,"f")!==n.WalletReadyState.Installed&&s(this,b,"f")!==n.WalletReadyState.Loadable)throw new n.WalletNotReadyError;o(this,y,!0);try{yield s(this,w,"f").features[a].connect({silent:C})}catch(M){throw new n.WalletConnectionError(M instanceof Error&&M.message||"Unknown error",M)}finally{o(this,y,!1)}}))})},L=function(){s(this,b,"f")!==n.WalletReadyState.Installed&&this.emit("readyStateChange",o(this,b,n.WalletReadyState.Installed))},U=function(){if(!s(this,w,"f").isAuthorized||!s(this,T,"f"))throw new n.WalletNotConnectedError;return s(this,T,"f")},K=function(C){return i(this,void 0,void 0,function*(){const M=s(this,m,"m",U).call(this);try{if(t.SolanaSignTransaction in s(this,w,"f").features)return s(this,w,"f").features[t.SolanaSignTransaction].signTransaction(...C.map(Z=>({account:M,transaction:Z.serialize()}
1409))).then(Z=>Z.map(J=>{const ae=J.signedTransaction,he=ae[0]*j+1;return e.VersionedMessage.deserializeMessageVersion(ae.slice(he,ae.length))==="legacy"?e.Transaction.from(ae):e.VersionedTransaction.deserialize(ae)}));throw new Error("Connected wallet does not support signing transactions")}catch(Z){throw new n.WalletSignTransactionError(Z==null?void 0:Z.message,Z)}})},Y=function(C){return i(this,void 0,void 0,function*(){try{return yield C()}catch(M){throw this.emit("error",M),M}})};class A extends ${constructor(C){var M;const Z=W((M=C.chain)!==null&&M!==void 0?M:C.cluster);super(new r.LocalSolanaMobileWalletAdapterWallet({appIdentity:C.appIdentity,authorizationCache:{set:C.authorizationResultCache.set,get:()=>i(this,void 0,void 0,function*(){const J=yield C.authorizationResultCache.get();return J&&"chain"in J?J:J?Object.assign(Object.assign({},J),{chain:Z}):void 0}),clear:C.authorizationResultCache.clear},chains:[Z],chainSelector:r.createDefaultChainSelector(),onWalletNotFound:()=>i(this,void 0,void 0,function*(){C.onWalletNotFound(this)})}),{addressSelector:C.addressSelector,chain:Z})}}class _ extends ${constructor(C){const M=W(C.chain);super(new r.RemoteSolanaMobileWalletAdapterWallet({appIdentity:C.appIdentity,authorizationCache:{set:C.authorizationResultCache.set,get:()=>i(this,void 0,void 0,function*(){const Z=yield C.authorizationResultCache.get();return Z&&"chain"in Z?Z:Z?Object.assign(Object.assign({},Z),{chain:M}):void 0}),clear:C.authorizationResultCache.clear},chains:[M],chainSelector:r.createDefaultChainSelector(),remoteHostAuthority:C.remoteHostAuthority,onWalletNotFound:()=>i(this,void 0,void 0,function*(){C.onWalletNotFound(this)})}),{addressSelector:C.addressSelector,chain:M})}}class R extends A{}function P(){return{select(B){return i(this,void 0,void 0,function*(){return B[0]})}}}function q(){return r.createDefaultAuthorizationCache()}function F(B){return i(this,void 0,void 0,function*(){return r.defaultErrorModalWalletNotFoundHandler()})}function z(){return F}return sf.LocalSolanaMobileWalletAdapter=A,sf.RemoteSolanaMobileWalletAdapter=_,sf.SolanaMobileWalletAdapter=R,sf.SolanaMobileWalletAdapterWalletName=k,sf.createDefaultAddressSelector=P,sf.createDefaultAuthorizationResultCache=q,sf.createDefaultWalletNotFoundHandler=z,sf}var Fm=v7e(),Sn=function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},oo=function(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t},ra,rl,Uy,jy,py,rS,PN,si,DN,EB,N6,AB,PS,SB,AY,SY,_Y,CY;class x7e extends _U{get name(){return Sn(this,si,"f").name}get url(){return"https://github.com/solana-labs/wallet-standard"}get icon(){return Sn(this,si,"f").icon}get readyState(){return Sn(this,DN,"f")}get publicKey(){return Sn(this,Uy,"f")}get connecting(){return Sn(this,jy,"f")}get supportedTransactionVersions(){return Sn(this,PN,"f")}get wallet(){return Sn(this,si,"f")}get standard(){return!0}constructor({wallet:e}){super(),ra.add(this),rl.set(this,void 0),Uy.set(this,void 0),jy.set(this,void 0),py.set(this,void 0),rS.set(this,void 0),PN.set(this,void 0),si.set(this,void 0),DN.set(this,typeof window>"u"||typeof document>"u"?wn.Unsupported:wn.Installed),SB.set(this,t=>{if("accounts"in t){const r=Sn(this,si,"f").accounts[0];Sn(this,rl,"f")&&!Sn(this,py,"f")&&r!==Sn(this,rl,"f")&&(r?Sn(this,ra,"m",N6).call(this,r):(this.emit("error",new eb),Sn(this,ra,"m",AB).call(this)))}"features"in t&&Sn(this,ra,"m",PS).call(this)}),oo(this,si,e,"f"),oo(this,rl,null,"f"),oo(this,Uy,null,"f"),oo(this,jy,!1,"f"),oo(this,py,!1,"f"),oo(this,rS,Sn(this,si,"f").features[n4].on("change",Sn(this,SB,"f")),"f"),Sn(this,ra,"m",PS).call(this)}destroy(){oo(this,rl,null,"f"),oo(this,Uy,null,"f"),oo(this,jy,!1,"f"),oo(this,py,!1,"f");const e=Sn(this,rS,"f");e&&(oo(this,rS,null,"f"),e())}async autoConnect(){return Sn(this,ra,"m",EB).call(this,{silent:!0})}async connect(){return Sn(this,ra,"m",EB).call(this)}async disconnect(){if(NN in Sn(this,si,"f").features)try{oo(this,py,!0,"f"),await Sn(this,si,"f").features[NN].disconnect()}
1409catch(e){this.emit("error",new _g(e==null?void 0:e.message,e))}finally{oo(this,py,!1,"f")}Sn(this,ra,"m",AB).call(this)}async sendTransaction(e,t,r={}){try{const i=Sn(this,rl,"f");if(!i)throw new hr;let s;if(Fd in Sn(this,si,"f").features)if(i.features.includes(Fd))s=Fd;else if(qs in Sn(this,si,"f").features&&i.features.includes(qs))s=qs;else throw new Xl;else if(qs in Sn(this,si,"f").features){if(!i.features.includes(qs))throw new Xl;s=qs}else throw new k2;const o=bPe(t.rpcEndpoint);if(!i.chains.includes(o))throw new Fu;try{const{signers:a,...c}=r;let u;if(Sf(e)?(a!=null&&a.length&&e.sign(a),u=e.serialize()):(e=await this.prepareTransaction(e,t,c),a!=null&&a.length&&e.partialSign(...a),u=new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))),s===Fd){const[d]=await Sn(this,si,"f").features[Fd].signAndSendTransaction({account:i,chain:o,transaction:u,options:{preflightCommitment:S6(c.preflightCommitment||t.commitment),skipPreflight:c.skipPreflight,maxRetries:c.maxRetries,minContextSlot:c.minContextSlot}});return Os.encode(d.signature)}else{const[d]=await Sn(this,si,"f").features[qs].signTransaction({account:i,chain:o,transaction:u,options:{preflightCommitment:S6(c.preflightCommitment||t.commitment),minContextSlot:c.minContextSlot}});return await t.sendRawTransaction(d.signedTransaction,{...c,preflightCommitment:S6(c.preflightCommitment||t.commitment)})}}catch(a){throw a instanceof eo?a:new Fu(a==null?void 0:a.message,a)}}catch(i){throw this.emit("error",i),i}}}rl=new WeakMap,Uy=new WeakMap,jy=new WeakMap,py=new WeakMap,rS=new WeakMap,PN=new WeakMap,si=new WeakMap,DN=new WeakMap,SB=new WeakMap,ra=new WeakSet,EB=async function(e){try{if(this.connected||this.connecting)return;if(Sn(this,DN,"f")!==wn.Installed)throw new ih;if(oo(this,jy,!0,"f"),!Sn(this,si,"f").accounts.length)try{await Sn(this,si,"f").features[t4].connect(e)}catch(r){throw new w0(r==null?void 0:r.message,r)}const t=Sn(this,si,"f").accounts[0];if(!t)throw new Xl;Sn(this,ra,"m",N6).call(this,t)}catch(t){throw this.emit("error",t),t}finally{oo(this,jy,!1,"f")}},N6=function(e){let t;try{t=new bt(e.address)}catch(r){throw new sh(r==null?void 0:r.message,r)}oo(this,rl,e,"f"),oo(this,Uy,t,"f"),Sn(this,ra,"m",PS).call(this),this.emit("connect",t)},AB=function(){oo(this,rl,null,"f"),oo(this,Uy,null,"f"),Sn(this,ra,"m",PS).call(this),this.emit("disconnect")},PS=function(){var t,r;const e=Fd in Sn(this,si,"f").features?Sn(this,si,"f").features[Fd].supportedTransactionVersions:Sn(this,si,"f").features[qs].supportedTransactionVersions;oo(this,PN,DPe(e,["legacy"])?null:new Set(e),"f"),qs in Sn(this,si,"f").features&&((t=Sn(this,rl,"f"))!=null&&t.features.includes(qs))?(this.signTransaction=Sn(this,ra,"m",AY),this.signAllTransactions=Sn(this,ra,"m",SY)):(delete this.signTransaction,delete this.signAllTransactions),Ey in Sn(this,si,"f").features&&((r=Sn(this,rl,"f"))!=null&&r.features.includes(Ey))?this.signMessage=Sn(this,ra,"m",_Y):delete this.signMessage,lP in Sn(this,si,"f").features?this.signIn=Sn(this,ra,"m",CY):delete this.signIn},AY=async function(e){try{const t=Sn(this,rl,"f");if(!t)throw new hr;if(!(qs in Sn(this,si,"f").features))throw new k2;if(!t.features.includes(qs))throw new Xl;try{const i=(await Sn(this,si,"f").features[qs].signTransaction({account:t,transaction:Sf(e)?e.serialize():new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}))[0].signedTransaction;return Sf(e)?w1.deserialize(i):Wr.from(i)}catch(r){throw r instanceof eo?r:new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}},SY=async function(e){try{const t=Sn(this,rl,"f");if(!t)throw new hr;if(!(qs in Sn(this,si,"f").features))throw new k2;if(!t.features.includes(qs))throw new Xl;try{const r=await Sn(this,si,"f").features[qs].signTransaction(...e.map(i=>({account:t,transaction:Sf(i)?i.serialize():new Uint8Array(i.serialize({requireAllSignatures:!1,verifySignatures:!1}))})));return e.map((i,s)=>{const o=r[s].signedTransaction;return Sf(i)?w1.deserialize(o):Wr.from(o)})}catch(r){throw new ps(r==null?void 0:r.message,r)}}
1409catch(t){throw this.emit("error",t),t}},_Y=async function(e){try{const t=Sn(this,rl,"f");if(!t)throw new hr;if(!(Ey in Sn(this,si,"f").features))throw new k2;if(!t.features.includes(Ey))throw new Xl;try{return(await Sn(this,si,"f").features[Ey].signMessage({account:t,message:e}))[0].signature}catch(r){throw new tb(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}},CY=async function(e={}){try{if(!(lP in Sn(this,si,"f").features))throw new k2;let t;try{[t]=await Sn(this,si,"f").features[lP].signIn(e)}catch(r){throw new Qq(r==null?void 0:r.message,r)}if(!t)throw new Qq;return Sn(this,ra,"m",N6).call(this,t.account),t}catch(t){throw this.emit("error",t),t}};const E7e=bie;function A7e(n){const e=TY(()=>new Set),{get:t,on:r}=TY(()=>mPe()),[i,s]=X.useState(()=>IY(t()));X.useEffect(()=>{const a=[r("register",(...c)=>s(u=>[...u,...IY(c)])),r("unregister",(...c)=>s(u=>u.filter(d=>c.some(f=>f===d.wallet))))];return()=>a.forEach(c=>c())},[r]);const o=S7e(i);return X.useEffect(()=>{if(!o)return;const a=new Set(i);new Set(o.filter(u=>!a.has(u))).forEach(u=>u.destroy())},[o,i]),X.useEffect(()=>()=>i.forEach(a=>a.destroy()),[]),X.useMemo(()=>[...i,...n.filter(({name:a})=>i.some(c=>c.name===a)?(e.has(a)||(e.add(a),console.warn(`${a} was registered as a Standard Wallet. The Wallet Adapter for ${a} can be removed from your app.`)),!1):!0)],[i,n,e])}function TY(n){const e=X.useRef(void 0);return e.current===void 0&&(e.current={value:n()}),e.current.value}function S7e(n){const e=X.useRef(void 0);return X.useEffect(()=>{e.current=n}),e.current}function IY(n){return n.filter(E7e).map(e=>new x7e({wallet:e}))}var J2;(function(n){n[n.DESKTOP_WEB=0]="DESKTOP_WEB",n[n.MOBILE_WEB=1]="MOBILE_WEB"})(J2||(J2={}));function _7e(n){return/(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(n)}function C7e({adapters:n,userAgentString:e}){return n.some(t=>t.name!==Fm.SolanaMobileWalletAdapterWalletName&&t.readyState===wn.Installed)?J2.DESKTOP_WEB:e&&/android/i.test(e)&&!_7e(e)?J2.MOBILE_WEB:J2.DESKTOP_WEB}function T7e(n){return n?/devnet/i.test(n)?"devnet":/testnet/i.test(n)?"testnet":"mainnet-beta":"mainnet-beta"}function I7e({children:n,wallets:e,adapter:t,isUnloadingRef:r,onAutoConnectRequest:i,onConnectError:s,onError:o,onSelectWallet:a}){const c=X.useRef(!1),[u,d]=X.useState(!1),f=X.useRef(!1),[m,w]=X.useState(!1),[y,b]=X.useState(()=>(t==null?void 0:t.publicKey)??null),[E,T]=X.useState(()=>(t==null?void 0:t.connected)??!1),N=X.useRef(o);X.useEffect(()=>(N.current=o,()=>{N.current=void 0}),[o]);const I=X.useRef((_,R)=>(r.current||(N.current?N.current(_,R):(console.error(_,R),_ instanceof ih&&typeof window<"u"&&R&&window.open(R.url,"_blank"))),_)),[H,L]=X.useState(()=>e.map(_=>({adapter:_,readyState:_.readyState})).filter(({readyState:_})=>_!==wn.Unsupported));X.useEffect(()=>{L(R=>e.map((P,q)=>{const F=R[q];return F&&F.adapter===P&&F.readyState===P.readyState?F:{adapter:P,readyState:P.readyState}}).filter(({readyState:P})=>P!==wn.Unsupported));function _(R){L(P=>{const q=P.findIndex(({adapter:z})=>z===this);if(q===-1)return P;const{adapter:F}=P[q];return[...P.slice(0,q),{adapter:F,readyState:R},...P.slice(q+1)].filter(({readyState:z})=>z!==wn.Unsupported)})}return e.forEach(R=>R.on("readyStateChange",_,R)),()=>{e.forEach(R=>R.off("readyStateChange",_,R))}},[t,e]);const U=X.useMemo(()=>H.find(_=>_.adapter===t)??null,[t,H]);X.useEffect(()=>{if(!t)return;const _=q=>{b(q),c.current=!1,d(!1),T(!0),f.current=!1,w(!1)},R=()=>{r.current||(b(null),c.current=!1,d(!1),T(!1),f.current=!1,w(!1))},P=q=>{I.current(q,t)};return t.on("connect",_),t.on("disconnect",R),t.on("error",P),()=>{t.off("connect",_),t.off("disconnect",R),t.off("error",P),R()}},[t,r]);const K=X.useRef(!1);X.useEffect(()=>()=>{K.current=!1},[t]),X.useEffect(()=>{K.current||c.current||E||!i||!((U==null?void 0:U.readyState)===wn.Installed||(U==null?void 0:U.readyState)===wn.Loadable)||(c.current=!0,d(!0),K.current=!0,async function(){try{await i()}catch{s()}finally{d(!1),c.current=!1}}())},[E,i,s,U]);const Y=X.useCallback(async(_,R,P)=>{if(!t)throw I.current(new iK);if(!E)throw I.current(new hr,t);return await t.sendTransaction(_,R,P)},[t,E]),k=X.useMemo(()=>t&&"signTransaction"in t?async _=>{if(!E)throw I.current(new hr,t);return await t.signTransaction(_)}:void 0,[t,E]),j=X.useMemo(()=>t&&"signAllTransactions"in t?async _=>{if(!E)throw I.current(new hr,t);return await t.signAllTransactions(_)}:void 0,[t,E]),V=X.useMemo(()=>t&&"signMessage"in t?async _=>{if(!E)throw I.current(new hr,t);return await t.signMessage(_)}:void 0,[t,E]),W=X.useMemo(()=>t&&"signIn"in t?async _=>await t.signIn(_):void 0,[t]),$=X.useCallback(async()=>
1409{if(c.current||f.current||U!=null&&U.adapter.connected)return;if(!U)throw I.current(new iK);const{adapter:_,readyState:R}=U;if(!(R===wn.Installed||R===wn.Loadable))throw I.current(new ih,_);c.current=!0,d(!0);try{await _.connect()}catch(P){throw s(),P}finally{d(!1),c.current=!1}},[s,U]),A=X.useCallback(async()=>{if(!f.current&&t){f.current=!0,w(!0);try{await t.disconnect()}finally{w(!1),f.current=!1}}},[t]);return Qn.createElement(Fie.Provider,{value:{autoConnect:!!i,wallets:H,wallet:U,publicKey:y,connected:E,connecting:u,disconnecting:m,select:a,connect:$,disconnect:A,sendTransaction:Y,signTransaction:k,signAllTransactions:j,signMessage:V,signIn:W}},n)}let XP;function N7e(){var n;return XP===void 0&&(XP=((n=globalThis.navigator)==null?void 0:n.userAgent)??null),XP}function NY(n){const e=N7e();return C7e({adapters:n,userAgentString:e})===J2.MOBILE_WEB}function R7e(){const n=globalThis.location;if(n)return`${n.protocol}//${n.host}`}function M7e({children:n,wallets:e,autoConnect:t,localStorageKey:r="walletName",onError:i}){const{connection:s}=zie(),o=A7e(e),a=X.useMemo(()=>{if(!NY(o))return null;const N=o.find(I=>I.name===Fm.SolanaMobileWalletAdapterWalletName);return N||new Fm.SolanaMobileWalletAdapter({addressSelector:Fm.createDefaultAddressSelector(),appIdentity:{uri:R7e()},authorizationResultCache:Fm.createDefaultAuthorizationResultCache(),cluster:T7e(s==null?void 0:s.rpcEndpoint),onWalletNotFound:Fm.createDefaultWalletNotFoundHandler()})},[o,s==null?void 0:s.rpcEndpoint]),c=X.useMemo(()=>a==null||o.indexOf(a)!==-1?o:[a,...o],[o,a]),[u,d]=mDe(r,null),f=X.useMemo(()=>c.find(N=>N.name===u)??null,[c,u]),m=X.useCallback(N=>{u!==N&&(f&&f.name!==Fm.SolanaMobileWalletAdapterWalletName&&f.disconnect(),d(N))},[f,d,u]);X.useEffect(()=>{if(!f)return;function N(){b.current||d(null)}return f.on("disconnect",N),()=>{f.off("disconnect",N)}},[f,o,d,u]);const w=X.useRef(!1),y=X.useMemo(()=>{if(!(!t||!f))return async()=>{(t===!0||await t(f))&&(w.current?await f.connect():await f.autoConnect())}},[t,f]),b=X.useRef(!1);X.useEffect(()=>{if(u===Fm.SolanaMobileWalletAdapterWalletName&&NY(o)){b.current=!1;return}function N(){b.current=!0}return window.addEventListener("beforeunload",N),()=>{window.removeEventListener("beforeunload",N)}},[o,u]);const E=X.useCallback(()=>{f&&m(null)},[f,m]),T=X.useCallback(N=>{w.current=!0,m(N)},[m]);return Qn.createElement(I7e,{wallets:c,adapter:f,isUnloadingRef:b,onAutoConnectRequest:y,onConnectError:E,onError:i,onSelectWallet:T},n)}const k7e="Backpack";class sse extends R0{constructor(e={}){super(),this.name=k7e,this.url="https://backpack.app",this.icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAbvSURBVHgB7Z1dUtxGEMf/LZH3fU0V4PUJQg4QVj5BnBOAT2BzAsMJAicwPoHJCRDrAxifgLVxVV73ObDqdEtsjKn4C8+0NDv9e7AxprRC85uvnp4RYYW5qKpxCVTcYKsgfiDfGjMwIsZIvh7d/lkmzAiYy5fzhultyZhdlagf1vU5VhjCiiGFXq01zYSJdqWgx/hB5AHN5I/6iuilyFBjxVgZAdqCZ34ORoVIqAzSOhxsvq6PsSIkL4A281LwL2IW/F1UhLKgRz/X9QyJUyBhuuae31gWviLjiPF1wxeX29vPkTjJtgAftrd3GHSMnmHw4eZ0uodESVKAoRT+kpQlSE6Ats/XZv/ONK5vZHC49+B1fYjESG4MUDKfYmCFr0ic4fmHqtpCYiQlgA66QsztIzFi5j+RGMl0AXebfgn0aOTuvGG8owIarZsXOj3ronlRuEYnn84CJLo4Lgi/QL/H/LHmy/RwI6GA0RoS4acFHi8kGieFXS/QhmijFfQXmH3uPy5lSkoLbIkYlfyzhuM4juM4juM4juMMj6TzATQ4JH9tlRqFk8BM2aV9RWHB9K5kzK/KLui0KqliSQmgBa4BIS54cpMD0OeawFye3jk19JdKkWq62OAFkEIfrTXNUxBV1okf38Ot3MGjlFqHwQrQZvQ22Cfw7xjg6t8XkZaBGzpKIXdwcAJojZeCP5SC30HipJBEOigBZLn3qdzSPlKr8V9hyEmkgxCgj8zefuD9jen0AAOidwE0i6ZhfjXgRI+gDK016DUjqE3ubPhNLoWvaDLJouHToaSP9SbA0DJ7LekyiviNPgP0TC9dQM6FfxeZ7eyuT6cv0RPmAmjTx11uXx/MiegEDd425cfcwWV+H4O3+uiO+pTAVIA2uMN8av6QiWr5TQ++JVlTc/tEiF3jOMScZGC43kME0VSA95PJhWXhM+Gt1Phn98nStZa1r9mB2SDQPqefjhayfnDfFG2J5882z84eynVM5u3thlONhRhj0gLc5PRfwAw62JjW+wjE5Xa1L0VkshO4kXt/EPDev4ZJCyBRvlcwggjHG4EfYHc9OoIBBWy3mEUX4H1V7Ur7ZvILaT8qy7FRduleF9jXc4RggOUWs/gtANs0nYquvMXaMaTXlQHlE1ggayLvf5OKY0DUMYDWfmpsBjZa+9enOmiLy+VkcmqxaNW2ZgX9GnsLXNQWoGj4KYzQ2g8LyG5WUDR4hshEE6CN+AFmg5lFiRMYcI0uKRQGyIAwegWKJkBjYO8tzq12C7efQ7CK2I00MomIxOsCiCcwQhaW3sEQ6W7sPi/yIDqKAHp8m2nIF7COoc9ghQw4NU8SkYgiQCmLKXCCUSziPc84XYBh83/DSiWR3qUo2tT4ONdGYDTub73cSzD/PNt0rojdQHAByoXxw0E7XfoFhsjnRduD+DnWIkkXXACJl1cwRoMmf3cbRaOjLRzDXnKZVj9GBIILUJBtbVzyj9HAU19AgR6I9VzDtwCgMXpAo2Yxp0v/Ybi49ennJtIFEPMY/TCKHTvv+aTSUQzBgwrQ92YHbQVi3UN3GAVZhrf/jzECE1SAq/7n4yOJ074KPSBcJoii598vxgwrqAByg70HZJZbr0JJ0G5XZz5Z1e1rYccA5TAicqEk0O5ECl/3LvYys7mLTLHHCEzS7wz6Esv3+nyYTF58rwha63XAl8PG1aCnhesWq6EdOcKM3WvmXRHh+Gvv/tNVTJlJPC4a3RVEK72+sCSZ4+J/FBVhTUS43J7gJqFjrnl33A3sxtCa3nAWhX6bbAT4hJugCsNZ2TGA8224AJnjAmSOC5A5LkDmuACZ4wJkjguQOS5A5rgAmeMCZI4LkDkuQOa4AJnjAmSOC5A5LkDmuACZ4wJkjguQOWEFYJvz85xwBBWgKM1P68oKKsI/36ACdC9nsDlWPTsIJ5t1Hfw01OBjgI1p/YwLegIibw0CwESz9gUYZ2d/wHEcx3Ecx3Ecx3Ecx3HuS5QjfdrXxTHv3JzEkd2xKwHR9xPNuKGjzdf1MSIQXAA9XUsuuw8nKPpK3PWzs+AvrgwqgP1LojOjoEf3fRv6Zy+JgBSLOGfaOx1NE/6o+rCrgeT9fWp4SljmuACZ4wJkjguQOS5A5rgAmeMCZI4LkDkuQOa4AJnjAmSOC5A5LkDmuACZ4wJkjguQOS5A5rgAmeMCZI4LkDkuQOa4AJnj5wRmTlABqHQBohKhgg
1409UVYAEEP8fO+UiMgziDCvCwrnU3aw0nOATMQu8LVIIPAq+JdAerdwWBaQ/fjEBwAaQVmMnN7sEJCB3EqP3tlRGJy6qqmPkFMcZw7sucmfZiHQ6hRBNgSXdaCHbA7KeFfBvz9pxlxtl1gcN2XBWRfwHK959XFRG6AgAAAABJRU5ErkJggg==",this.supportedTransactionVersions=null,this._readyState=typeof window>"u"||typeof document>"u"?wn.Unsupported:wn.NotDetected,this._disconnected=()=>{const t=this._wallet;t&&(t.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("error",new eb),this.emit("disconnect"))},this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==wn.Unsupported&&N0(()=>{var t;return(t=window.backpack)!=null&&t.isBackpack?(this._readyState=wn.Installed,this.emit("readyStateChange",this._readyState),!0):!1})}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get connected(){var e;return!!((e=this._wallet)!=null&&e.isConnected)}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==wn.Installed)throw new ih;this._connecting=!0;const e=window.backpack;try{await e.connect()}catch(r){throw new w0(r==null?void 0:r.message,r)}if(!e.publicKey)throw new Xl;let t;try{t=new bt(e.publicKey.toBytes())}catch(r){throw new sh(r==null?void 0:r.message,r)}e.on("disconnect",this._disconnected),this._wallet=e,this._publicKey=t,this.emit("connect",t)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(t){this.emit("error",new _g(t==null?void 0:t.message,t))}}this.emit("disconnect")}async sendTransaction(e,t,r={}){try{const i=this._wallet;if(!i)throw new hr;const{signers:s,...o}=r;try{return await i.send(e,s,o,t,this.publicKey)}catch(a){throw new Fu(a==null?void 0:a.message,a)}}catch(i){throw this.emit("error",i),i}}async signTransaction(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signTransaction(e,this.publicKey)}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signAllTransactions(e,this.publicKey)}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signMessage(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signMessage(e,this.publicKey)}catch(r){throw new tb(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}}const O7e="Glow";class ose extends R0{constructor(e={}){if(super(),this.name=O7e,this.url="https://glow.app",this.icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAABrrFhUAAAB4FBMVEUAAACjON6dNNyjONd7C+GIHNq1S+K9W+O3TeLAVOe6TuSJHtqcMdPBVeiuQt2kOdeRJc7AVeeyRd95COR9DeF7CuKWKtCaL9KoPdr78/789/7//f+zPt7u0Pi7ROG5SuK9TOT67/315PzVYfHAT+bx1Pry4PuiMNWmMdaqN9moM9fv2vqvOdvtzff15/ysN9mxO9yzRN/13/ysPdz46Py/SeTFVemPE+/EUOe5QeC3P+DJW+y9SOOfLtPZYvT46/2TGOu2R+GNEPKaI9/PXO7t1fjbZfWgLNfu0/jIV+rQX++ZKdCQIdSWIOGmN9iYJNvCVOjRVe/CTOaKE+eZKNSgKd2TIdnLV+yECfGfKdqKEO2dJ9ylL9iNHdr02/uHC/KjLdp+BfCcKdbKU+t7B+eUJs+dLNKTHeG+ROXUW/GLGeCFFd6PHN+JDfOuQd3JS+vNWu2EEeGOF+WiNtbOUe2BDOf02fuSGuWOFOuUJdPWXfGFDuvMT+yVHOWIF9vCSOiZJteACeyLHNV9C+N4A+x1A+mGGOPHUOmKHN2aLtKFEOWXHubarPLXju7CfevoxvffuPXQmu7QfuvnvfXJje3dnPHBauTOcOu4bfDjp/SqUOytStugNu6yXd6bKueVNOUmkAxzAAAAGXRSTlMAIxB+3D9C/WLfo2CcxcXf34TffL6cvc/vU7i1KQAAOkJJREFUeNrElMFuqlAQhivICpLehFofgb6ET1CjCwk7drZNwA0SFqYJ8Upq1Ke+/wwz9hwurtT2m5lT0933z+jDLRgMPN/3w3AEnoihkAt1l10PU3SHN+aP8EwEQeC6ru973sB5+GWgHY4gW5jk1LlNjSFruy13FLEz5KGP/p9X5Xg8jp8D1/cGDz+N44WjYd6cKRorAozBDgHUaIX1YV13lo8WdS5OgKfrrxwFDsL1fuogHH80bHrcG/MEUAbqv6PC37ROU3v/zI7mjYb/ofZd/TfUUeyVyQQ9Du5/C174tGxsEEFViX7znYEF++/0AlJF/MmbS+Dtb2C7QZmQvHA2R5uM3Ttm4ITDJWg6EVTwRwsNHwBaqQ0QgrpTEa28wQat9Bx/+5q77/Lo3ycD72nJWOpsL/4NTV4Q3evP2krrQ4rz7zCdog3gzxFg/Wg27/nqvxvyR5qyLCPUJIomUeDdT395tucAyL8p+EEAyt5MwOBwsN0TLmRgAn3lLG4e/yvswdmerctyIoUUwNi/i76eAA3Loxu8NKeWYr/fFwu8pyzPEUSW11mW1TX1IevY69/pFC36SSL2cbyJ2RyNR3kXe4H0eaShj8H7eLsrGOj2vxo8/AlTVeTN6ixPb1GcsgL6GUWAb0IGyJ8TYFbpCtghYEg9QYM2gVh4pbHtgS4fq9fF4wi6BIMb/fSJPRfbV7AXOILWXi8A+idM1gvrrwiSp1a2WpsY+hguiuCSP906tPkC+nFvcf1DtV8qpE+jQF5ZIAHaPqYvgwPk
1409oU9vukosNlr4SPom6m/IR2hOAK8ym83KWWlx9ffAGen1f9tTG/IoNlcWSgbWFy8A/miTrVYM7AhIHk36SiTAEto96PfAuW79JP5Fj/IX/gafmIXtvpcS5TXNCupo3j2eD06ASKnnsNf1b7cxdWzxrlj2ZfTyEkWia9RMX+bxil+CEOpfNEszgcriE71g4P/J5sJ6sRbIXAIgPmhA8pEw8/m8fbYEJ2DKm/r29l+QgOhe5IpfAmf0j9SyaWkjisIwrS0I7bbgIn/AUDBlFm4Ds8hKs2lloouQILrLIiATGAQDycZf3ed85c4dTTX2Oefe+LF6znlndGv2eQKUh7XKNzQ8oE5BigD6mFvxlam7OTef6N+r99h4CrL1z3/P74JcX+xzTuVw5Xz0Mfj0ZauE/kblOQ9afDbKs5hzuKhnTQDXMgLg9kupezEPrqgLs7+SekojwFtKL3D/3F5xccBeL/+CuwWPwUcef8jyr/pBs25aeAT0LGX90A0A8nSoI8/+XZ71y6Fh/jTPuZun+Ef2Q7+vgjgDd2EfoJ//MYFvBB+4N5tbGv3Zeq++FFxzHPbPZbD7WjMQj74yZgIXF2NPQHoIuvrJHlrr79v+T+mckC/8KCfHB/pvFey3txv8Z7cz/BNNhok3DIB2edG3DNS1qtPBlbgbZTkuYwREwNefE/LJX+j3+5f95Fvo9uOmikspvZSjg17/4c8ERB//dgAqumoPICH6Qo2/URvy7gt/2z/rl97p34wFVZ5oz0ejOTUy/46+4f7hzSn0FPY9aEiUo4P9Af3ZZqbs078mAKlSAuItWC/VnwkYZm5XaZg+TT3d2ADUH338R7hLOaGf9m/OdIIfKTEMncDB/gTAJ8DlEah2NHQ3AKuV+HNgpfrBfRuxd0pB9DlywWQ+gVEbt4+nP20fzpL4Ty86wa89DMcHPv9BSkCFv16N1nU1NfsUACbg21/VMoM6oea4O2OpFAHcXf9m4owS2V8/9++r/dkplcw5r3N5+d4JfL0N/7DfaK1lCFWbaTWdTq+b9v6BCbB7j0A2gMd72OmXbD8Y0+g7XXt4GQBfPnVWnLnkgJO+WFiZPingTXny6b3//4S+uQdVNaua2D76Qpb/AHd62B4A9o++/6BkAoEFwNiz/zwA7i9Y9tW6p6dHFxBDcMjA2/8PfO74awJcn9PZPvqcYJXA3dj5Gzt3lw9CPgUgi0CuH/4uj77lfoB3gm8W3Rgwgbf+K/6xNdzfymH/0EiZfh4AXgDOkh4OaZnDMA2ADAS5fjlO+kFXHzJ/DUCkfzAoegPoLVoFi0WWAV6G39/8A5DvP6MKEKdoKrE6TwkAnYDKox+8OoCbMtt/sDcA/vYHe/cNlF5ONgM6ZnD0zxeA+cf+YdPVb/RMXybg/Bx/118Nawp9G8AL/449144/O/3JngCEvQ1AMH0aYw5N/er1aPvJX9rN5bWpIIzi+BYFFz7AqOSWLBTflSKloQsTEFcuBR+BVHBbQUEUpIviMjFtbSmllv6tnvkePTN37qRW6ZmZGxvr4nfmfN8MCQKfMTgxtQHk/Y/5dzl+uv/OzwR81QTgdcU1Go1evsR8SX6sV3Tg1bs0AYM7gzuYoG8KAOBBpAb4tpuehAXpu3ORBVPawLW0/DFzA4ZhQGoB8Q8SMB/wJQMSA2hlRAMCfFjkBz6m0TMB0JImAPjgN/wkAbr7c6CfJbvimwFYeHovMBWL4EzS/+gA2PEwftUyxnDYRwSUHvhvA7zQm4z+2SjI8GHASGT8YJcl9K/wIP8SDBB6237Meybtf1IAef1z88GukjciC84WDKidgGkBEN8cEANE/f686huGw2OAHuOZ4pMfCwEYRfjGj2kGhOeLpRdLA5HwswCCAdx/zATf4amPmHiPKSgVwZVaAJRcZ7b/y8vgDwnoiwVmgEzh9weebgCeFgDDpwVAlwX5/mMGiQGDgd0ATcr/2NsfJiWZ73bJTx/owKniCQA5PwbF64/zQ8M+ZA0Q8gpgAr5KBFgBln5Mp9ceIOjUm7CWVANRHADQewBmzYFI3Vvdbneh+wQO9Gr8qIKg4klwjfyEfx0eQ+M/CD/xYQCWByBYUGsBkDuA7dfhGWACVPQB9W9SfnNA+EGv4glICf3CAvAXYEAPSm1wBy6VOmC9/0F5BcAAzP6yBiDil6fBf/YAIAIrGGkPBD5FAzwARp8HgAbMzTXhgx0jqIfpiqrAe+HZUgdUC8guz1oHcFkCpAWYvAnOB3ywi4TYEwDt7Uy2xutrnU7rpqjVub+2Pt6YnKtyA1Sof0zgqwGYNID4EOBdPRggj5CENARNEbioXwA4PS3AyPlZA6p5SughwfcegCXa35mMO0Au6v7mxrm75GcFRB8CCL/guwGsfvK32712L8oAliYA4lGYBeADO0C6/8N8/xv52QSUHvtvCdgj+yHqbE6qmL92CfLyB37Cj/B3ia8WVJEJUyNwJnwFCDEAbP/N/OgBhQBYBr56DGTnx4j7UdQZb98dDOhAnACI/HEFOL2pCqtHWRdojMA14ce3PzwANQJ5/pmAsgHGji6I+O9P1m7+k9Ymv5t64F29A0BpACDlT9SrggniQ9wGahE4cfAdsNKzBZT4+4UA1LW/C/p/1+YEBtzLWsADVUMCJPqJqoopEHq/DpxMvgeCYACvQAJPlfe/HACM3a1C8o9SC7/LPSA5AS0BNXgoFEJV7wPpdfA0+P0b0OYPQModsJwAbv7/6eF2/FF48yWILSDBD8tf1AD2gUtxC9QEQJL/1YS/0P+oZv6dqfg3dOrjUHUmtY8CD/hn4wuw81NAp5gBMSBqg1eiAKyyA/AAsNtfKQAU8W83UxOb5DfiUbLgl1qg/HkPzM4AaLFytWVUtaPgFCvA+YGPscoEJOkfEr/IT/ycnha4iFx+jxYEAx6zBbAC8v1fxAgGtDGzCHgGLvEMcPE7cOC78v5XdIC1nyNhMgEyigngr6UWbHsPVEkFMACgjwxok32x5oCHAOcAz4Afwv/+g9KTf+iiAYfw763X6ZOf/En0JBHsDvxNar1KL4LpHUDwGQFhl4HpOUgicJ63IJXhvwZ/Af/wApi0GuC5u3zBYDRu2Ip+lT9Eam2kPZABqDfARagK0yKgFvBKGBw45S2ABqgF+ArsSPtPA/aeJ/SOxx+zzJPTX5O/zEL0qCoYUA8AJPz2jKvAE3BZ+U9GLcBEAwr4BQO2ai3PFP0pfsr7GTTTIL+U18IGSyA2oJscAAeawZIU0AA6oE3gjLcASPFX2QBKNwDyU779hjRNtMbtoBl8W15pURSC5kMw5a+wPAfsA0kXOMtbQJIAsH9X/iOcAFr9bHT/p/q/T1LQ+mkGzBZKYJGamUEGsCoXbwPeBa/mFQB8LOcf/k0BjDaiA+wYlKZg/EQc4D0wSwAF+pm4EUT3wQtJD/zCCgj4UHr9L+Sf8Vf84+DPU/BoxvlZAbUO+FTgRfInJsAjYFehT94DvqQJ8Bvw3wRgt8XtP07RgkfbWQ+o7/9TYcfS13oNQNflHij/ASY2wL4ErtV/Tk9NDP8Y6WmB6w9v5/7aZhWHccVLRUHw9kO80L6hBrUaFdu1IJIpFBWVjnlBNm84UFj7SyeSiSjiYMY1TROb1Rrb+a/6fO/n5OStlzmfc96TqKB8nvOc75t0fb/uugHCXxqwsgITlB8GLKQGyGeB2+kmcMX41QDAWw2o/wJEwzX+3/jjpgBdTwPgDjj9wgpdC4nKCNBt4D4yQB8C0gAI/od/9xNAfwq/gesWKkLQdwPK/cfmqwF+BiIDbsA9dBcUA74W0W8Bx03wHP8haNCX+CU/1LDl1pgRGRiGAWGBJUCO/0qRgNSAO+ibABug+MiAHgDAn9Pb4GufFviJAetJ8Ws0MCG8ykL8eMF0W+LdTchq4dJ8+V1Y+FV/4QDdBx9OA8APAcCANAEn7v/O6qCyO5/BhwfhREhcMldkoVVl/ya3q0ZxCGBAyY+L+c2BxbIKmAF3SgL8CEBUACQBmPJnwHUGrA9Wj1rOX6/woRRnRC4FFvoiKeGIWFANHp97wmuACehMD15e8bIYEVjIDKCvQ5spP+DVAZZwY62vf50jfAgU/H+rR8M
1409HUUQk3pcpeey5ucfnm6gDVgLiLuDxx8KvZkFEIAy4UhoAAV62/1x5/EP08be1c/ry4VLKfxNW8PAJYbUhHmPVAzLC5wAUYHXA9z9LANAJfsUPwfSNEF+GcwPUAvsNKFx5BBw/7v8j/F7A0ahxSxVumCWtuWcff/wX+TxA/O5A3AMF/+zK4uLiAl2lAfRJ6Hbm31b+LAEYLDhQ//kPWzGBAwhBQ1Vh3ALlh2T0Ir4MLTT1MyGdgcCPMwB8SgBbIJpfCAfEgLskALkD51LVff6dMD/UPoIB72YhqGzcGk/25ujPx1/Ys/vhr/4T0eC3/OPiCNghyMvg3TCABH6W8tMw5fQhFH+Iq99Qfkv+aMnRQ5kL/40T7fHTT9OPRHb9dtiYyz8IMz+T8/678kMgn4XvKxMAJftPi+OHdpwfOgQ/6XD9nyWg+jf4o5f4h+PPzi833IHWgpVA49ftF3otA5KBLAH3sAHcAKLmBOh9cHVaI+eHmjv6sNQfg8bfS0BF17+pGvizUv4Twpde6jcgc+C3tARqAII+IpA6IF8GHrqyLQG4RgZcKwwA+rnVkn9g/KIxJ+Aq5h+jEjB/X2H6q6sqnJo2ibQ/x78wSgn4pQFFBnbjBKQF0Oj51TKQnIE71AAE4Bqkz0GeS7U6S0eV8psm9tTwVbMAqipQJJxVAR//sFT5T/aP6bdm5bfl5lFwzAIpA8oPxR3wrPJHAEoD9FPANrUB0Mdf/9qAVsJfEefQ+cmCwbpsoe8l1KgdVb7/9jqVpHb/+BV/au7p568rv2fgkyIB2H58CMglBsQZeOC2R7a3v6bhDQC+pcc/DZ7GDI2dvzIdMj+m6HCdmTENqWI1Sn76R+EVzdw8qTLjr754RQzgBMwbfzhwPSkBtv8YZ/MUBD8bcC++DcMBiA3Qh4Czp0ASnaYJHQl/YOGltcMlIDQZVaVKfD/qNf+sIu0fywPEkYB+o3TgQAJg9DQXCZ9nmQAzYBuKBMgRwLAEkPhXYMsDQPgdQ+sMQB/axPjjcFjNNCETg2besOL90vgrbx9iCThopEoOARng4v3HsqYGlA7AgIe3SVkCsodAcGHRAOA6LQdA8t9JHGh1we0maC8l8uCmtDQ6juZB4IfIgOfyEumHIBKAIfSsxVBUwdSAa6IIAMZlOMD0wh9//l15AXB1MAaCHxG4aQ+G4+Op/jF6BAZWHXMHGqeSACySBSaEYHFN+HMD7mcDwgHgk/ghQMxVnr77GPCg7/wdF3nQ+i7n36Srt0nXZPyPTVgfHbzCjbSCP4rgEqHzCcnLwJ4bcJYdCBVVoM4APgTpU5CrMiIBkzgAUxok+GDH2sPa6232oC8ng/56x+NCk18wptUajo5/zvvnZQY8NeDsRQbiEPwaCWDsMGCtPANhwJUsAcYfFjA6Llar4De1uoGP2SP+ngzVxmQwHu4JepCHBet7o8HxV9FFL+2gZPzQvvB7qQwH3vA/EWD4OABra2vGv5hEAAZYR1Cit88BKb/8Dnzo0G4AnVKDogTABKX/HtfHNKA/fj8eDMaj/lA1Go3Gg4Pjr37+hhT4ZgDRYxr/XFXIHdjVBOQG0H1gdgQehAHKzxZwAtAR4TKG7b+hFwGojcDFi3QEeoSf6PuP2QLT24UMXy3w+Pv+awnsn2DAshhAnwCNXSZCMIOfDLBOmJQAa4AC/EhAxn/o/O1Ou8LAmzbT03oI9ovE30PrPNl6WuWd49fzg90TMLsCQr9Xs+QRKBIAer0TrpU3QjJAdJWWd6+GBSKCvlwGoGLkSoa+wJGh8GNhD1gRAOd/GwMz7aaZN1HEDE3tPwegPgPLOf8aLxBlwBQ1gBNwRR24ui3faC/RCAMu1wQAvApu/LBkQvS9q9h/zICP/e+FBbVNJIHPY2b+6R5Y60BEIHZfBimNwDxLDJBWoIQfjcDCAFYZAMaFBRBeXCPuGMcuyBL0zi5DE1AG4BvwJyr4B3zjqD8Eb2QBcC3yIppRBNmAbWXHoFczoAxARfD5YFXt1jvcMi/1gLUlAQhFAj7AAH/gSw/N8vzrs7P79B/CVBPKCPxKd0HbfSxYhd8DYA5EDUAb3DwCl1j+FLhpzwNQNw63ROQDzd4WsW9R+Le8i2YeAOCHyu0Peub/ndmxYC0MKCKwFlqUmUcABoBd+DEUXgZagAh86Ogv+dtDghcLMHHBAtHHNQFI+YV+6vNPdA+iHwbucgBUFc8iAil/fgoEPz0Dt20CHxc74Am4JNJH4N2GvhiAA1DvwA3BReM4lXXQpGGNdL9R/g+ijfJ7mNQ6EtPw38puf/rY4HrHpZ+k4zSoAb/FCWAFf/HTcTJAxQmwCHAbGEt/xKAVARCV/O3B1iXtm8aDuUWgtz66eAd4lrDTOqODquHHc7NzgR8hYCOiDDbOiAPBHg6o0gSorl2UBOgRgLgPSvTC8BIIzELE7mfgyxB7AAEdF1ags6SJLhblx+4zPhbb/ah+SeeIUadUJS5EBH6RBET+g39NzsDMBFgAQI+pNSBNwBAGcABO1A3tmCZT36cNVGX7pYsqVuw87T6GKGue7Pj22CyfgOXCAjsHEoEn9QyclIAFws8NoI9wYFd8PgTY+HgQ/sgrwIkaaLswdwGDuscx/Abv/gZetI3qD8Q+pS8Kfn9car5zkjwCp+pPwJmpM2AGXNzkLsCMbl2gTuc6tACcrCHgIfZAV+Br21S84JXpOQCEX9KXN3/rm/YLth+jTnYjuA7+mRYY/mKSABPzwwFeoK4UAH8I/vSeBeBkLd0g5ugXt4GZigygBrLcQRfCEvQqo4/tBzxpn+CX/zICT+oRKFR+I8wNIHShNwNCN+gERADqNbFOYRs09B2odUA/hNA41fQ5FLufGhB9k5YhOIBFFYaUZ6CsARhn3ADmLwzASPvA8QOgch/ACZAANNsna8z7XvQM8wQAO/idniX4UIb/jPVMeP5gWdShJSwIWRncXVH8+gjUJwBL1yXwmN1+BKDZbLoNpR3DIM+lm7+B6dvPw/QK0ef4WdeMZ0cM7+Io8BQrIgL7HoAyA6xIgP9PQDQBOb/gd2m2ogQ2obbMWboB/lLaM9Kap85QRp+dfusatW/obYxUHgM1oJEa8NOpIgJRBMwALYKSgK5Z8F0XDSCIf6c7kXsA6Bkdrzwg+2v7G83JLAMYH9d5mucz8NdJSm+KtnFp07A2sDEz+igLePEIvJwYcIouT8BaGPBqHIHvv/cEcACC/zSaP5AHh3YCmq62v9FVPRioAdErbQML6FneNvPzaBj3OVuAMdU3L7afdUAGGH+YkBYGM+B68Bt+fQLAbwZsSRvkpA0i8PFmpztMDGjxJYo3bfOgnwbg/eiWF/xZx7hQ0TVPy9+zqnHbIqBrqU5SBDj+GKd4YBJ+/oXwVTaA6MEvBmCgD3TCT+pGCWDUFkYTSzN945HYMwNAThbU8efw2e7nj4pbw4hhWxyIWQiHgA1YFgNAjxIARQL0ThgJQP2LAACfZAFwdW9wCaAAKG2bkf1Nlof3s0Zx3CMt2gWGMv5i+5P8m/baoghBfQTezIpgODD9o+HbLAAia4E/ZUCXamBWAmACLfEGw4LRnBC/4bPOswPWLC3k/KqsZ3RC/wIvhg9ZNaw1YPes4WsEwoLFMzgBJE1AHgHgk7L9RzUcSwngAADWlnhDabAwDBhfQ+AKenlFuyzf/Y+KpqnJ8beuYXOC7/zt2QZUXgVB/9MFOgai9PtA1ACgO34YAH2XaagnQHMur0quPkQ0xnoEYv9d2fZ/hvGRbD8cyPsFPa8GRL8U3ARSGXvpgFZBLv8/Af+C8mMm9wFLgP0/0KIGCH83d2A9NcAy0G61gj0OQrMv/FCQJx5oqzjGJ2UtI/OekYGPazfD57W+CCxLAuQEYLK8CCxEDQD7j/z/gepFDehSAMKALzHTEtDiBRJm5EFccO2l6T+fROAzDFpMH5mYvrz7RQBIfYMPE06ognoXvIBTAAOsDJgFkQDQs3oegUv6Ew2z4B28Wg0U7ta0mjKhFg8+Alz04AIug5c3oeAvm0VBwu7aF+bEAMzaIvAyGwD8C6gDloDAx7QEkAW9qIGQFoF3MCBaJlwDEQADTlV68ZLy57LNLwPwjPLnx3/agCfkkza4m/CB8We5oAbsEi1t/wWWOHBGIpAmwALQI36rAdEF/Ttc8OLQSkAddf76uycA+x/4uGp3vwyApd/VbsZXEFyqMgKZAT8RPE0xgEKgRSASoAbo7osB0Qedf7A1Lgw4UQfgB75l4LzhY6mPv/PXBOBPys7tJ64qjOJVY+o16otaK6WFTlERtQwYLV7SWJSi9mKaEqMSY2PFxAhJDYmmCY0vjQmUFgpIGv9X13fba1/mUF3nMjNeHtZvr+/bew4zZ05n7zfUPpJgAHBUTQAA9g2A2g//ECNQ9AD84Q4BoH+zT607gHLYubcAvhGx/X19YPm/kRNQ++XNchTAYZgPBraLvBJaANspAAUA+oc8Af4roLD/Hey3AJCAu+yBjHq37lysekBjH3t9u9Dy6ke4p3Z98CF95hSsIPIIGIBNser+CeC9S7EWZBOEDIAiwDXsFsCXm0fZA0dqBu3L+/5zCSkAHf0/3BfrX+w2AxLAqwagfvuN3aVdseyCPQJQBK5LeRMggLAfBVADmCWAjhZY1
1409MM9vfIBVfa7OyAXQGo/BO/Y7bSlrtkICAMTgxAoAUx5CwgxA5dsKsxXghoAQ2B/zviy0qkAMO6m47GVA2j8d9qvbhfIBhjD/6oR2PJBj4dWU+CA08cG4PZtBMAInM8jcMmaABPACoD8V4CqAPx0AgB8EhhX/wcjWJcSeLh/I9B2ALNf3Tb8nY1klEGILBBJmgePZAF4FwhwSgAMgQGIFui/gxkFcLFsgkcdQG573DcRwRiA2v/XrX+6L94BVDeLo38DwPQz/ykAdo6FwG0oCJzHFgnQErAm4CVAAvUc+AkBaAnQN7aSBB7IYN1KwGe/cv3TUf8QO6DK218OYBI7VtqtyIEA3rtd9QACYA0gARAB6CSAv+PE7+Bgkxc/YSXcJIAswreDCADyxj/sU+0CMJTyT/sh4SAAaJePVAmAywCM/3lNACcCJiD3f/UX7QDZj+B4EpAAWQeN0HWbfr4MAHrhQ+wPaAAIvqu2b3eNHwgABCwEB4oJYAWgBbAJQHFJgAAgAIB9yAPwSYw/fhjNALxVuBwPGhx6fSQAqBn/jgCw/ov7hVKeAEyzxiFYtBHwpSAAsAMsnIfePZ+KQNyzBByBfHIBCWAAZPcewJWwe20fWAcG4GtV2f6prvzTfwtA7E8yBrKJ+LwBcNsBuOqJkADcPpTG3xKAXQGcUAAjZpGO/RgnCW+Ct3j1uwHQ+m8ngMEAJjH+CiEYpCBMYVMSUEyDt6Hcv7QC1oBfGQUAlSZAFQFQAgmALITYAzzu6jpynyOxEuj2X8e/vQRG+9TWJCKgG62ThR1AEQmYUvtOQErAqiAmQlUA+O7PlIAvr8YvAToDfUkAYrgoBI5/Vg73fgj7GYAu+yUA+m8BjFgGJsM2/WevIwGT6Y3AwoIQWDD/DqA7ARfhHs4pDcSmLYQ8ADb8yXdwYCDu4zcTTZ3pZ/7pvqMBMgGSgawR1idsLIFeJADOPQIkwIVA3QMuQjQvIdBF4d1YCI0PlFKxklDdAQBXd/dvABT+W+1OZjVg403/bAUBYCI6wAISgF3l/knAAXzBACQCFAisE0AHAT9qAB3L/3r9f/AEcEbPhydDWQ8clIApBbBtABauLUBKwWUEmADYVwCeAGw1AawM70cJjB8gMvgnADSrX9rv/hsA1PiHjk+SgJ1om3tKwH4AUPO0XyyFDIB8aNsB+Md46h/Du3iHCXiICOAz/dtf4/+Njvybe78CMFCTpQrjLAdbCuOiqANwkQEAMAIOQBPgAZAdrulf9Pf/A/BAAUDff1b6by+A0j8vgZQ/GwRZCibC+Sk7Ff75xAFsGQAYN7EPFguBQ2JfE/AFe4CcywT0/x8A/9yLMChXfy0Be/9XNEDaD9nL7SoAZRTSamDqhALYM//UiiNgDRgAIyD+2QPgWa1/YwHAyS+K/jcAQwDQ2Dfntf0k1n81+kSwU/g/hd02YpAtAGgASGBGM0ACJ50AAMSXtwyAC97FNwCYTuHd0H8GsH4FAExE0LZ/Eujof/QPGASQE4CMgrrXScAATBYAVlZWFlayubBNgAKIDHyDDQhkj5LAPJgAzGIL8SmFhSABcPrj5f9m+neJ/ToAlK2EOO7MgO9WAX5ZfKL2D5UALnkCYN0Q6KeXmQB7MBgxDWAtHI5BgU8rGHcSgG8/o30TAYgq+1Az/ARwuAnAIs6LiiBqIS0D9mMdCPtQICCAVAL86pKNPzzrZntoNwDAprknB4ehe8yC6ccim+7XPfxtB3zffj3MAQxn7rFxl5eL+jDCSSBLQALANhgAmICrmoCLkQEyMApfcxowl7O+EQifPUgVQP/Mf+X/7e7xf18kZ0cwAY9BgBDUvQeAPXAlJgECUARG4JITAACzbwREt2j+Gyh9tvWUTwNhk5sT4bOJK1ECY5qAdvLDHwAPan+8YbwpUrCPuOf2Pfl8IAB9M0z/LIK6DQKAILiqBYAIQBeVgQkUzP8tdkFGnb6LBKwTAET7B+XflLm38FNCYMesLqpVL/5F1gF29kADEPYZAb84RgAYf5N/iUPk/kkA/0y64MAEBASe7l+hf89+2/1oH2rLP90pNSewt7iItEvgZefQZ/UQPXAD9nMA56ILtAlIkgiYxDalAK72y2kg3OuZu/dAyD/8WF/9MP9R/V0XwCL/xyCc5VESMLy4CN8CYbFYCSAU8Sp64N5NAqCsDbIJEMBVScCtIPDND5n/H6QAQOCEdUF3HxD4klkYg/8PLQBV/Pl7ad3tjw0Q1pMsA5uIgMVeQHj64yQNIiYBtgAZfQgR4ExQJuDHmAR/D/8/AMDXsI5DdQsqm8BsBoGjP4vn0N0rP1zvAJB//rWq/9q/D3yJYGdRA6BFQAQ4DAqqw9eB2zdvOgDaZxvkRIhZIH2DXwBcDQBqHwDkQ+14eatqAux4DkMeoyruXZHvPjT+Ofqmjukv818A0G6wtQi5ddusF0QJsAUIgN8WFi7D/+VzJgVAAiyBHxUAhC+xiX3oa0oIQLdujflKQEfa7OLsDyZ7+s91AOB3Pvlzye34w34NoMh/HYFhA5AlINci3wuvSAAuw6xavywQuBpSRQ2kBEBXDEBFwPxDm/F+aLZS9Q/GrqMC1H85/cvsb+IHAAavf2m/JiBNQCGkEOQCAJsEewjAb7/BrJnvigAB/GgA4B87ARQJuJJqYPZArV/h9/7Ki99F+Lv6P/PfyJoACGBzAhoFChVgV4MUwOWFc3kCCCDvglYC9vVtVdgnANMVqwFrAgdplwD40Q8r/3b51z3/txIoux4AJyDmmQMCmJcOIC0gEsAIdCQgKoAEKgTy71gDB+nBdQAI/wMXPzg6/LP+g8AHVQSG1HwhEoirQRPWAi+7dSCYd//QIABMQADABU07cF1HauCK6B/OA93avp4BUO+Mfzn8fPvf+C9/MosEpAag8aIERJYDzgEggArA6HsC5ueFQQ3gkpeABYA1AMG3CQwSgbETnAc6db8JAPx31L/5J4D2F7Owf6B7ENhdXI0aoGI6iFXQ8s2b6AAWgJ9//lnME4AsB2dAIAHgFEAAMvCZtAag+1kbHJqNkz1hBbADMP3038a/+c28LAAiQ+A6OYQA6E6ldsBV0E34dwDnfsY+D5UJIACMf7QABqCS18CDsg3SOp9uf84AtG/9Wf2dy1/aJwArgyX9RzuWgGBAZS0QBcAEmOa1CLgaJIDnpQIaAESQA0AblIsCCmBIdhxVCHZRAc0X/zn3t/5pnwBY/5SHYGlvFd5Xx3GulFpgb1n9MwHz2ByASv5UEE3gSQCA8hJoAwAedRuEX9mwk4OeL6QAcPFL/53tn+Xf/lwOtXRsaenY0CrMrzYBKFrgbxEAAHCxCvQieQ0ACFoAlMZCIxAXxmAWMgi26b6OALADDux+NN+Mfwtg2o5pOS19sCQENlYXJQBCYRxHHYC2BcpG/wAww2mAAH7EDVxMrICKwHX8S74jUvtGQU/2uGsdkA2g6f2mgf4ZfwKgLANLSydXxb0icK0yAEckADmAeSAY/Xl+dHQeGEAgpoEZAuDd+zgJmMZ0U5l/SC4NTr1lAKA5bFAg2GYHzH4pPgfQ7d9U268QLEF3hYDEQM84VGkOFP/RAuAeCEZFFoEVAgABA0D7SuB6IkBhVJ3A53xDEO5xThzuMwCsfyn+7sVPs/4hgHBPLQEB2qAZt14gT4sAWAVAmP7UPgDMWwAsAjPoAYMAMAFyPSdCQAKobgD4/FTeBeYm5Mws9BmA8meyu6/9Mv7Y2vy3CDQClKcgOgADwP4HBCKLwLmVmRn41xKAagDXr4v9H+ifGbgO4T+qIgACc1b+eHaP/r0B9Duq//jx3b29rQ3X1tbe7u7Jevw7tLS0tVqrXAWrfxDwBojxH5UT2yAQeAIA4CUCAIG4i4td0cIhAocPIQGACMhaYMojMJtvCADv/RwNsF+O/tnDexs769tzcz3ss3Ozs71eb67nmri7v7G1d9KHv5vAV0MNgHoKgHTw//jj5z/EvkkJlACePfQiAcBeBkCMi+xRCWgE/knLQe99OGy/92EA8G//FZd9Tx/eugfnFKzDf6vt/Y29k5n/r3yjNjoDsMUASP/D4dZ187dE8L+gNfBuDYD+FQAFACIAgPCJMSwHIwLY49QvCiCb/mB+Y108z85RcC8HznKarSns7M1U3gPBUh0BaYHWAbe
1409XAcD9ewJGM/lEcE67gDVBAjAFgBh9NaQA2AX6fFPIVQB0j/6L/nd4C+aH5nDImbI60ANnIWHexzMI9jsB78ntIBSHI9gYGICjR+ZTAMy9A/jDMyAR0HkA8hpoAfBWPpWI4D5XQ2HfA8AGEPYPb2yrb84Vg4UE0D61ub/1VRIQrE1Pr2F7b2i1h83EKXBf/AcAcc8AsAewBgzAM4MT4IIfJMDkAIBgln3QNJsFIC0AZOw3hyhNQKeQAOy0nzHYyxHkXaBXd8AiAAEAR0wDo04AALwHPAUA3QF4DTsJMAP6tnhqBATEu6tv/tP4n76zTt+y6Qs9wEF3ymqgS5sbM04AhbAm29pmr0f/fBvMDugRGC2lBGYgJAD+HQAJ0L8BoMoQ3GMRRATuZP4BYHhjk0tlWlcNToBs3WIMtAzW9no9+JejLgB2gI/U8kfYmAFNgAFgAtoCaP2/FgCMgRSBL4dMd/u5/8M++LZYnMAc4SMvmxKoO0Iv2mGrcY/BltmXA7rbE/vw3xQAhNH34Q8IKkUQACwCLxx6rADQjP8b2AZk4AFmgqIN7Ga3voV996fmITzB5gFozBMC9v+AQLWwqgQ4A9QFAOno0zwToDpfAWAHoH1jADkDpuC+LYcmT42rn/X0ZwCzPzE0MTE3IeM/FAlQFHje0Q57B9dAi2CjVyyBdqIAIPP/EQBg8HE4BJ8Iw78n4Onk/y8HkI9/CEFgBlRlG+hH/mHf/NuwT5hvP+P1rGxFAyyrgHXQhSAAXNssGsAyAfj4W/0rAPq3ElhRAJcA4IkcQBMAOKI0AmRwIbUBZOCON4Bhs2+b7ZZ+tS4IojOoPAqMAHUgguXltbXltT3xHw1gYbnugBp/kXIoegCnAQB4XAG0/nlVX8o6EMSyEEIbCALb9n/079O+JgCGgwIeZnFoEeCZcTAKZp8xEM2lbYD2Z0AACHbYAOfNPwNgBFQMQERgRmQA8IuT1RTY3tFMKbiiDwiDf45GI3yg/8edTfiESWfAk21zeCHuxbofegox/Q+Pwsay6NpQrAD22gIQ53pAZQKg6AHvAsAjBuAvCwCcVffzAwA7vBUIAYdw3wiM3Jf/48G62mUGsFebw4nh50YRgQWguw6EwF40wOXlpgN+hD2pXg3PpB7wCACwA0QA2m+0GYiog9A9JTBhw+9Df5D/WS8FeXAIOLI2kFrhw7V/DgT24Z8NkAGAfScw+qluXAxFBM5bCTx66FB0AAIob2lH4ZUAyBisg8DsAxl+eJMAQAGAIEjATt4WsUwwAL6r/VxD2LpgrC4O7YFATyeAfAnkAXD/nz4sAfjl6efVP0qAARCTvKOHHZoCy4ApCNwZe+3OOBZEUuO5e7LgFv9SW4IslHxlyNWwusauh51b+QIIyZ8/cXQbHGL86d/cf4qdTcACQAD469hhBUD/TQN4G7uLCAKAzAnj98b66/q+CBkwhVUcAaKgwDYJ/xMegCHPPk5BQFh0MPAF0OL88sYkht8bAN8FswF4GTADBiBWgs8CwIuSgDoAF/hnvVJMgan/2oNTRz5GJ5QMBAKPerite0L+JNogACgFaM4QYPNz63/SF0AnNpZXNP91AXgEIgHsAZn/GQfwDOyLCKD5Rnsfx5v9Nx1AMHAMm9oJfUU0MUiKoc5BahMiWw9g/MM23aeaoLJLIJPivl4BRP1bDbgGJ+ApAHjMAOQVcKFw3+/DPvwrAgj+k4TVuhPA+4JeTYBloQeHPxBwGvAnZp/55+7SN4Dx5cibzD9nAI4/xCbAJsgEvAAAT5ctEPYvXKhuakf12QsoJfAxCIw7gQ4KEgI9kwMB6FP4rHoAdxzuf4T+1T6U/EM+/h0AoCwBTwDA46kCxkiAf9fq93lbU1EiIIj881/3lMAUvrTERtApLpZqyehDDEC9M/42/6t7jn8RAHOvJ9GgaVAWggDwCAFAN8bMfwqAePfd1Q8ElN1sDgQYgg6xIKAKQk8OH+0O+/SP26aGfwLIGgBkCEaRAUlAaoPwr8KXBrAQ1HmQADwAr1+wHoDh7wsBV98gvF0ikGXC7sgrbAQMQZc4TRICJV47hz/8H9li/MM/J0DzzgQwAkUCsAyAXkpzwI0bYzcUQPhPACimoNDwSDQChGBubuI/qiVA89Uew/+xtf9RWC/8Q3kDZAKcQMcyAHrG/EM3UAL0/7oCoP1Xcwb9AgEycdpuOfifQ8CVUgXAoEQK2uG39neO7lXW/4IAAwDVACDxLwSeUgBPGwD6B4BIAOwXt7QqYoB/r977ViobJ17xXkgEne5dRFCItln9kxz+Izs+9ysA5p/+KSTAFoOpBUCcBESPA0D4v3Ej9w8ZANinLAtWCYDAzz9YGWgIJlcflgJeLxgsdU77HH6Jf9b96wUQ/ZcJ4CwQ7wRsEoAeZQLgvwTA73O3CMCm1s5RD8EIPrrYe3gh2DujLgA+J9C+3yz0Zlv+HH8CSHXQtIB4M/juo4dUzzMBJQBIC6BVtIRwjif64riEIBCsdiLg+6LODEz0aF/Tj7WPDv8e3/wX/jkD0L7tQDA4AeiB3gXZA9S/SyqbAajFnqhh0CfQzgmpgxNThmCcDLpAdKqnMvueflQ/F38Hjz81ygAUk6D2wOiCat9LAHL/TuDVbhUTpJ2P4/MDCQFjcPCaqB1/iOGP9E+M3hTV/q3+sdF+XQFcCfN6kLSAaAK6ChAGuX8I7gv/ZwZBwFbd/rVGAAZD/y8D7r6w38OFwNY/pP47AuAI0iTAOUDWga4X473wjQrAoI+0d3EwCHbecgSYEYzBuNTzAf2gY/BpH5e+9VJw65/V32m/bYKoAGkBoccsAfks2DcCdQCwq/AwgACzQASIgc4JqwhCXQ3F2yJ96BXuZeL30Yd9UVf+OxoAFwJ5ACIBL4R/rAQ8AFAEIAHgLR2S3vfHzqZABGRgEExptDkJ0rslfyT/0Zwhs88CoP9y/EeTCKCzB6ICQi/pm+G2BACAovX3/c4Gorocompw3poAApsVjYFBSBgoeod5uLfoq32v/RoA819eAoFz3UzpzUC9DJRFwJNqnTUwFj0AcgD1dzrju/xJXUGIyjl5V2MABg4BFBSDgaAWoUmId8Y195j49veWkzgDlv1fpGlX/yKF4BNBcTGAq4AnMgCPpiag9rH1X/cA/EoC4fwYDiIIKaMWxta2/14/GACCUQCHWiMq+6kg/obw0N41Mb6Ggx2ge/4f1RM3fc0CYAs8f0krgHqxnAUusAQq/3Rv32tXBl2N8YwyOYlSUAaA4BQcBMWfSUrm4X4H7s15HoBknzMA4x8MrAxsHTRKAvU7QbbBKgEO4NVIwGlYeT99pUFPOGyHoi2KX86TbJvDW6gFhwAKygEkku30o7FmHu6PbG9cW7PBl4d2BoB7VVn/Mf66Q6j/rgDYKogRiGkgawF4058K4PTpVACNLAZymP8ztZTP7samQRAOLlhW2+HcRn5qe2dmbc3th+Lyf9kAIdqPAOR1UAJw/1wE5BEggJgFISQgAHgABgOA2AzkqP0bvuG9nc1xWASIVkfN+9btNZfaX+uYANv6H/UDmz31BAz6qyBbICPgABgBUdh/9fSZM6cVQJcMQRRDq2zy2MUnxu9uTqyOHDmqOjI1NbS5vbOxNbO0tLaG3aXu6V8BVAEY5QogtpgCcOqqgBnOgXkE6N8yEAkwCPxWd5fMXetcdtZPDnGpFc2HmP92BqB/dcwm4C8+yqbAUQaAHaCIwFhFIEsAAnD6YQDS/NAMPHY5+fnYmaX3sZXu12xbSwS0+xX51w7QOf6Q9/7Bw99cDGz1CPxn82DfaiBmAahugh/IaXhwDBwDB9/+6RJ23+AaEUjuVeHfnVf5p//mCmAQ4AJAX5d/EWMAuAYo9Jh3QVXZBdEDAOAs/Wdf7tSzZ8BEwyaOP3zL0Z0A+s8SMNA/lwCcAXyvA8DxtwDwbVCpR58TAFwK9Z1AGYGzdG9nEf+Bq1gu6iv3zvF3BAwACbD7037rn1MACRQtwOy31wLZAes+2DQBSLqg+T8r9ulf86/usctWSQccUsNnjtG9RP8Y7ScItK8EOPzWAJJ9NsBR+rfUKwH3zjVw9akAdsBGz3ApxBqIAIDAaU2Al746H/5gePgDVw1hCf0uhh0vfGua/xrd19N/W//4LrT45x9BiUDEK+H2T8I/AYh/FkBbBDealYC6x24IIJh3Bm4dDMDBGTQQuHX5h6ax5/4h3Boe9pv+d84DYO3N/uSBs8545UXArABoXwLw5KOHOvVIXgNsAgHgrEi8GwMxHgoCpBBn9WxP3L4hYOPHN0AQgOks/V8pghj/azH8Nv7zVgFOADIAFM2XCwDOAN16LACwC8osQAAQnGMXJdfHSaBJgvrFA31XCdDvgDAAX4n929jUv98U7vLlFf82+LwkYBT+1X6a97KCkIMfEM8nQGwsgK424ASgvAaQAQUgXfCsRiAYwDn8Hz+OAximiQAHfIvUvj8WUuc4sLnM/W0WgN8STMcf0gTo+Ac
1409B2iaK0RD9138LOLANtF2APUC64FlxDgZmH7ax47BzLSkF2MfRaBoyBmF/TbL/3m3VtaQFIRD2kYBRBCAEAhECq4IMwDz2wv9BDYBtQAi4f9YAS4BtQCnoNGAR8BywKzAK0JId2vH4tVBjoOYh/7XoZRJQ97wlmBYAirr4MlAqAP9ILPZEoB7/J9kAugm8DACpBIiADLIeYC7NOxkcnwYGmCxugkEO04V93XX0Re6e/oXAyoLZRwSg5I8UfOCr3teO/2H6P0BPpwio+f6vv/pKiCEYzsQEZDJz8MqTGaf/TF/F8GsAVOV9oc9FA4BgrBJ983nr/zwvAvwvAkxAMRNk9mUHgW6pZ2NCtfbRAGGfHYD+IQUwLxVg5rDTcoWBX5Mtxp/+H6rHog1eIIHTTQaIQDPQyQD1EF7xorFvAHzscdB/DWAeAEZBwPtbGwX6Z/t3vcsV4H8jwC4A+0bg1wzA8Fmal/NxmQs7ExAg6D//Vvx708i+IIAMAX8fp0oAlAY4eaVvumf8PQD0/38IeBfQUxYBIggI0PFh+m01zYciBCenxbnsMK8A6J8JYASgPAE5DrpX87V95P9/6d/izp+1kRiI4l4vKOvFdvBVKY642ebKI7AEXLm0K5HmvkUI3PeHe9LM5K2klTnsmPz0x06KwHt6M1pIsd3TXysCMcEiAGZqANCDEogOW/z8PHuoH4bh7W2I8g15S7ae/8nkw4CPsxgQjjdLwJlDofyT6H+o6q8/D0xrAPz+WY1AbIMX9A/6CcnxR3wMyuswFQ/5StAPRL95AF1ngxlg7LX0Vb4ZYPf/NQ78kgjIZYgAvGMkjfAZg8CDug8DAj9ggw1T9HXgYgDW+DoKagCYWBCwJAS93Hn0qfzxSv1guQ4ZeDFgASPAEJTkwmWXGUkcCPKB7qMhAQhFAKgfU1C91B2X2EP5Wv79cnEd7acD75oBjMQE1sB/ZMAMqCbA4/iVUwTypQ+YB2gEMgC/qnZA9dTP9ndVGaANGNGCIgVVihgwBKUJwHtsdIAW
1409iAMHyJeN0ifYr6byR3Bl/FkGvAmyDBwnPGfSGYecIawCy4CHAZ4OKAcxAaI+dKAUDvHYOQ6UzssP7JaL23CP9i8CZoBlYKTdkPL3WQXEmTng4xbVez96YAaEhYP8ozkQYepDmOSMlYU//pmVW9xOiypgBhILjvSAHTE3oWTI8TEE0I8ZGDFpAQi3GU2ow9r3PP6badZsBOIA9BtHsq9QGoBRWGA5MCwFYUghIAtiwrwRvPdOIn/TUMPNdfCShQBjzoNYCHlH0L3qgRf5r/pdsVaAKTmAOig0+Vgfc+oPo+A3bvGVdFv2gawOaEJZD7waZcMigwxM4NkRzQEM2mClcNKQJ4mPG+Rjp/yvxq1pgVC3YC/7bDVgowWYZoHXGfGAPmAG+OJUOeyTjpB6KOdrdUfIvwdN91hJAT3IfYDoI2MwfzlMrwa64DPGBFEr/YHSgfcbtL670bTbLAVhJNAEpqFoCLXeCNKCyCy4jA/q3eLONG6tJogBrISUoidgS/uCUvGAPmQ2YIRNpxjjw+dq1/Hs78vStf32iZUwfUC84MM+8YF1gZXfD9hYEIqv8rDpO3d/8WUWOviwfRITFH677ENigzBTEjqJxySrVd/vOtcsvpll41zXtW3b9zAE/FAgXGb+4CgWpGmQNfPYuFI2oAe73a7rnGu+RPc/7NDmX/6EDAkAAAAASUVORK5CYII=",this.supportedTransactionVersions=null,this._readyState=typeof window>"u"||typeof document>"u"?wn.Unsupported:wn.NotDetected,this._disconnected=()=>{const t=this._wallet;t&&(t.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("error",new eb),this.emit("disconnect"))},this._connecting=!1,this._wallet=null,this._publicKey=null,this._network=e.network||null,this._readyState!==wn.Unsupported){const t=r=>{typeof r.data=="object"&&r.data.__glow_loaded&&(this._readyState!==wn.Installed&&(this._readyState=wn.Installed,this.emit("readyStateChange",this._readyState)),window.removeEventListener("message",t))};window.addEventListener("message",t),N0(()=>{var r;return(r=window.glowSolana)!=null&&r.isGlow?(window.removeEventListener("message",t),this._readyState!==wn.Installed&&(this._readyState=wn.Installed,this.emit("readyStateChange",this._readyState)),!0):!1})}}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get connected(){var e;return!!((e=this._wallet)!=null&&e.isConnected)}get readyState(){return this._readyState}async connect(){try{if(this.connected||this.connecting)return;if(this._readyState!==wn.Installed)throw new ih;this._connecting=!0;const e=window.glowSolana;try{await e.connect()}catch(r){throw new w0(r==null?void 0:r.message,r)}if(!e.publicKey)throw new Xl;let t;try{t=new bt(e.publicKey.toBytes())}catch(r){throw new sh(r==null?void 0:r.message,r)}e.on("disconnect",this._disconnected),this._wallet=e,this._publicKey=t,this.emit("connect",t)}catch(e){throw this.emit("error",e),e}finally{this._connecting=!1}}async disconnect(){const e=this._wallet;if(e){e.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(t){this.emit("error",new _g(t==null?void 0:t.message,t))}}this.emit("disconnect")}async sendTransaction(e,t,r={}){try{const i=this._wallet;if(!i)throw new hr;try{const{signers:s,...o}=r;e=await this.prepareTransaction(e,t,o),s!=null&&s.length&&e.partialSign(...s),o.preflightCommitment=o.preflightCommitment||t.commitment;const{signature:a}=await i.signAndSendTransaction(e,{...o,network:this._network});return a}catch(s){throw s instanceof eo?s:new Fu(s==null?void 0:s.message,s)}}catch(i){throw this.emit("error",i),i}}async signTransaction(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signTransaction(e,this._network)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(e){try{const t=this._wallet;if(!t)throw new hr;try{return await t.signAllTransactions(e,this._network)||e}catch(r){throw new ps(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}async signMessage(e){try{const t=this._wallet;if(!t)throw new hr;try{const{signature:r}=await t.signMessage(e);return r}catch(r){throw new tb(r==null?void 0:r.message,r)}}catch(t){throw this.emit("error",t),t}}}class P7e extends _U{constructor(){super(),this.name="Magic Eden"}async connect(){var r;if(!window.magicEdenSolana&&!((r=window.solana)!=null&&r.isMagicEden)&&!window.magicEden)throw new Error("Magic Eden Wallet not detected");const t=await(window.magicEdenSolana||window.magicEden||window.solana).connect();this.emit("connect",t)}async disconnect(){const e=window.magicEdenSolana||window.magicEden||window.solana;e&&await e.disconnect(),this.emit("disconnect")}}function D7e(){try{return tt.returnOpenHref(`${Be.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch{throw new Error("Could not open social popup")}}async function B7e(){it.push("ConnectingFarcaster");const n=Ge.getAuthConnector();if(n&&!_t.state.farcasterUrl)try{const{url:e}=await n.provider.getFarcasterUri();_t.setFarcasterUrl(e,ue.state.activeChain)}catch(e){it.goBack(),Ir.showError(e)}}async function L7e(n){it.push("ConnectingSocial");const e=Ge.getAuthConnector();let t=null;try{const r=setTimeout(()=>{throw new Error("Social login timed out. Please try again.")},45e3);if(e&&n){if(tt.isTelegram()||(t=D7e()),t)_t.setSocialWindow(t,ue.state.activeChain);else if(!tt.isTelegram())throw new Error("Could not create social popup");const{uri:i}=await e.provider.getSocialRedirectUri({provider:n});if(!i)throw t==null||t.close(),new Error("Could not fetch the social redirect uri");if(t&&(t.location.href=i),tt.isTelegram()){wt.setTelegramSocialProvider(n);const s=tt.formatTelegramSocialLoginUrl(i);tt.openHref(s,"_top")}clearTimeout(r)}}catch(r){t==null||t.close(),Ir.showError(r==null?void 0:r.message)}}async function $7e(n){_t.setSocialProvider(n,ue.state.activeChain),xn.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:n}}),n==="farcaster"?await B7e():await L7e(n)}function FU(n){var u;const e=sB(ue.state),{activeConnectorIds:t}=sB(Ge.state),r=e.activeChain;if(!r)return{allAccounts:[],address:void 0,caipAddress:void 0,status:void 0,isConnected:!1,embeddedWalletInfo:void 0};const i=(u=e.chains.get(r))==null?void 0:u.accountState,s=Ge.getAuthConnector(r),o=t[r];return{allAccounts:nt.getConnections(r).flatMap(d=>d.accounts.map(({address:f})=>tt.createAccount(r,f,"eoa"))),caipAddress:i==null?void 0:i.caipAddress,address:tt.getPlainAddress(i==null?void 0:i.caipAddress),isConnected:!!(i!=null&&i.caipAddress),status:i==null?void 0:i.status,embeddedWalletInfo:s&&o===Be.CONNECTOR_ID.AUTH?{user:i!=null&&i.user?{...i.user,username:wt.getConnectedSocialUsername()}:void 0,authProvider:(i==null?void 0:i.socialProvider)||"email",accountType:i==null?void 0:i.preferredAccountType,isSmartAccountDeployed:!!(i!=null&&i.smartAccountDeployed)}:void 0}}function U7e(n){const{providers:e,providerIds:t}=sB(Ii.state),r=e[n],i=t[n];return{walletProvider:r,walletProviderType:i}}/** 1410 * @license 1411 * Copyright 2018 Google LLC 1412 * SPDX-License-Identifier: BSD-3-Clause 1413 */const j7e=new Set(["children","localName","ref","style","className"]),RY=new WeakMap,MY=(n,e,t,r,i)=>{const s=i==null?void 0:i[e];s===void 0?(n[e]=t,t==null&&e in HTMLElement.prototype&&n.removeAttribute(e)):t!==r&&((o,a,c)=>{let u=RY.get(o);u===void 0&&RY.set(o,u=new Map);let d=u.get(a);c!==void 0?d===void 0?(u.set(a,d={handleEvent:c}),o.addEventListener(a,d)):d.handleEvent=c:d!==void 0&&(u.delete(a),o.removeEventListener(a,d))})(n,s,t)},_R=({react:n,tagName:e,elementClass:t,events:r,displayName:i})=>{const s=new Set(Object.keys(r??{})),o=n.forwardRef((a,c)=>{const u=n.useRef(new Map),d=n.useRef(null),f={},m={};for(const[w,y]of Object.entries(a))j7e.has(w)?f[w==="className"?"class":w]=y:s.has(w)||w in t.prototype?m[w]=y:f[w]=y;return n.useLayoutEffect(()=>{if(d.current===null)return;const w=new Map;for(const y in m)MY(d.current,y,a[y],u.current.get(y),r),u.current.delete(y),w.set(y,a[y]);for(const[y,b]of u.current)MY(d.current,y,void 0,b,r);u.current=w}),n.useLayoutEffect(()=>{var w;(w=d.current)==null||w.removeAttribute("defer-hydration")},[]),f.suppressHydrationWarning=!0,n.createElement(e,{...f,ref:n.useCallback(w=>{d.current=w,typeof c=="function"?c(w):c!==null&&(c.current=w)},[c])})});return o.displayName=i??t.name,o};/** 1414 * @license 1415 * Copyright 2017 Google LLC 1416 * SPDX-License-Identifier: BSD-3-Clause 1417 */const z7e={attribute:!0,type:String,converter:hN,reflect:!1,hasChanged:j$}
1417,F7e=(n=z7e,e,t)=>{const{kind:r,metadata:i}=t;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),r==="setter"&&((n=Object.create(n)).wrapped=!0),s.set(t.name,n),r==="accessor"){const{name:o}=t;return{set(a){const c=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,c,n)},init(a){return a!==void 0&&this.C(o,void 0,n,a),a}}}if(r==="setter"){const{name:o}=t;return function(a){const c=this[o];e.call(this,a),this.requestUpdate(o,c,n)}}throw Error("Unsupported decorator location: "+r)};function be(n){return(e,t)=>typeof t=="object"?F7e(n,e,t):((r,i,s)=>{const o=i.hasOwnProperty(s);return i.constructor.createProperty(s,r),o?Object.getOwnPropertyDescriptor(i,s):void 0})(n,e,t)}/** 1418 * @license 1419 * Copyright 2017 Google LLC 1420 * SPDX-License-Identifier: BSD-3-Clause 1421 */function qe(n){return be({...n,state:!0,attribute:!1})}/** 1422 * @license 1423 * Copyright 2018 Google LLC 1424 * SPDX-License-Identifier: BSD-3-Clause 1425 */const Nt=n=>n??Gs,W7e=Mt` 1426 :host { 1427 display: block; 1428 width: var(--local-width); 1429 height: var(--local-height); 1430 } 1431 1432 :host([data-object-fit='cover']) img { 1433 object-fit: cover; 1434 object-position: center center; 1435 } 1436 1437 :host([data-object-fit='contain']) img { 1438 object-fit: contain; 1439 object-position: center center; 1440 } 1441 1442 img { 1443 display: block; 1444 width: 100%; 1445 height: 100%; 1446 border-radius: inherit; 1447 } 1448`;var o4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let b1=class extends ut{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0,this.objectFit="cover"}render(){return this.objectFit&&(this.dataset.objectFit=this.objectFit),this.style.cssText=` 1449 --local-width: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; 1450 --local-height: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; 1451 `,le`<img src=${this.src} alt=${this.alt} @error=${this.handleImageError} />`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};b1.styles=[Dn,J8,W7e];o4([be()],b1.prototype,"src",void 0);o4([be()],b1.prototype,"alt",void 0);o4([be()],b1.prototype,"size",void 0);o4([be()],b1.prototype,"objectFit",void 0);b1=o4([ot("wui-image")],b1);const H7e=Mt` 1452 :host { 1453 display: flex; 1454 } 1455 1456 :host([data-size='sm']) > svg { 1457 width: 12px; 1458 height: 12px; 1459 } 1460 1461 :host([data-size='md']) > svg { 1462 width: 16px; 1463 height: 16px; 1464 } 1465 1466 :host([data-size='lg']) > svg { 1467 width: 24px; 1468 height: 24px; 1469 } 1470 1471 :host([data-size='xl']) > svg { 1472 width: 32px; 1473 height: 32px; 1474 } 1475 1476 svg { 1477 animation: rotate 2s linear infinite; 1478 } 1479 1480 circle { 1481 fill: none; 1482 stroke: var(--local-color); 1483 stroke-width: 4px; 1484 stroke-dasharray: 1, 124; 1485 stroke-dashoffset: 0; 1486 stroke-linecap: round; 1487 animation: dash 1.5s ease-in-out infinite; 1488 } 1489 1490 :host([data-size='md']) > svg > circle { 1491 stroke-width: 6px; 1492 } 1493 1494 :host([data-size='sm']) > svg > circle { 1495 stroke-width: 8px; 1496 } 1497 1498 @keyframes rotate { 1499 100% { 1500 transform: rotate(360deg); 1501 } 1502 } 1503 1504 @keyframes dash { 1505 0% { 1506 stroke-dasharray: 1, 124; 1507 stroke-dashoffset: 0; 1508 } 1509 1510 50% { 1511 stroke-dasharray: 90, 124; 1512 stroke-dashoffset: -35; 1513 } 1514 1515 100% { 1516 stroke-dashoffset: -125; 1517 } 1518 } 1519`;var WU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let K_=class extends ut{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: ${this.color==="inherit"?"inherit":`var(--wui-color-${this.color})`}`,this.dataset.size=this.size,le`<svg viewBox="25 25 50 50"> 1520 <circle r="20" cy="50" cx="50"></circle> 1521 </svg>`}};K_.styles=[Dn,H7e];WU([be()],K_.prototype,"color",void 0);WU([be()],K_.prototype,"size",void 0);K_=WU([ot("wui-loading-spinner")],K_);/** 1522 * @license 1523 * Copyright 2017 Google LLC 1524 * SPDX-License-Identifier: BSD-3-Clause 1525 */const ase={ATTRIBUTE:1,CHILD:2},HU=n=>(...e)=>({_$litDirective$:n,values:e});let cse=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** 1526 * @license 1527 * Copyright 2018 Google LLC 1528 * SPDX-License-Identifier: BSD-3-Clause 1529 */const Y_=HU(class extends cse{constructor(n){var e;if(super(n),n.type!==ase.ATTRIBUTE||n.name!=="class"||((e=n.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(e=>n[e]).join(" ")+" "}update(n,[e]){var r,i;
1529if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!((r=this.nt)!=null&&r.has(s))&&this.st.add(s);return this.render(e)}const t=n.element.classList;for(const s of this.st)s in e||(t.remove(s),this.st.delete(s));for(const s in e){const o=!!e[s];o===this.st.has(s)||(i=this.nt)!=null&&i.has(s)||(o?(t.add(s),this.st.add(s)):(t.remove(s),this.st.delete(s)))}return dg}}),V7e=Mt` 1530 :host { 1531 display: inline-flex !important; 1532 } 1533 1534 slot { 1535 width: 100%; 1536 display: inline-block; 1537 font-style: normal; 1538 font-family: var(--wui-font-family); 1539 font-feature-settings: 1540 'tnum' on, 1541 'lnum' on, 1542 'case' on; 1543 line-height: 130%; 1544 font-weight: var(--wui-font-weight-regular); 1545 overflow: inherit; 1546 text-overflow: inherit; 1547 text-align: var(--local-align); 1548 color: var(--local-color); 1549 } 1550 1551 .wui-line-clamp-1 { 1552 overflow: hidden; 1553 display: -webkit-box; 1554 -webkit-box-orient: vertical; 1555 -webkit-line-clamp: 1; 1556 } 1557 1558 .wui-line-clamp-2 { 1559 overflow: hidden; 1560 display: -webkit-box; 1561 -webkit-box-orient: vertical; 1562 -webkit-line-clamp: 2; 1563 } 1564 1565 .wui-font-medium-400 { 1566 font-size: var(--wui-font-size-medium); 1567 font-weight: var(--wui-font-weight-light); 1568 letter-spacing: var(--wui-letter-spacing-medium); 1569 } 1570 1571 .wui-font-medium-600 { 1572 font-size: var(--wui-font-size-medium); 1573 letter-spacing: var(--wui-letter-spacing-medium); 1574 } 1575 1576 .wui-font-title-600 { 1577 font-size: var(--wui-font-size-title); 1578 letter-spacing: var(--wui-letter-spacing-title); 1579 } 1580 1581 .wui-font-title-6-600 { 1582 font-size: var(--wui-font-size-title-6); 1583 letter-spacing: var(--wui-letter-spacing-title-6); 1584 } 1585 1586 .wui-font-mini-700 { 1587 font-size: var(--wui-font-size-mini); 1588 letter-spacing: var(--wui-letter-spacing-mini); 1589 text-transform: uppercase; 1590 } 1591 1592 .wui-font-large-500, 1593 .wui-font-large-600, 1594 .wui-font-large-700 { 1595 font-size: var(--wui-font-size-large); 1596 letter-spacing: var(--wui-letter-spacing-large); 1597 } 1598 1599 .wui-font-2xl-500, 1600 .wui-font-2xl-600, 1601 .wui-font-2xl-700 { 1602 font-size: var(--wui-font-size-2xl); 1603 letter-spacing: var(--wui-letter-spacing-2xl); 1604 } 1605 1606 .wui-font-paragraph-400, 1607 .wui-font-paragraph-500, 1608 .wui-font-paragraph-600, 1609 .wui-font-paragraph-700 { 1610 font-size: var(--wui-font-size-paragraph); 1611 letter-spacing: var(--wui-letter-spacing-paragraph); 1612 } 1613 1614 .wui-font-small-400, 1615 .wui-font-small-500, 1616 .wui-font-small-600 { 1617 font-size: var(--wui-font-size-small); 1618 letter-spacing: var(--wui-letter-spacing-small); 1619 } 1620 1621 .wui-font-tiny-400, 1622 .wui-font-tiny-500, 1623 .wui-font-tiny-600 { 1624 font-size: var(--wui-font-size-tiny); 1625 letter-spacing: var(--wui-letter-spacing-tiny); 1626 } 1627 1628 .wui-font-micro-700, 1629 .wui-font-micro-600, 1630 .wui-font-micro-500 { 1631 font-size: var(--wui-font-size-micro); 1632 letter-spacing: var(--wui-letter-spacing-micro); 1633 text-transform: uppercase; 1634 } 1635 1636 .wui-font-tiny-400, 1637 .wui-font-small-400, 1638 .wui-font-medium-400, 1639 .wui-font-paragraph-400 { 1640 font-weight: var(--wui-font-weight-light); 1641 } 1642 1643 .wui-font-large-700, 1644 .wui-font-paragraph-700, 1645 .wui-font-micro-700, 1646 .wui-font-mini-700 { 1647 font-weight: var(--wui-font-weight-bold); 1648 } 1649 1650 .wui-font-medium-600, 1651 .wui-font-medium-title-600, 1652 .wui-font-title-6-600, 1653 .wui-font-large-600, 1654 .wui-font-paragraph-600, 1655 .wui-font-small-600, 1656 .wui-font-tiny-600, 1657 .wui-font-micro-600 { 1658 font-weight: var(--wui-font-weight-medium); 1659 } 1660 1661 :host([disabled]) { 1662 opacity: 0.4; 1663 } 1664`;var a4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let v1=class extends ut{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left",this.lineClamp=void 0}render(){const e={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}
1664`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=` 1665 --local-align: ${this.align}; 1666 --local-color: var(--wui-color-${this.color}); 1667 `,le`<slot class=${Y_(e)}></slot>`}};v1.styles=[Dn,V7e];a4([be()],v1.prototype,"variant",void 0);a4([be()],v1.prototype,"color",void 0);a4([be()],v1.prototype,"align",void 0);a4([be()],v1.prototype,"lineClamp",void 0);v1=a4([ot("wui-text")],v1);const q7e=Mt` 1668 :host { 1669 display: flex; 1670 width: inherit; 1671 height: inherit; 1672 } 1673`;var lu=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Cc=class extends ut{render(){return this.style.cssText=` 1674 flex-direction: ${this.flexDirection}; 1675 flex-wrap: ${this.flexWrap}; 1676 flex-basis: ${this.flexBasis}; 1677 flex-grow: ${this.flexGrow}; 1678 flex-shrink: ${this.flexShrink}; 1679 align-items: ${this.alignItems}; 1680 justify-content: ${this.justifyContent}; 1681 column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; 1682 row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; 1683 gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; 1684 padding-top: ${this.padding&&zi.getSpacingStyles(this.padding,0)}; 1685 padding-right: ${this.padding&&zi.getSpacingStyles(this.padding,1)}; 1686 padding-bottom: ${this.padding&&zi.getSpacingStyles(this.padding,2)}; 1687 padding-left: ${this.padding&&zi.getSpacingStyles(this.padding,3)}; 1688 margin-top: ${this.margin&&zi.getSpacingStyles(this.margin,0)}; 1689 margin-right: ${this.margin&&zi.getSpacingStyles(this.margin,1)}; 1690 margin-bottom: ${this.margin&&zi.getSpacingStyles(this.margin,2)}; 1691 margin-left: ${this.margin&&zi.getSpacingStyles(this.margin,3)}; 1692 `,le`<slot></slot>`}};Cc.styles=[Dn,q7e];lu([be()],Cc.prototype,"flexDirection",void 0);lu([be()],Cc.prototype,"flexWrap",void 0);lu([be()],Cc.prototype,"flexBasis",void 0);lu([be()],Cc.prototype,"flexGrow",void 0);lu([be()],Cc.prototype,"flexShrink",void 0);lu([be()],Cc.prototype,"alignItems",void 0);lu([be()],Cc.prototype,"justifyContent",void 0);lu([be()],Cc.prototype,"columnGap",void 0);lu([be()],Cc.prototype,"rowGap",void 0);lu([be()],Cc.prototype,"gap",void 0);lu([be()],Cc.prototype,"padding",void 0);lu([be()],Cc.prototype,"margin",void 0);Cc=lu([ot("wui-flex")],Cc);const K7e=Mt` 1693 :host { 1694 display: block; 1695 width: var(--local-width); 1696 height: var(--local-height); 1697 border-radius: var(--wui-border-radius-3xl); 1698 box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); 1699 overflow: hidden; 1700 position: relative; 1701 } 1702 1703 :host([data-variant='generated']) { 1704 --mixed-local-color-1: var(--local-color-1); 1705 --mixed-local-color-2: var(--local-color-2); 1706 --mixed-local-color-3: var(--local-color-3); 1707 --mixed-local-color-4: var(--local-color-4); 1708 --mixed-local-color-5: var(--local-color-5); 1709 } 1710 1711 @supports (background: color-mix(in srgb, white 50%, black)) { 1712 :host([data-variant='generated']) { 1713 --mixed-local-color-1: color-mix( 1714 in srgb, 1715 var(--w3m-color-mix) var(--w3m-color-mix-strength), 1716 var(--local-color-1) 1717 ); 1718 --mixed-local-color-2: color-mix( 1719 in srgb, 1720 var(--w3m-color-mix) var(--w3m-color-mix-strength), 1721 var(--local-color-2) 1722 ); 1723 --mixed-local-color-3: color-mix( 1724 in srgb, 1725 var(--w3m-color-mix) var(--w3m-color-mix-strength), 1726 var(--local-color-3) 1727 ); 1728 --mixed-local-color-4: color-mix( 1729 in srgb, 1730 var(--w3m-color-mix) var(--w3m-color-mix-strength), 1731 var(--local-color-4) 1732 ); 1733 --mixed-local-color-5: color-mix( 1734 in srgb, 1735 var(--w3m-color-mix) var(--w3m-color-mix-strength), 1736 var(--local-color-5) 1737 ); 1738 } 1739 } 1740 1741 :host([data-variant='generated']) { 1742 box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); 1743 background: radial-gradient( 1744 var(--local-radial-circle), 1745 #fff 0.52%, 1746 var(--mixed-local-color-5) 31.25%, 1747 var(--mixed-local-color-3) 51.56%, 1748 var(--mixed-local-color-2) 65.63%, 1749 var(--mixed-local-color-1) 82.29%, 1750 var(--mixed-local-color-4) 100% 1751 ); 1752 } 1753 1754 :host([data-variant='default']) { 1755 box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); 1756 background: radial-gradient( 1757 75.29% 75.29% at 64.96% 24.36%, 1758 #fff 0.52%, 1759 #f5ccfc 31.25%, 1760 #dba4f5 51.56%, 1761 #9a8ee8 65.63%, 1762 #6493da 82.29%, 1763 #6ebdea 100% 1764 ); 1765 } 1766`;var c4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let x1=class extends ut{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){return this.style.cssText=` 1767 --local-width: var(--wui-icon-box-size-${this.size}); 1768 --local-height: var(--wui-icon-box-size-${this.size}); 1769 `,le`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",le`<wui-image src=${this.imageSrc} alt=${this.alt??"avatar"}></wui-image>`;if(this.address){this.dataset.variant="generated";const e=zi.generateAvatarColors(this.address);return this.style.cssText+=` 1770 ${e}`,null}return this.dataset.variant="default",null}};x1.styles=[Dn,K7e];c4([be()],x1.prototype,"imageSrc",void 0);c4([be()],x1.prototype,"alt",void 0);c4([be()],x1.prototype,"address",void 0);c4([be()],x1.prototype,"size",void 0);x1=c4([ot("wui-avatar")],x1);/** 1771 * @license 1772 * Copyright 2020 Google LLC 1773 * SPDX-License-Identifier: BSD-3-Clause 1774 */const Y7e=n=>n===null||typeof n!="object"&&typeof n!="function",G7e=n=>n.strings===void 0;/** 1775 * @license 1776 * Copyright 2017 Google LLC 1777 * SPDX-License-Identifier: BSD-3-Clause 1778 */const DS=(n,e)=>{var r;const t=n._$AN;if(t===void 0)return!1;for(const i of t)(r=i._$AO)==null||r.call(i,e,!1),DS(i,e);return!0},BN=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},lse=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),X7e(e)}};function Z7e(n){this._$AN!==void 0?(BN(this),this._$AM=n,lse(this)):this._$AM=n}function Q7e(n,e=!1,t=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let s=t;s<r.length;s++)DS(r[s],!1),BN(r[s]);else r!=null&&(DS(r,!1),BN(r));else DS(this,n)}const X7e=n=>{n.type==ase.CHILD&&(n._$AP??(n._$AP=Q7e),n._$AQ??(n._$AQ=Z7e))};let use=class extends cse{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),lse(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),t&&(DS(this,e),BN(this))}setValue(e){if(G7e(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};/** 1779 * @license 1780 * Copyright 2021 Google LLC 1781 * SPDX-License-Identifier: BSD-3-Clause 1782 */let J7e=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},eBe=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??(this.Y=new Promise(e=>this.Z=e))}resume(){var e;(e=this.Z)==null||e.call(this),this.Y=this.Z=void 0}};/** 1783 * @license 1784 * Copyright 2017 Google LLC 1785 * SPDX-License-Identifier: BSD-3-Clause 1786 */const kY=n=>!Y7e(n)&&typeof n.then=="function",OY=1073741823;let tBe=class extends use{constructor(){super(...arguments),this._$Cwt=OY,this._$Cbt=[],this._$CK=new J7e(this),this._$CX=new eBe}render(...e){return e.find(t=>!kY(t))??dg}update(e,t){const r=this._$Cbt;let i=r.length;this._$Cbt=t;const s=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let a=0;a<t.length&&!(a>this._$Cwt);a++){const c=t[a];if(!kY(c))return this._$Cwt=a,c;a<i&&c===r[a]||(this._$Cwt=OY,i=0,Promise.resolve(c).then(async u=>{for(;o.get();)await o.get();const d=s.deref();if(d!==void 0){const f=d._$Cbt.indexOf(c);f>-1&&f<d._$Cwt&&(d._$Cwt=f,d.setValue(u))}}))}return dg}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}};const nBe=HU(tBe);class rBe{constructor(){this.cache=new Map}set(e,t){this.cache.set(e,t)}get(e){return this.cache.get(e)}has(e){return this.cache.has(e)}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}}const JP=new rBe,iBe=Mt` 1787 :host { 1788 display: flex; 1789 aspect-ratio: var(--local-aspect-ratio); 1790 color: var(--local-color); 1791 width: var(--local-width); 1792 } 1793 1794 svg { 1795 width: inherit; 1796 height: inherit; 1797 object-fit: contain; 1798 object-position: center; 1799 } 1800 1801 .fallback { 1802 width: var(--local-width); 1803 height: var(--local-height); 1804 } 1805`;var l4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const PY={add:async()=>(await It(async()=>{const{addSvg:n}=await import("./add-CRbhXqSz.js");return{addSvg:n}},[])).addSvg,allWallets:async()=>(await It(async()=>{const{allWalletsSvg:n}=await import("./all-wallets-DBT3zh09.js");return{allWalletsSvg:n}},[])).allWalletsSvg,arrowBottomCircle:async()=>(await It(async()=>{const{arrowBottomCircleSvg:n}=await import("./arrow-bottom-circle-BhYF9lFa.js");return{arrowBottomCircleSvg:n}},[])).arrowBottomCircleSvg,appStore:async()=>(await It(async()=>{const{appStoreSvg:n}
1805=await import("./app-store-BgAzypoX.js");return{appStoreSvg:n}},[])).appStoreSvg,apple:async()=>(await It(async()=>{const{appleSvg:n}=await import("./apple--TkhJQyY.js");return{appleSvg:n}},[])).appleSvg,arrowBottom:async()=>(await It(async()=>{const{arrowBottomSvg:n}=await import("./arrow-bottom-5sgc_Jxn.js");return{arrowBottomSvg:n}},[])).arrowBottomSvg,arrowLeft:async()=>(await It(async()=>{const{arrowLeftSvg:n}=await import("./arrow-left-CujMJAi5.js");return{arrowLeftSvg:n}},[])).arrowLeftSvg,arrowRight:async()=>(await It(async()=>{const{arrowRightSvg:n}=await import("./arrow-right-DqUCE5n1.js");return{arrowRightSvg:n}},[])).arrowRightSvg,arrowTop:async()=>(await It(async()=>{const{arrowTopSvg:n}=await import("./arrow-top-BMTkj2lZ.js");return{arrowTopSvg:n}},[])).arrowTopSvg,bank:async()=>(await It(async()=>{const{bankSvg:n}=await import("./bank-XwyjXIis.js");return{bankSvg:n}},[])).bankSvg,browser:async()=>(await It(async()=>{const{browserSvg:n}=await import("./browser-CIO-P75y.js");return{browserSvg:n}},[])).browserSvg,bin:async()=>(await It(async()=>{const{binSvg:n}=await import("./bin-HnTvZ-Gs.js");return{binSvg:n}},[])).binSvg,bitcoin:async()=>(await It(async()=>{const{bitcoinSvg:n}=await import("./bitcoin-CHTaZJQk.js");return{bitcoinSvg:n}},[])).bitcoinSvg,card:async()=>(await It(async()=>{const{cardSvg:n}=await import("./card-pHx-JSxE.js");return{cardSvg:n}},[])).cardSvg,checkmark:async()=>(await It(async()=>{const{checkmarkSvg:n}=await import("./checkmark-C4Vq2NPk.js");return{checkmarkSvg:n}},[])).checkmarkSvg,checkmarkBold:async()=>(await It(async()=>{const{checkmarkBoldSvg:n}=await import("./checkmark-bold-BRFPTHra.js");return{checkmarkBoldSvg:n}},[])).checkmarkBoldSvg,chevronBottom:async()=>(await It(async()=>{const{chevronBottomSvg:n}=await import("./chevron-bottom-BYjj3txq.js");return{chevronBottomSvg:n}},[])).chevronBottomSvg,chevronLeft:async()=>(await It(async()=>{const{chevronLeftSvg:n}=await import("./chevron-left-B_fdbuF1.js");return{chevronLeftSvg:n}},[])).chevronLeftSvg,chevronRight:async()=>(await It(async()=>{const{chevronRightSvg:n}=await import("./chevron-right-BfHpRkuy.js");return{chevronRightSvg:n}},[])).chevronRightSvg,chevronTop:async()=>(await It(async()=>{const{chevronTopSvg:n}=await import("./chevron-top-BuQWvsbf.js");return{chevronTopSvg:n}},[])).chevronTopSvg,chromeStore:async()=>(await It(async()=>{const{chromeStoreSvg:n}=await import("./chrome-store-BYk4xKbe.js");return{chromeStoreSvg:n}},[])).chromeStoreSvg,clock:async()=>(await It(async()=>{const{clockSvg:n}=await import("./clock-Nx_o5ivR.js");return{clockSvg:n}},[])).clockSvg,close:async()=>(await It(async()=>{const{closeSvg:n}=await import("./close-lsoTrNBd.js");return{closeSvg:n}},[])).closeSvg,compass:async()=>(await It(async()=>{const{compassSvg:n}=await import("./compass-eoRYSn6_.js");return{compassSvg:n}},[])).compassSvg,coinPlaceholder:async()=>(await It(async()=>{const{coinPlaceholderSvg:n}=await import("./coinPlaceholder-BZy-apAG.js");return{coinPlaceholderSvg:n}},[])).coinPlaceholderSvg,copy:async()=>(await It(async()=>{const{copySvg:n}=await import("./copy-C1k4TTpP.js");return{copySvg:n}},[])).copySvg,cursor:async()=>(await It(async()=>{const{cursorSvg:n}=await import("./cursor-BiaKXEby.js");return{cursorSvg:n}},[])).cursorSvg,cursorTransparent:async()=>(await It(async()=>{const{cursorTransparentSvg:n}=await import("./cursor-transparent-DV59dfio.js");return{cursorTransparentSvg:n}},[])).cursorTransparentSvg,circle:async()=>(await It(async()=>{const{circleSvg:n}=await import("./circle-Dj16-RiQ.js");return{circleSvg:n}},[])).circleSvg,desktop:async()=>(await It(async()=>{const{desktopSvg:n}=await import("./desktop-DOGFedT0.js");return{desktopSvg:n}},[])).desktopSvg,disconnect:async()=>(await It(async()=>{const{disconnectSvg:n}=await import("./disconnect-Ca4cld4V.js");return{disconnectSvg:n}},[])).disconnectSvg,discord:async()=>(await It(async()=>{const{discordSvg:n}=await import("./discord-BXY7Iuse.js");return{discordSvg:n}},[])).discordSvg,ethereum:async()=>(await It(async()=>{const{ethereumSvg:n}=await import("./ethereum-ALhHYy5_.js");return{ethereumSvg:n}
1805},[])).ethereumSvg,etherscan:async()=>(await It(async()=>{const{etherscanSvg:n}=await import("./etherscan-CsqGKSX6.js");return{etherscanSvg:n}},[])).etherscanSvg,extension:async()=>(await It(async()=>{const{extensionSvg:n}=await import("./extension-CoKIWLEf.js");return{extensionSvg:n}},[])).extensionSvg,externalLink:async()=>(await It(async()=>{const{externalLinkSvg:n}=await import("./external-link-CTaZIt6T.js");return{externalLinkSvg:n}},[])).externalLinkSvg,facebook:async()=>(await It(async()=>{const{facebookSvg:n}=await import("./facebook-XgSprRKI.js");return{facebookSvg:n}},[])).facebookSvg,farcaster:async()=>(await It(async()=>{const{farcasterSvg:n}=await import("./farcaster-Ctn7YB2O.js");return{farcasterSvg:n}},[])).farcasterSvg,filters:async()=>(await It(async()=>{const{filtersSvg:n}=await import("./filters-BjeqX3ql.js");return{filtersSvg:n}},[])).filtersSvg,github:async()=>(await It(async()=>{const{githubSvg:n}=await import("./github-9OZayCsC.js");return{githubSvg:n}},[])).githubSvg,google:async()=>(await It(async()=>{const{googleSvg:n}=await import("./google-DG14pd6C.js");return{googleSvg:n}},[])).googleSvg,helpCircle:async()=>(await It(async()=>{const{helpCircleSvg:n}=await import("./help-circle-C3kBpP0a.js");return{helpCircleSvg:n}},[])).helpCircleSvg,image:async()=>(await It(async()=>{const{imageSvg:n}=await import("./image-BOU08tNf.js");return{imageSvg:n}},[])).imageSvg,id:async()=>(await It(async()=>{const{idSvg:n}=await import("./id-mlmZoiGA.js");return{idSvg:n}},[])).idSvg,infoCircle:async()=>(await It(async()=>{const{infoCircleSvg:n}=await import("./info-circle-uLVZozpp.js");return{infoCircleSvg:n}},[])).infoCircleSvg,lightbulb:async()=>(await It(async()=>{const{lightbulbSvg:n}=await import("./lightbulb-xH4KWzFd.js");return{lightbulbSvg:n}},[])).lightbulbSvg,mail:async()=>(await It(async()=>{const{mailSvg:n}=await import("./mail-CKisViAX.js");return{mailSvg:n}},[])).mailSvg,mobile:async()=>(await It(async()=>{const{mobileSvg:n}=await import("./mobile-DQ6LTTSH.js");return{mobileSvg:n}},[])).mobileSvg,more:async()=>(await It(async()=>{const{moreSvg:n}=await import("./more-Bhtd0fIl.js");return{moreSvg:n}},[])).moreSvg,networkPlaceholder:async()=>(await It(async()=>{const{networkPlaceholderSvg:n}=await import("./network-placeholder-B2fKZ668.js");return{networkPlaceholderSvg:n}},[])).networkPlaceholderSvg,nftPlaceholder:async()=>(await It(async()=>{const{nftPlaceholderSvg:n}=await import("./nftPlaceholder-9fcyE2bi.js");return{nftPlaceholderSvg:n}},[])).nftPlaceholderSvg,off:async()=>(await It(async()=>{const{offSvg:n}=await import("./off-CIp7kEt7.js");return{offSvg:n}},[])).offSvg,playStore:async()=>(await It(async()=>{const{playStoreSvg:n}=await import("./play-store-CO4E4Kdt.js");return{playStoreSvg:n}},[])).playStoreSvg,plus:async()=>(await It(async()=>{const{plusSvg:n}=await import("./plus-CUFCE9o2.js");return{plusSvg:n}},[])).plusSvg,qrCode:async()=>(await It(async()=>{const{qrCodeIcon:n}=await import("./qr-code-BgoC8zYv.js");return{qrCodeIcon:n}},[])).qrCodeIcon,recycleHorizontal:async()=>(await It(async()=>{const{recycleHorizontalSvg:n}=await import("./recycle-horizontal-DDyPZMmv.js");return{recycleHorizontalSvg:n}},[])).recycleHorizontalSvg,refresh:async()=>(await It(async()=>{const{refreshSvg:n}=await import("./refresh-BUB1NaAL.js");return{refreshSvg:n}},[])).refreshSvg,search:async()=>(await It(async()=>{const{searchSvg:n}=await import("./search-hyMyrKHE.js");return{searchSvg:n}},[])).searchSvg,send:async()=>(await It(async()=>{const{sendSvg:n}=await import("./send-D4Xun-rF.js");return{sendSvg:n}},[])).sendSvg,swapHorizontal:async()=>(await It(async()=>{const{swapHorizontalSvg:n}=await import("./swapHorizontal-CpBc5wvn.js");return{swapHorizontalSvg:n}},[])).swapHorizontalSvg,swapHorizontalMedium:async()=>(await It(async()=>{const{swapHorizontalMediumSvg:n}=await import("./swapHorizontalMedium-CdTrrTNC.js");return{swapHorizontalMediumSvg:n}},[])).swapHorizontalMediumSvg,swapHorizontalBold:async()=>(await It(async()=>{const{swapHorizontalBoldSvg:n}=await import("./swapHorizontalBold-DztZjdOX.js");return{swapHorizontalBoldSvg:n}},[])).swapHorizontalBoldSvg,swapHorizontalRoundedBold:async()=>(await It(async()=>{const{swapHorizontalRoundedBoldSvg:n}
1805=await import("./swapHorizontalRoundedBold-Ca8_C1V4.js");return{swapHorizontalRoundedBoldSvg:n}},[])).swapHorizontalRoundedBoldSvg,swapVertical:async()=>(await It(async()=>{const{swapVerticalSvg:n}=await import("./swapVertical-DanCgWND.js");return{swapVerticalSvg:n}},[])).swapVerticalSvg,solana:async()=>(await It(async()=>{const{solanaSvg:n}=await import("./solana-C7zQ9YBH.js");return{solanaSvg:n}},[])).solanaSvg,telegram:async()=>(await It(async()=>{const{telegramSvg:n}=await import("./telegram-BpIWjFTn.js");return{telegramSvg:n}},[])).telegramSvg,threeDots:async()=>(await It(async()=>{const{threeDotsSvg:n}=await import("./three-dots-CxqOZip0.js");return{threeDotsSvg:n}},[])).threeDotsSvg,twitch:async()=>(await It(async()=>{const{twitchSvg:n}=await import("./twitch-DjUaYPtR.js");return{twitchSvg:n}},[])).twitchSvg,twitter:async()=>(await It(async()=>{const{xSvg:n}=await import("./x-UH2aDHo3.js");return{xSvg:n}},[])).xSvg,twitterIcon:async()=>(await It(async()=>{const{twitterIconSvg:n}=await import("./twitterIcon-DB6wxoki.js");return{twitterIconSvg:n}},[])).twitterIconSvg,user:async()=>(await It(async()=>{const{userSvg:n}=await import("./user-DpUKp5Wp.js");return{userSvg:n}},[])).userSvg,verify:async()=>(await It(async()=>{const{verifySvg:n}=await import("./verify-H5HOsd0d.js");return{verifySvg:n}},[])).verifySvg,verifyFilled:async()=>(await It(async()=>{const{verifyFilledSvg:n}=await import("./verify-filled-O0OrIddB.js");return{verifyFilledSvg:n}},[])).verifyFilledSvg,wallet:async()=>(await It(async()=>{const{walletSvg:n}=await import("./wallet-BoR3v3fM.js");return{walletSvg:n}},[])).walletSvg,walletConnect:async()=>(await It(async()=>{const{walletConnectSvg:n}=await import("./walletconnect-BpdnDD9V.js");return{walletConnectSvg:n}},[])).walletConnectSvg,walletConnectLightBrown:async()=>(await It(async()=>{const{walletConnectLightBrownSvg:n}=await import("./walletconnect-BpdnDD9V.js");return{walletConnectLightBrownSvg:n}},[])).walletConnectLightBrownSvg,walletConnectBrown:async()=>(await It(async()=>{const{walletConnectBrownSvg:n}=await import("./walletconnect-BpdnDD9V.js");return{walletConnectBrownSvg:n}},[])).walletConnectBrownSvg,walletPlaceholder:async()=>(await It(async()=>{const{walletPlaceholderSvg:n}=await import("./wallet-placeholder-D1lbLj9K.js");return{walletPlaceholderSvg:n}},[])).walletPlaceholderSvg,warningCircle:async()=>(await It(async()=>{const{warningCircleSvg:n}=await import("./warning-circle-Pk963QJB.js");return{warningCircleSvg:n}},[])).warningCircleSvg,x:async()=>(await It(async()=>{const{xSvg:n}=await import("./x-UH2aDHo3.js");return{xSvg:n}},[])).xSvg,info:async()=>(await It(async()=>{const{infoSvg:n}=await import("./info-C8t4TLGr.js");return{infoSvg:n}},[])).infoSvg,exclamationTriangle:async()=>(await It(async()=>{const{exclamationTriangleSvg:n}=await import("./exclamation-triangle-BKSwe-Ti.js");return{exclamationTriangleSvg:n}},[])).exclamationTriangleSvg,reown:async()=>(await It(async()=>{const{reownSvg:n}=await import("./reown-logo-DOEbmcm_.js");return{reownSvg:n}},[])).reownSvg,"x-mark":async()=>(await It(async()=>{const{xMarkSvg:n}=await import("./x-mark-BTll8S4H.js");return{xMarkSvg:n}},[])).xMarkSvg};async function sBe(n){if(JP.has(n))return JP.get(n);const t=(PY[n]??PY.copy)();return JP.set(n,t),t}let E1=class extends ut{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300",this.aspectRatio="1 / 1"}render(){return this.style.cssText=` 1806 --local-color: ${`var(--wui-color-${this.color});`} 1807 --local-width: ${`var(--wui-icon-size-${this.size});`} 1808 --local-aspect-ratio: ${this.aspectRatio} 1809 `,le`${nBe(sBe(this.name),le`<div class="fallback"></div>`)}`}};E1.styles=[Dn,J8,iBe];l4([be()],E1.prototype,"size",void 0);l4([be()],E1.prototype,"name",void 0);l4([be()],E1.prototype,"color",void 0);l4([be()],E1.prototype,"aspectRatio",void 0);E1=l4([ot("wui-icon")],E1);const oBe=Mt` 1810 :host { 1811 display: inline-flex; 1812 justify-content: center; 1813 align-items: center; 1814 position: relative; 1815 overflow: hidden; 1816 background-color: var(--wui-color-gray-glass-020); 1817 border-radius: var(--local-border-radius); 1818 border: var(--local-border); 1819 box-sizing: content-box; 1820 width: var(--local-size); 1821 height: var(--local-size); 1822 min-height: var(--local-size); 1823 min-width: var(--local-size); 1824 } 1825 1826 @supports (background: color-mix(in srgb, white 50%, black)) { 1827 :host { 1828 background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent); 1829 } 1830 } 1831`;var Cg=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let ah=class extends ut{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){const e=this.iconSize||this.size,t=this.size==="lg",r=this.size==="xl",i=t?"12%":"16%",s=t?"xxs":r?"s":"3xl",o=this.background==="gray",a=this.background==="opaque",c=this.backgroundColor==="accent-100"&&a||this.backgroundColor==="success-100"&&a||this.backgroundColor==="error-100"&&a||this.backgroundColor==="inverse-100"&&a;let u=`var(--wui-color-${this.backgroundColor})`;return c?u=`var(--wui-icon-box-bg-${this.backgroundColor})`:o&&(u=`var(--wui-color-gray-${this.backgroundColor})`),this.style.cssText=` 1832 --local-bg-value: ${u}; 1833 --local-bg-mix: ${c||o?"100%":i}; 1834 --local-border-radius: var(--wui-border-radius-${s}); 1835 --local-size: var(--wui-icon-box-size-${this.size}); 1836 --local-border: ${this.borderColor==="wui-color-bg-125"?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"} 1837 `,le` <wui-icon color=${this.iconColor} size=${e} name=${this.icon}></wui-icon> `}};ah.styles=[Dn,Jr,oBe];Cg([be()],ah.prototype,"size",void 0);Cg([be()],ah.prototype,"backgroundColor",void 0);Cg([be()],ah.prototype,"iconColor",void 0);Cg([be()],ah.prototype,"iconSize",void 0);Cg([be()],ah.prototype,"background",void 0);Cg([be({type:Boolean})],ah.prototype,"border",void 0);Cg([be()],ah.prototype,"borderColor",void 0);Cg([be()],ah.prototype,"icon",void 0);ah=Cg([ot("wui-icon-box")],ah);const aBe=Mt` 1838 :host { 1839 display: block; 1840 } 1841 1842 button { 1843 border-radius: var(--wui-border-radius-3xl); 1844 background: var(--wui-color-gray-glass-002); 1845 display: flex; 1846 gap: var(--wui-spacing-xs); 1847 padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs) 1848 var(--wui-spacing-xs); 1849 border: 1px solid var(--wui-color-gray-glass-005); 1850 } 1851 1852 button:disabled { 1853 background: var(--wui-color-gray-glass-015); 1854 } 1855 1856 button:disabled > wui-text { 1857 color: var(--wui-color-gray-glass-015); 1858 } 1859 1860 button:disabled > wui-flex > wui-text { 1861 color: var(--wui-color-gray-glass-015); 1862 } 1863 1864 button:disabled > wui-image, 1865 button:disabled > wui-flex > wui-avatar { 1866 filter: grayscale(1); 1867 } 1868 1869 button:has(wui-image) { 1870 padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs) 1871 var(--wui-spacing-xs); 1872 } 1873 1874 wui-text { 1875 color: var(--wui-color-fg-100); 1876 } 1877 1878 wui-flex > wui-text { 1879 color: var(--wui-color-fg-200); 1880 } 1881 1882 wui-image, 1883 wui-icon-box { 1884 border-radius: var(--wui-border-radius-3xl); 1885 width: 24px; 1886 height: 24px; 1887 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 1888 } 1889 1890 wui-flex { 1891 border-radius: var(--wui-border-radius-3xl); 1892 border: 1px solid var(--wui-color-gray-glass-005); 1893 background: var(--wui-color-gray-glass-005); 1894 padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs); 1895 } 1896 1897 button.local-no-balance { 1898 border-radius: 0px; 1899 border: none; 1900 background: transparent; 1901 } 1902 1903 wui-avatar {
1904 width: 20px; 1905 height: 20px; 1906 box-shadow: 0 0 0 2px var(--wui-color-accent-glass-010); 1907 } 1908 1909 @media (max-width: 500px) { 1910 button { 1911 gap: 0px; 1912 padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important; 1913 height: 32px; 1914 } 1915 wui-image, 1916 wui-icon-box, 1917 button > wui-text { 1918 visibility: hidden; 1919 width: 0px; 1920 height: 0px; 1921 } 1922 button { 1923 border-radius: 0px; 1924 border: none; 1925 background: transparent; 1926 padding: 0px; 1927 } 1928 } 1929 1930 @media (hover: hover) and (pointer: fine) { 1931 button:hover:enabled > wui-flex > wui-text { 1932 color: var(--wui-color-fg-175); 1933 } 1934 1935 button:active:enabled > wui-flex > wui-text { 1936 color: var(--wui-color-fg-175); 1937 } 1938 } 1939`;var ph=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let iu=class extends ut{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.loading=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return le` 1940 <button 1941 ?disabled=${this.disabled} 1942 class=${Nt(this.balance?void 0:"local-no-balance")} 1943 > 1944 ${this.balanceTemplate()} 1945 <wui-flex gap="xxs" alignItems="center"> 1946 <wui-avatar 1947 .imageSrc=${this.avatarSrc} 1948 alt=${this.address} 1949 address=${this.address} 1950 ></wui-avatar> 1951 <wui-text variant="paragraph-600" color="inherit"> 1952 ${this.address?zi.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null} 1953 </wui-text> 1954 </wui-flex> 1955 </button> 1956 `}balanceTemplate(){if(this.isUnsupportedChain)return le` <wui-icon-box 1957 size="sm" 1958 iconColor="error-100" 1959 backgroundColor="error-100" 1960 icon="warningCircle" 1961 data-testid="wui-account-button-unsupported-chain" 1962 ></wui-icon-box> 1963 <wui-text variant="paragraph-600" color="inherit"> Switch Network</wui-text>`;if(this.balance){const e=this.networkSrc?le`<wui-image src=${this.networkSrc}></wui-image>`:le` 1964 <wui-icon-box 1965 size="sm" 1966 iconColor="fg-200" 1967 backgroundColor="fg-300" 1968 icon="networkPlaceholder" 1969 ></wui-icon-box> 1970 `,t=this.loading?le`<wui-loading-spinner size="md" color="fg-200"></wui-loading-spinner>`:le`<wui-text variant="paragraph-600" color="inherit"> ${this.balance}</wui-text>`;return le`${e} ${t}`}return null}};iu.styles=[Dn,Jr,aBe];ph([be()],iu.prototype,"networkSrc",void 0);ph([be()],iu.prototype,"avatarSrc",void 0);ph([be()],iu.prototype,"balance",void 0);ph([be({type:Boolean})],iu.prototype,"isUnsupportedChain",void 0);ph([be({type:Boolean})],iu.prototype,"disabled",void 0);ph([be({type:Boolean})],iu.prototype,"loading",void 0);ph([be()],iu.prototype,"address",void 0);ph([be()],iu.prototype,"profileName",void 0);ph([be()],iu.prototype,"charsStart",void 0);ph([be()],iu.prototype,"charsEnd",void 0);iu=ph([ot("wui-account-button")],iu);var Ic=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Nc extends ut{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.namespace=void 0,this.isSupported=Ue.state.allowUnsupportedChain?!0:ue.state.activeChain?ue.checkIfSupportedNetwork(ue.state.activeChain):!0}connectedCallback(){super.connectedCallback(),this.setAccountData(ue.getAccountData(this.namespace)),this.setNetworkData(ue.getNetworkData(this.namespace))}firstUpdated(){const e=this.namespace;e?this.unsubscribe.push(ue.subscribeChainProp("accountState",t=>{this.setAccountData(t)},e),ue.subscribeChainProp("networkState",t=>{var r;this.setNetworkData(t),this.isSupported=ue.checkIfSupportedNetwork(e,(r=t==null?void 0:t.caipNetwork)==null?void 0:r.caipNetworkId)},e)):this.unsubscribe.push(bo.subscribeNetworkImages(()=>{this.networkImage=Hr.getNetworkImage(this.network)}),ue.subscribeKey("activeCaipAddress",t=>{this.caipAddress=t}),_t.subscribeKey("balance",t=>this.balanceVal=t),_t.subscribeKey("balanceSymbol",t=>this.balanceSymbol=t),_t.subscribeKey("profileName",t=>this.profileName=t),_t.subscribeKey("profileImage",t=>this.profileImage=t),ue.subscribeKey("activeCaipNetwork",t=>{this.network=t,this.networkImage=Hr.getNetworkImage(t),this.isSupported=t!=null&&t.chainNamespace?ue.checkIfSupportedNetwork(t==null?void 0:t.chainNamespace):!0,this.fetchNetworkImage(t)}))}updated(){this.fetchNetworkImage(this.network)}
1970disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!ue.state.activeChain)return null;const e=this.balance==="show",t=typeof this.balanceVal!="string";return le` 1971 <wui-account-button 1972 .disabled=${!!this.disabled} 1973 .isUnsupportedChain=${Ue.state.allowUnsupportedChain?!1:!this.isSupported} 1974 address=${Nt(tt.getPlainAddress(this.caipAddress))} 1975 profileName=${Nt(this.profileName)} 1976 networkSrc=${Nt(this.networkImage)} 1977 avatarSrc=${Nt(this.profileImage)} 1978 balance=${e?tt.formatBalance(this.balanceVal,this.balanceSymbol):""} 1979 @click=${this.onClick.bind(this)} 1980 data-testid=${`account-button${this.namespace?`-${this.namespace}`:""}`} 1981 .charsStart=${this.charsStart} 1982 .charsEnd=${this.charsEnd} 1983 ?loading=${t} 1984 > 1985 </wui-account-button> 1986 `}onClick(){this.isSupported||Ue.state.allowUnsupportedChain?Yn.open({namespace:this.namespace}):Yn.open({view:"UnsupportedChain"})}async fetchNetworkImage(e){var t,r;(t=e==null?void 0:e.assets)!=null&&t.imageId&&(this.networkImage=await Hr.fetchNetworkImage((r=e==null?void 0:e.assets)==null?void 0:r.imageId))}setAccountData(e){e&&(this.caipAddress=e.caipAddress,this.balanceVal=e.balance,this.balanceSymbol=e.balanceSymbol,this.profileName=e.profileName,this.profileImage=e.profileImage)}setNetworkData(e){e&&(this.network=e.caipNetwork,this.networkImage=Hr.getNetworkImage(e.caipNetwork))}}Ic([be({type:Boolean})],Nc.prototype,"disabled",void 0);Ic([be()],Nc.prototype,"balance",void 0);Ic([be()],Nc.prototype,"charsStart",void 0);Ic([be()],Nc.prototype,"charsEnd",void 0);Ic([be()],Nc.prototype,"namespace",void 0);Ic([qe()],Nc.prototype,"caipAddress",void 0);Ic([qe()],Nc.prototype,"balanceVal",void 0);Ic([qe()],Nc.prototype,"balanceSymbol",void 0);Ic([qe()],Nc.prototype,"profileName",void 0);Ic([qe()],Nc.prototype,"profileImage",void 0);Ic([qe()],Nc.prototype,"network",void 0);Ic([qe()],Nc.prototype,"networkImage",void 0);Ic([qe()],Nc.prototype,"isSupported",void 0);let _B=class extends Nc{};_B=Ic([ot("w3m-account-button")],_B);let LN=class extends Nc{};LN=Ic([ot("appkit-account-button")],LN);const cBe=Mt` 1987 :host { 1988 display: block; 1989 width: max-content; 1990 } 1991`;var gh=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class ed extends ut{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.namespace=void 0}connectedCallback(){var e,t;super.connectedCallback(),this.caipAddress=this.namespace?(t=(e=ue.state.chains.get(this.namespace))==null?void 0:e.accountState)==null?void 0:t.caipAddress:ue.state.activeCaipAddress}firstUpdated(){this.namespace?this.unsubscribe.push(ue.subscribeChainProp("accountState",e=>{this.caipAddress=e==null?void 0:e.caipAddress},this.namespace)):this.unsubscribe.push(ue.subscribeKey("activeCaipAddress",e=>this.caipAddress=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress?le` 1992 <appkit-account-button 1993 .disabled=${!!this.disabled} 1994 balance=${Nt(this.balance)} 1995 .charsStart=${Nt(this.charsStart)} 1996 .charsEnd=${Nt(this.charsEnd)} 1997 namespace=${Nt(this.namespace)} 1998 > 1999 </appkit-account-button> 2000 `:le` 2001 <appkit-connect-button 2002 size=${Nt(this.size)} 2003 label=${Nt(this.label)} 2004 loadingLabel=${Nt(this.loadingLabel)} 2005 namespace=${Nt(this.namespace)} 2006 ></appkit-connect-button> 2007 `}}ed.styles=cBe;gh([be({type:Boolean})],ed.prototype,"disabled",void 0);gh([be()],ed.prototype,"balance",void 0);gh([be()],ed.prototype,"size",void 0);gh([be()],ed.prototype,"label",void 0);gh([be()],ed.prototype,"loadingLabel",void 0);gh([be()],ed.prototype,"charsStart",void 0);gh([be()],ed.prototype,"charsEnd",void 0);gh([be()],ed.prototype,"namespace",void 0);gh([qe()],ed.prototype,"caipAddress",void 0);let CB=class extends ed{};
2007CB=gh([ot("w3m-button")],CB);let $N=class extends ed{};$N=gh([ot("appkit-button")],$N);const lBe=Mt` 2008 :host { 2009 position: relative; 2010 display: block; 2011 } 2012 2013 button { 2014 background: var(--wui-color-accent-100); 2015 border: 1px solid var(--wui-color-gray-glass-010); 2016 border-radius: var(--wui-border-radius-m); 2017 gap: var(--wui-spacing-xs); 2018 } 2019 2020 button.loading { 2021 background: var(--wui-color-gray-glass-010); 2022 border: 1px solid var(--wui-color-gray-glass-010); 2023 pointer-events: none; 2024 } 2025 2026 button:disabled { 2027 background-color: var(--wui-color-gray-glass-015); 2028 border: 1px solid var(--wui-color-gray-glass-010); 2029 } 2030 2031 button:disabled > wui-text { 2032 color: var(--wui-color-gray-glass-015); 2033 } 2034 2035 @media (hover: hover) and (pointer: fine) { 2036 button:hover:enabled { 2037 background-color: var(--wui-color-accent-090); 2038 } 2039 2040 button:active:enabled { 2041 background-color: var(--wui-color-accent-080); 2042 } 2043 } 2044 2045 button:focus-visible { 2046 border: 1px solid var(--wui-color-gray-glass-010); 2047 background-color: var(--wui-color-accent-090); 2048 -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); 2049 -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); 2050 box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); 2051 } 2052 2053 button[data-size='sm'] { 2054 padding: 6.75px 10px 7.25px; 2055 } 2056 2057 ::slotted(*) { 2058 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 2059 will-change: opacity; 2060 opacity: var(--local-opacity-100); 2061 } 2062 2063 button > wui-text { 2064 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 2065 will-change: opacity; 2066 opacity: var(--local-opacity-100); 2067 color: var(--wui-color-inverse-100); 2068 } 2069 2070 button[data-size='md'] { 2071 padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l); 2072 } 2073 2074 button[data-size='md'] + wui-text { 2075 padding-left: var(--wui-spacing-3xs); 2076 } 2077 2078 @media (max-width: 500px) { 2079 button[data-size='md'] { 2080 height: 32px; 2081 padding: 5px 12px; 2082 } 2083 2084 button[data-size='md'] > wui-text > slot { 2085 font-size: 14px !important; 2086 } 2087 } 2088 2089 wui-loading-spinner { 2090 width: 14px; 2091 height: 14px; 2092 } 2093 2094 wui-loading-spinner::slotted(svg) { 2095 width: 10px !important; 2096 height: 10px !important; 2097 } 2098 2099 button[data-size='sm'] > wui-loading-spinner { 2100 width: 12px; 2101 height: 12px; 2102 } 2103`;var VU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let G_=class extends ut{constructor(){super(...arguments),this.size="md",this.loading=!1}render(){const e=this.size==="md"?"paragraph-600":"small-600";return le` 2104 <button data-size=${this.size} ?disabled=${this.loading}> 2105 ${this.loadingTemplate()} 2106 <wui-text variant=${e} color=${this.loading?"accent-100":"inherit"}> 2107 <slot></slot> 2108 </wui-text> 2109 </button> 2110 `}loadingTemplate(){return this.loading?le`<wui-loading-spinner size=${this.size} color="accent-100"></wui-loading-spinner>`:null}};G_.styles=[Dn,Jr,lBe];VU([be()],G_.prototype,"size",void 0);VU([be({type:Boolean})],G_.prototype,"loading",void 0);G_=VU([ot("wui-connect-button")],G_);var k0=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class O0 extends ut{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=Yn.state.open,this.loading=this.namespace?Yn.state.loadingNamespaceMap.get(this.namespace):Yn.state.loading,this.unsubscribe.push(Yn.subscribe(e=>{this.open=e.open,this.loading=this.namespace?e.loadingNamespaceMap.get(this.namespace):e.loading}))}
2110disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return le` 2111 <wui-connect-button 2112 size=${Nt(this.size)} 2113 .loading=${this.loading} 2114 @click=${this.onClick.bind(this)} 2115 data-testid=${`connect-button${this.namespace?`-${this.namespace}`:""}`} 2116 > 2117 ${this.loading?this.loadingLabel:this.label} 2118 </wui-connect-button> 2119 `}onClick(){this.open?Yn.close():this.loading||Yn.open({view:"Connect",namespace:this.namespace})}}k0([be()],O0.prototype,"size",void 0);k0([be()],O0.prototype,"label",void 0);k0([be()],O0.prototype,"loadingLabel",void 0);k0([be()],O0.prototype,"namespace",void 0);k0([qe()],O0.prototype,"open",void 0);k0([qe()],O0.prototype,"loading",void 0);let TB=class extends O0{};TB=k0([ot("w3m-connect-button")],TB);let UN=class extends O0{};UN=k0([ot("appkit-connect-button")],UN);const uBe=Mt` 2120 :host { 2121 display: block; 2122 } 2123 2124 button { 2125 border-radius: var(--wui-border-radius-3xl); 2126 display: flex; 2127 gap: var(--wui-spacing-xs); 2128 padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs) 2129 var(--wui-spacing-xs); 2130 border: 1px solid var(--wui-color-gray-glass-010); 2131 background-color: var(--wui-color-gray-glass-005); 2132 color: var(--wui-color-fg-100); 2133 } 2134 2135 button:disabled { 2136 border: 1px solid var(--wui-color-gray-glass-005); 2137 background-color: var(--wui-color-gray-glass-015); 2138 color: var(--wui-color-gray-glass-015); 2139 } 2140 2141 @media (hover: hover) and (pointer: fine) { 2142 button:hover:enabled { 2143 background-color: var(--wui-color-gray-glass-010); 2144 } 2145 2146 button:active:enabled { 2147 background-color: var(--wui-color-gray-glass-015); 2148 } 2149 } 2150 2151 wui-image, 2152 wui-icon-box { 2153 border-radius: var(--wui-border-radius-3xl); 2154 width: 24px; 2155 height: 24px; 2156 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 2157 } 2158`;var CR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Cx=class extends ut{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return le` 2159 <button data-testid="wui-network-button" ?disabled=${this.disabled}> 2160 ${this.visualTemplate()} 2161 <wui-text variant="paragraph-600" color="inherit"> 2162 <slot></slot> 2163 </wui-text> 2164 </button> 2165 `}visualTemplate(){return this.isUnsupportedChain?le` 2166 <wui-icon-box 2167 size="sm" 2168 iconColor="error-100" 2169 backgroundColor="error-100" 2170 icon="warningCircle" 2171 ></wui-icon-box> 2172 `:this.imageSrc?le`<wui-image src=${this.imageSrc}></wui-image>`:le` 2173 <wui-icon-box 2174 size="sm" 2175 iconColor="inverse-100" 2176 backgroundColor="fg-100" 2177 icon="networkPlaceholder" 2178 ></wui-icon-box> 2179 `}};Cx.styles=[Dn,Jr,uBe];CR([be()],Cx.prototype,"imageSrc",void 0);CR([be({type:Boolean})],Cx.prototype,"isUnsupportedChain",void 0);CR([be({type:Boolean})],Cx.prototype,"disabled",void 0);Cx=CR([ot("wui-network-button")],Cx);const dBe=Mt` 2180 :host { 2181 display: block; 2182 width: max-content; 2183 } 2184`;var Tg=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Yf extends ut{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=ue.state.activeCaipNetwork,this.networkImage=Hr.getNetworkImage(this.network),this.caipAddress=ue.state.activeCaipAddress,this.loading=Yn.state.loading,this.isSupported=Ue.state.allowUnsupportedChain?!0:ue.state.activeChain?ue.checkIfSupportedNetwork(ue.state.activeChain):!0,this.unsubscribe.push(bo.subscribeNetworkImages(()=>{this.networkImage=Hr.getNetworkImage(this.network)}),ue.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),ue.subscribeKey("activeCaipNetwork",e=>{var t;this.network=e,this.networkImage=Hr.getNetworkImage(e),this.isSupported=e!=null&&e.chainNamespace?ue.checkIfSupportedNetwork(e.chainNamespace):!0,Hr.fetchNetworkImage((t=e==null?void 0:e.assets)==null?void 0:t.imageId)}),Yn.subscribeKey("loading",e=>this.loading=e))}firstUpdated(){var e,t;Hr.fetchNetworkImage((t=(e=this.network)==null?void 0:e.assets)==null?void 0:t.imageId)}
2184disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.network?ue.checkIfSupportedNetwork(this.network.chainNamespace):!0;return le` 2185 <wui-network-button 2186 .disabled=${!!(this.disabled||this.loading)} 2187 .isUnsupportedChain=${Ue.state.allowUnsupportedChain?!1:!e} 2188 imageSrc=${Nt(this.networkImage)} 2189 @click=${this.onClick.bind(this)} 2190 data-testid="w3m-network-button" 2191 > 2192 ${this.getLabel()} 2193 <slot></slot> 2194 </wui-network-button> 2195 `}getLabel(){return this.network?!this.isSupported&&!Ue.state.allowUnsupportedChain?"Switch Network":this.network.name:this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(xn.sendEvent({type:"track",event:"CLICK_NETWORKS"}),Yn.open({view:"Networks"}))}}Yf.styles=dBe;Tg([be({type:Boolean})],Yf.prototype,"disabled",void 0);Tg([be({type:String})],Yf.prototype,"label",void 0);Tg([qe()],Yf.prototype,"network",void 0);Tg([qe()],Yf.prototype,"networkImage",void 0);Tg([qe()],Yf.prototype,"caipAddress",void 0);Tg([qe()],Yf.prototype,"loading",void 0);Tg([qe()],Yf.prototype,"isSupported",void 0);let IB=class extends Yf{};IB=Tg([ot("w3m-network-button")],IB);let jN=class extends Yf{};jN=Tg([ot("appkit-network-button")],jN);const hBe=Mt` 2196 :host { 2197 --prev-height: 0px; 2198 --new-height: 0px; 2199 display: block; 2200 } 2201 2202 div.w3m-router-container { 2203 transform: translateY(0); 2204 opacity: 1; 2205 } 2206 2207 div.w3m-router-container[view-direction='prev'] { 2208 animation: 2209 slide-left-out 150ms forwards ease, 2210 slide-left-in 150ms forwards ease; 2211 animation-delay: 0ms, 200ms; 2212 } 2213 2214 div.w3m-router-container[view-direction='next'] { 2215 animation: 2216 slide-right-out 150ms forwards ease, 2217 slide-right-in 150ms forwards ease; 2218 animation-delay: 0ms, 200ms; 2219 } 2220 2221 @keyframes slide-left-out { 2222 from { 2223 transform: translateX(0px); 2224 opacity: 1; 2225 } 2226 to { 2227 transform: translateX(10px); 2228 opacity: 0; 2229 } 2230 } 2231 2232 @keyframes slide-left-in { 2233 from { 2234 transform: translateX(-10px); 2235 opacity: 0; 2236 } 2237 to { 2238 transform: translateX(0); 2239 opacity: 1; 2240 } 2241 } 2242 2243 @keyframes slide-right-out { 2244 from { 2245 transform: translateX(0px); 2246 opacity: 1; 2247 } 2248 to { 2249 transform: translateX(-10px); 2250 opacity: 0; 2251 } 2252 } 2253 2254 @keyframes slide-right-in { 2255 from { 2256 transform: translateX(10px); 2257 opacity: 0; 2258 } 2259 to { 2260 transform: translateX(0); 2261 opacity: 1; 2262 } 2263 } 2264`;var qU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Tx=class extends ut{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=it.state.view,this.viewDirection="",this.unsubscribe.push(it.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){var e;this.resizeObserver=new ResizeObserver(([t])=>{const r=`${t==null?void 0:t.contentRect.height}px`;this.prevHeight!=="0px"&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",r),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=r,this.style.animation="unset"},Ry.ANIMATION_DURATIONS.ModalHeight)}),(e=this.resizeObserver)==null||e.observe(this.getWrapper())}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.unobserve(this.getWrapper()),this.unsubscribe.forEach(t=>t())}render(){return le`<div class="w3m-router-container" view-direction="${this.viewDirection}"> 2265 ${this.viewTemplate()} 2266 </div>`}viewTemplate(){switch(this.view){case"AccountSettings":return le`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return le`<w3m-account-view></w3m-account-view>`;case"AllWallets":return le`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return le`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return le`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return le`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return le`<w3m-connect-view></w3m-connect-view>`;case"Create":return le`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return le`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return le`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;
2266case"ConnectingExternal":return le`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return le`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return le`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return le`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return le`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return le`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return le`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return le`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return le`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return le`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return le`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return le`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return le`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return le`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return le`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return le`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return le`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return le`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return le`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return le`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return le`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return le`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return le`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return le`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return le`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return le`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return le`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return le`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return le`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return le`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WhatIsABuy":return le`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return le`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return le`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return le`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return le`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return le`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return le`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return le`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return le`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return le`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return le`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return le`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return le`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return le`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return le`<w3m-pay-loading-view></w3m-pay-loading-view>`;default:return le`<w3m-connect-view></w3m-connect-view>`}}onViewChange(e){Vl.hide();let t=Ry.VIEW_DIRECTION.Next;const{history:r}=it.state;r.length<this.prevHistoryLength&&(t=Ry.VIEW_DIRECTION.Prev),this.prevHistoryLength=r.length,this.viewDirection=t,setTimeout(()=>{this.view=e},Ry.ANIMATION_DURATIONS.ViewTransition)}getWrapper(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("div")}};Tx.styles=hBe;qU([qe()],Tx.prototype,"view",void 0);qU([qe()],Tx.prototype,"viewDirection",void 0);Tx=qU([ot("w3m-router")],Tx);const fBe=Mt` 2267 button { 2268 border-radius: var(--local-border-radius); 2269 color: var(--wui-color-fg-100); 2270 padding: var(--local-padding); 2271 } 2272 2273 @media (max-width: 700px) { 2274 :host(:not([size='sm'])) button { 2275 padding: var(--wui-spacing-s); 2276 } 2277 } 2278 2279 button > wui-icon { 2280 pointer-events: none; 2281 } 2282 2283 button:disabled > wui-icon { 2284 color: var(--wui-color-bg-300) !important; 2285 } 2286 2287 button:disabled { 2288 background-color: transparent; 2289 } 2290`;var u4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let A1=class extends ut{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){this.dataset.size=this.size;let e="",t="";switch(this.size){case"lg":e="--wui-border-radius-xs",t="--wui-spacing-1xs";break;case"sm":e="--wui-border-radius-3xs",t="--wui-spacing-xxs";break;default:e="--wui-border-radius-xxs",t="--wui-spacing-2xs";break}return this.style.cssText=` 2291 --local-border-radius: var(${e}); 2292 --local-padding: var(${t}); 2293 `,le` 2294 <button ?disabled=${this.disabled}> 2295 <wui-icon color=${this.iconColor} size=${this.size} name=${this.icon}></wui-icon> 2296 </button> 2297 `}};A1.styles=[Dn,Jr,J8,fBe];u4([be()],A1.prototype,"size",void 0);u4([be({type:Boolean})],A1.prototype,"disabled",void 0);u4([be()],A1.prototype,"icon",void 0);u4([be()],A1.prototype,"iconColor",void 0);A1=u4([ot("wui-icon-link")],A1);const pBe=Mt` 2298 button { 2299 column-gap: var(--wui-spacing-s); 2300 padding: 11px 18px 11px var(--wui-spacing-s); 2301 width: 100%; 2302 background-color: var(--wui-color-gray-glass-002); 2303 border-radius: var(--wui-border-radius-xs); 2304 color: var(--wui-color-fg-250); 2305 transition: 2306 color var(--wui-ease-out-power-1) var(--wui-duration-md), 2307 background-color var(--wui-ease-out-power-1) var(--wui-duration-md); 2308 will-change: color, background-color; 2309 } 2310 2311 button[data-iconvariant='square'], 2312 button[data-iconvariant='square-blue'] { 2313 padding: 6px 18px 6px 9px; 2314 } 2315 2316 button > wui-flex { 2317 flex: 1; 2318 } 2319 2320 button > wui-image { 2321 width: 32px; 2322 height: 32px; 2323 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 2324 border-radius: var(--wui-border-radius-3xl); 2325 } 2326 2327 button > wui-icon { 2328 width: 36px; 2329 height: 36px; 2330 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 2331 will-change: opacity; 2332 } 2333 2334 button > wui-icon-box[data-variant='blue'] { 2335 box-shadow: 0 0 0 2px var(--wui-color-accent-glass-005); 2336 } 2337 2338 button > wui-icon-box[data-variant='overlay'] { 2339 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 2340 } 2341 2342 button > wui-icon-box[data-variant='square-blue'] { 2343 border-radius: var(--wui-border-radius-3xs); 2344 position: relative; 2345 border: none; 2346 width: 36px; 2347 height: 36px; 2348 } 2349 2350 button > wui-icon-box[data-variant='square-blue']::after { 2351 content: ''; 2352 position: absolute; 2353 top: 0; 2354 bottom: 0; 2355 left: 0; 2356 right: 0; 2357 border-radius: inherit; 2358 border: 1px solid var(--wui-color-accent-glass-010); 2359 pointer-events: none; 2360 } 2361 2362 button > wui-icon:last-child { 2363 width: 14px; 2364 height: 14px; 2365 } 2366 2367 button:disabled { 2368 color: var(--wui-color-gray-glass-020); 2369 } 2370 2371 button[data-loading='true'] > wui-icon { 2372 opacity: 0; 2373 } 2374 2375 wui-loading-spinner { 2376 position: absolute; 2377 right: 18px; 2378 top: 50%; 2379 transform: translateY(-50%); 2380 } 2381`;var mh=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let su=class extends ut{constructor(){super(...arguments),this.tabIdx=void 0,this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return le` 2382 <button 2383 ?disabled=${this.loading?!0:!!this.disabled} 2384 data-loading=${this.loading}
2385 data-iconvariant=${Nt(this.iconVariant)} 2386 tabindex=${Nt(this.tabIdx)} 2387 > 2388 ${this.loadingTemplate()} ${this.visualTemplate()} 2389 <wui-flex gap="3xs"> 2390 <slot></slot> 2391 </wui-flex> 2392 ${this.chevronTemplate()} 2393 </button> 2394 `}visualTemplate(){if(this.variant==="image"&&this.imageSrc)return le`<wui-image src=${this.imageSrc} alt=${this.alt??"list item"}></wui-image>`;if(this.iconVariant==="square"&&this.icon&&this.variant==="icon")return le`<wui-icon name=${this.icon}></wui-icon>`;if(this.variant==="icon"&&this.icon&&this.iconVariant){const e=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",t=this.iconVariant==="square-blue"?"mdl":"md",r=this.iconSize?this.iconSize:t;return le` 2395 <wui-icon-box 2396 data-variant=${this.iconVariant} 2397 icon=${this.icon} 2398 iconSize=${r} 2399 background="transparent" 2400 iconColor=${e} 2401 backgroundColor=${e} 2402 size=${t} 2403 ></wui-icon-box> 2404 `}return null}loadingTemplate(){return this.loading?le`<wui-loading-spinner 2405 data-testid="wui-list-item-loading-spinner" 2406 color="fg-300" 2407 ></wui-loading-spinner>`:le``}chevronTemplate(){return this.chevron?le`<wui-icon size="inherit" color="fg-200" name="chevronRight"></wui-icon>`:null}};su.styles=[Dn,Jr,pBe];mh([be()],su.prototype,"icon",void 0);mh([be()],su.prototype,"iconSize",void 0);mh([be()],su.prototype,"tabIdx",void 0);mh([be()],su.prototype,"variant",void 0);mh([be()],su.prototype,"iconVariant",void 0);mh([be({type:Boolean})],su.prototype,"disabled",void 0);mh([be()],su.prototype,"imageSrc",void 0);mh([be()],su.prototype,"alt",void 0);mh([be({type:Boolean})],su.prototype,"chevron",void 0);mh([be({type:Boolean})],su.prototype,"loading",void 0);su=mh([ot("wui-list-item")],su);const gBe=Mt` 2408 :host { 2409 width: var(--local-width); 2410 position: relative; 2411 } 2412 2413 button { 2414 border: none; 2415 border-radius: var(--local-border-radius); 2416 width: var(--local-width); 2417 white-space: nowrap; 2418 } 2419 2420 /* -- Sizes --------------------------------------------------- */ 2421 button[data-size='xs'] { 2422 padding: var(--wui-spacing-3xs) var(--wui-spacing-s) var(--wui-spacing-3xs) var(--wui-spacing-s); 2423 height: 24px; 2424 } 2425 2426 button[data-size='xs'][data-icon-left='true'][data-icon-right='false'] { 2427 padding: var(--wui-spacing-3xs) var(--wui-spacing-s) var(--wui-spacing-3xs) var(--wui-spacing-s); 2428 } 2429 2430 button[data-size='xs'][data-icon-right='true'][data-icon-left='false'] { 2431 padding: var(--wui-spacing-3xs) var(--wui-spacing-s) var(--wui-spacing-3xs) var(--wui-spacing-s); 2432 } 2433 2434 button[data-size='sm'] { 2435 padding: 7.2px var(--wui-spacing-s) 7.2px var(--wui-spacing-s); 2436 height: 32px; 2437 } 2438 2439 button[data-size='sm'][data-icon-left='true'][data-icon-right='false'] { 2440 padding: 7.2px var(--wui-spacing-s) 7.2px var(--wui-spacing-s); 2441 } 2442 2443 button[data-size='sm'][data-icon-right='true'][data-icon-left='false'] { 2444 padding: 7.2px var(--wui-spacing-s) 7.2px var(--wui-spacing-s); 2445 } 2446 2447 button[data-size='md'] { 2448 padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l); 2449 height: 36px; 2450 } 2451 2452 button[data-size='md'][data-icon-left='true'][data-icon-right='false'] { 2453 padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s); 2454 } 2455 2456 button[data-size='md'][data-icon-right='true'][data-icon-left='false'] { 2457 padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l); 2458 } 2459 2460 button[data-size='lg'] { 2461 padding: var(--wui-spacing-m) var(--wui-spacing-2l); 2462 height: 48px; 2463 } 2464 2465 /* -- Variants --------------------------------------------------------- */ 2466 button[data-variant='main'] { 2467 background-color: var(--wui-color-accent-100); 2468 color: var(--wui-color-inverse-100); 2469 border: none; 2470 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 2471 } 2472 2473 button[data-variant='inverse'] { 2474 background-color: var(--wui-color-inverse-100); 2475 color: var(--wui-color-inverse-000); 2476 border: none; 2477 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 2478 } 2479 2480 button[data-variant='accent'] { 2481 background-color: var(--wui-color-accent-glass-010); 2482 color: var(--wui-color-accent-100); 2483 border: none; 2484 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 2485 } 2486 2487 button[data-variant='accent-error'] { 2488 background: var(--wui-color-error-glass-015); 2489 color: var(--wui-color-error-100); 2490 border: none; 2491 box-shadow: inset 0 0 0 1px var(--wui-color-error-glass-010); 2492 } 2493 2494 button[data-variant='accent-success'] { 2495 background: var(--wui-color-success-glass-015); 2496 color: var(--wui-color-success-100); 2497 border: none; 2498 box-shadow: inset 0 0 0 1px var(--wui-color-success-glass-010); 2499 } 2500 2501 button[data-variant='neutral'] { 2502 background: transparent; 2503 color: var(--wui-color-fg-100); 2504 border: none; 2505 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 2506 } 2507 2508 /* -- Focus states --------------------------------------------------- */ 2509 button[data-variant='main']:focus-visible:enabled { 2510 background-color: var(--wui-color-accent-090); 2511 box-shadow: 2512 inset 0 0 0 1px var(--wui-color-accent-100), 2513 0 0 0 4px var(--wui-color-accent-glass-020); 2514 } 2515 button[data-variant='inverse']:focus-visible:enabled { 2516 background-color: var(--wui-color-inverse-100); 2517 box-shadow: 2518 inset 0 0 0 1px var(--wui-color-gray-glass-010), 2519 0 0 0 4px var(--wui-color-accent-glass-020); 2520 } 2521 button[data-variant='accent']:focus-visible:enabled { 2522 background-color: var(--wui-color-accent-glass-010); 2523 box-shadow: 2524 inset 0 0 0 1px var(--wui-color-accent-100), 2525 0 0 0 4px var(--wui-color-accent-glass-020); 2526 } 2527 button[data-variant='accent-error']:focus-visible:enabled { 2528 background: var(--wui-color-error-glass-015); 2529 box-shadow: 2530 inset 0 0 0 1px var(--wui-color-error-100), 2531 0 0 0 4px var(--wui-color-error-glass-020); 2532 } 2533 button[data-variant='accent-success']:focus-visible:enabled { 2534 background: var(--wui-color-success-glass-015); 2535 box-shadow: 2536 inset 0 0 0 1px var(--wui-color-success-100), 2537 0 0 0 4px var(--wui-color-success-glass-020); 2538 } 2539 button[data-variant='neutral']:focus-visible:enabled { 2540 background: var(--wui-color-gray-glass-005); 2541 box-shadow: 2542 inset 0 0 0 1px var(--wui-color-gray-glass-010), 2543 0 0 0 4px var(--wui-color-gray-glass-002); 2544 } 2545 2546 /* -- Hover & Active states ----------------------------------------------------------- */ 2547 @media (hover: hover) and (pointer: fine) { 2548 button[data-variant='main']:hover:enabled { 2549 background-color: var(--wui-color-accent-090); 2550 } 2551 2552 button[data-variant='main']:active:enabled { 2553 background-color: var(--wui-color-accent-080); 2554 } 2555 2556 button[data-variant='accent']:hover:enabled { 2557 background-color: var(--wui-color-accent-glass-015); 2558 } 2559 2560 button[data-variant='accent']:active:enabled { 2561 background-color: var(--wui-color-accent-glass-020); 2562 } 2563 2564 button[data-variant='accent-error']:hover:enabled { 2565 background: var(--wui-color-error-glass-020); 2566 color: var(--wui-color-error-100); 2567 } 2568 2569 button[data-variant='accent-error']:active:enabled { 2570 background: var(--wui-color-error-glass-030); 2571 color: var(--wui-color-error-100); 2572 } 2573 2574 button[data-variant='accent-success']:hover:enabled { 2575 background: var(--wui-color-success-glass-020); 2576 color: var(--wui-color-success-100); 2577 } 2578 2579 button[data-variant='accent-success']:active:enabled { 2580 background: var(--wui-color-success-glass-030); 2581 color: var(--wui-color-success-100); 2582 } 2583 2584 button[data-variant='neutral']:hover:enabled { 2585 background: var(--wui-color-gray-glass-002); 2586 } 2587 2588 button[data-variant='neutral']:active:enabled { 2589 background: var(--wui-color-gray-glass-005); 2590 } 2591 2592 button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] { 2593 padding-left: var(--wui-spacing-m); 2594 } 2595 2596 button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] { 2597 padding-right: var(--wui-spacing-m); 2598 } 2599 } 2600 2601 /* -- Disabled state --------------------------------------------------- */ 2602 button:disabled { 2603 background-color: var(--wui-color-gray-glass-002); 2604 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 2605 color: var(--wui-color-gray-glass-020);
2606 cursor: not-allowed; 2607 } 2608 2609 button > wui-text { 2610 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 2611 will-change: opacity; 2612 opacity: var(--local-opacity-100); 2613 } 2614 2615 ::slotted(*) { 2616 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 2617 will-change: opacity; 2618 opacity: var(--local-opacity-100); 2619 } 2620 2621 wui-loading-spinner { 2622 position: absolute; 2623 left: 50%; 2624 top: 50%; 2625 transform: translate(-50%, -50%); 2626 opacity: var(--local-opacity-000); 2627 } 2628`;var Gf=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const DY={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},mBe={lg:"paragraph-600",md:"small-600",sm:"small-600",xs:"tiny-600"},wBe={lg:"md",md:"md",sm:"sm",xs:"sm"};let Ku=class extends ut{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=` 2629 --local-width: ${this.fullWidth?"100%":"auto"}; 2630 --local-opacity-100: ${this.loading?0:1}; 2631 --local-opacity-000: ${this.loading?1:0}; 2632 --local-border-radius: var(--wui-border-radius-${this.borderRadius}); 2633 `;const e=this.textVariant??mBe[this.size];return le` 2634 <button 2635 data-variant=${this.variant} 2636 data-icon-left=${this.hasIconLeft} 2637 data-icon-right=${this.hasIconRight} 2638 data-size=${this.size} 2639 ?disabled=${this.disabled} 2640 > 2641 ${this.loadingTemplate()} 2642 <slot name="iconLeft" @slotchange=${()=>this.handleSlotLeftChange()}></slot> 2643 <wui-text variant=${e} color="inherit"> 2644 <slot></slot> 2645 </wui-text> 2646 <slot name="iconRight" @slotchange=${()=>this.handleSlotRightChange()}></slot> 2647 </button> 2648 `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){const e=wBe[this.size],t=this.disabled?DY.disabled:DY[this.variant];return le`<wui-loading-spinner color=${t} size=${e}></wui-loading-spinner>`}return le``}};Ku.styles=[Dn,Jr,gBe];Gf([be()],Ku.prototype,"size",void 0);Gf([be({type:Boolean})],Ku.prototype,"disabled",void 0);Gf([be({type:Boolean})],Ku.prototype,"fullWidth",void 0);Gf([be({type:Boolean})],Ku.prototype,"loading",void 0);Gf([be()],Ku.prototype,"variant",void 0);Gf([be({type:Boolean})],Ku.prototype,"hasIconLeft",void 0);Gf([be({type:Boolean})],Ku.prototype,"hasIconRight",void 0);Gf([be()],Ku.prototype,"borderRadius",void 0);Gf([be()],Ku.prototype,"textVariant",void 0);Ku=Gf([ot("wui-button")],Ku);const yBe=Mt` 2649 :host { 2650 display: block; 2651 } 2652 2653 button { 2654 width: 100%; 2655 display: block; 2656 padding-top: var(--wui-spacing-l); 2657 padding-bottom: var(--wui-spacing-l); 2658 padding-left: var(--wui-spacing-s); 2659 padding-right: var(--wui-spacing-2l); 2660 border-radius: var(--wui-border-radius-s); 2661 background-color: var(--wui-color-accent-glass-010); 2662 } 2663 2664 button:hover { 2665 background-color: var(--wui-color-accent-glass-015) !important; 2666 } 2667 2668 button:active { 2669 background-color: var(--wui-color-accent-glass-020) !important; 2670 } 2671`;var TR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Ix=class extends ut{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return le` 2672 <button> 2673 <wui-flex gap="m" alignItems="center" justifyContent="space-between"> 2674 <wui-icon-box 2675 size="lg" 2676 iconcolor="accent-100" 2677 backgroundcolor="accent-100" 2678 icon=${this.icon} 2679 background="transparent" 2680 ></wui-icon-box> 2681 2682 <wui-flex flexDirection="column" gap="3xs"> 2683 <wui-text variant="paragraph-500" color="fg-100">${this.label}</wui-text> 2684 <wui-text variant="small-400" color="fg-200">${this.description}</wui-text> 2685 </wui-flex> 2686 2687 <wui-icon size="md" color="fg-200" name="chevronRight"></wui-icon> 2688 </wui-flex> 2689 </button> 2690 `}};Ix.styles=[Dn,Jr,yBe];TR([be()],Ix.prototype,"label",void 0);TR([be()],Ix.prototype,"description",void 0);TR([be()],Ix.prototype,"icon",void 0);Ix=TR([ot("wui-notice-card")],Ix);var dse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let NB=class extends ut{constructor(){super(),this.unsubscribe=[],this.socialProvider=wt.getConnectedSocialProvider(),this.socialUsername=wt.getConnectedSocialUsername(),this.namespace=ue.state.activeChain,this.unsubscribe.push(ue.subscribeKey("activeChain",e=>{this.namespace=e}))}
2690disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=Ge.getConnectorId(this.namespace),t=Ge.getAuthConnector();if(!t||e!==Be.CONNECTOR_ID.AUTH)return this.style.cssText="display: none",null;const r=t.provider.getEmail()??"";return!r&&!this.socialUsername?(this.style.cssText="display: none",null):le` 2691 <wui-list-item 2692 variant="icon" 2693 iconVariant="overlay" 2694 icon=${this.socialProvider??"mail"} 2695 iconSize=${this.socialProvider?"xxl":"sm"} 2696 data-testid="w3m-account-email-update" 2697 ?chevron=${!this.socialProvider} 2698 @click=${()=>{this.onGoToUpdateEmail(r,this.socialProvider)}} 2699 > 2700 <wui-text variant="paragraph-500" color="fg-100">${this.getAuthName(r)}</wui-text> 2701 </wui-list-item> 2702 `}onGoToUpdateEmail(e,t){t||it.push("UpdateEmailWallet",{email:e,redirectView:"Account"})}getAuthName(e){return this.socialUsername?this.socialProvider==="discord"&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};dse([qe()],NB.prototype,"namespace",void 0);NB=dse([ot("w3m-account-auth-button")],NB);var Zf=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Yu=class extends ut{constructor(){super(),this.usubscribe=[],this.networkImages=bo.state.networkImages,this.address=_t.state.address,this.profileImage=_t.state.profileImage,this.profileName=_t.state.profileName,this.network=ue.state.activeCaipNetwork,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.remoteFeatures=Ue.state.remoteFeatures,this.usubscribe.push(_t.subscribe(e=>{e.address&&(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName)}),ue.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}),Ue.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var t,r,i;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((r=(t=this.network)==null?void 0:t.assets)==null?void 0:r.imageId)??""];return le` 2703 <wui-flex 2704 flexDirection="column" 2705 alignItems="center" 2706 gap="l" 2707 .padding=${["0","xl","m","xl"]} 2708 > 2709 <wui-avatar 2710 alt=${this.address} 2711 address=${this.address} 2712 imageSrc=${Nt(this.profileImage)} 2713 size="2lg" 2714 ></wui-avatar> 2715 <wui-flex flexDirection="column" alignItems="center"> 2716 <wui-flex gap="3xs" alignItems="center" justifyContent="center"> 2717 <wui-text variant="title-6-600" color="fg-100" data-testid="account-settings-address"> 2718 ${zi.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} 2719 </wui-text> 2720 <wui-icon-link 2721 size="md" 2722 icon="copy" 2723 iconColor="fg-200" 2724 @click=${this.onCopyAddress} 2725 ></wui-icon-link> 2726 </wui-flex> 2727 </wui-flex> 2728 </wui-flex> 2729 <wui-flex flexDirection="column" gap="m"> 2730 <wui-flex flexDirection="column" gap="xs" .padding=${["0","l","m","l"]}> 2731 ${this.authCardTemplate()} 2732 <w3m-account-auth-button></w3m-account-auth-button> 2733 <wui-list-item 2734 .variant=${e?"image":"icon"} 2735 iconVariant="overlay" 2736 icon="networkPlaceholder" 2737 imageSrc=${Nt(e)} 2738 ?chevron=${this.isAllowedNetworkSwitch()} 2739 @click=${this.onNetworks.bind(this)} 2740 data-testid="account-switch-network-button" 2741 > 2742 <wui-text variant="paragraph-500" color="fg-100"> 2743 ${((i=this.network)==null?void 0:i.name)??"Unknown"} 2744 </wui-text> 2745 </wui-list-item> 2746 ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()} 2747 <wui-list-item 2748 variant="icon" 2749 iconVariant="overlay" 2750 icon="disconnect" 2751 ?chevron=${!1} 2752 .loading=${this.disconnecting} 2753 @click=${this.onDisconnect.bind(this)} 2754 data-testid="disconnect-button" 2755 > 2756 <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text> 2757 </wui-list-item> 2758 </wui-flex> 2759 </wui-flex> 2760 `}chooseNameButtonTemplate(){var s;const e=(s=this.network)==null?void 0:s.chainNamespace,t=Ge.getConnectorId(e),r=Ge.getAuthConnector();return!ue.checkIfNamesSupported()||!r||t!==Be.CONNECTOR_ID.AUTH||this.profileName?null:le` 2761 <wui-list-item 2762 variant="icon" 2763 iconVariant="overlay" 2764 icon="id" 2765 iconSize="sm" 2766 ?chevron=${!0} 2767 @click=${this.onChooseName.bind(this)} 2768 data-testid="account-choose-name-button" 2769 > 2770 <wui-text variant="paragraph-500" color="fg-100">Choose account name </wui-text> 2771 </wui-list-item> 2772 `}authCardTemplate(){var i;const e=Ge.getConnectorId((i=this.network)==null?void 0:i.chainNamespace),t=Ge.getAuthConnector(),{origin:r}=location;return!t||e!==Be.CONNECTOR_ID.AUTH||r.includes(sr.SECURE_SITE)?null:le` 2773 <wui-notice-card 2774 @click=${this.onGoToUpgradeView.bind(this)} 2775 label="Upgrade your wallet" 2776 description="Transition to a self-custodial wallet" 2777 icon="wallet" 2778 data-testid="w3m-wallet-upgrade-card" 2779 ></wui-notice-card> 2780 `}isAllowedNetworkSwitch(){const e=ue.getAllRequestedCaipNetworks(),t=e?e.length>1:!1,r=e==null?void 0:e.find(({id:i})=>{var s;return i===((s=this.network)==null?void 0:s.id)});return t||!r}onCopyAddress(){try{this.address&&(tt.copyToClopboard(this.address),Ir.showSuccess("Address copied"))}catch{Ir.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){var s;const e=(s=this.network)==null?void 0:s.chainNamespace,t=ue.checkIfSmartAccountEnabled(),r=Ge.getConnectorId(e);return!Ge.getAuthConnector()||r!==Be.CONNECTOR_ID.AUTH||!t?null:(this.switched||(this.text=Xs(e)===fi.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account"),le` 2781 <wui-list-item 2782 variant="icon" 2783 iconVariant="overlay" 2784 icon="swapHorizontalBold" 2785 iconSize="sm" 2786 ?chevron=${!0} 2787 ?loading=${this.loading} 2788 @click=${this.changePreferredAccountType.bind(this)} 2789 data-testid="account-toggle-preferred-account-type" 2790 > 2791 <wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text> 2792 </wui-list-item> 2793 `)}onChooseName(){it.push("ChooseAccountName")}async changePreferredAccountType(){var s;const e=(s=this.network)==null?void 0:s.chainNamespace,t=ue.checkIfSmartAccountEnabled(),r=Xs(e)===fi.ACCOUNT_TYPES.SMART_ACCOUNT||!t?fi.ACCOUNT_TYPES.EOA:fi.ACCOUNT_TYPES.SMART_ACCOUNT;Ge.getAuthConnector()&&(this.loading=!0,await nt.setPreferredAccountType(r,e),this.text=r===fi.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account",this.switched=!0,ii.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&it.push("Networks")}async onDisconnect(){var e,t;try{this.disconnecting=!0;const r=(e=this.network)==null?void 0:e.chainNamespace,s=nt.getConnections(r).length>0,o=r&&Ge.state.activeConnectorIds[r],a=(t=this.remoteFeatures)==null?void 0:t.multiWallet;await nt.disconnect(a?{id:o,namespace:r}:{}),s&&a&&(it.push("ProfileWallets"),Ir.showSuccess("Wallet deleted"))}catch{xn.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Ir.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){xn.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),it.push("UpgradeEmailWallet")}};Zf([qe()],Yu.prototype,"address",void 0);Zf([qe()],Yu.prototype,"profileImage",void 0);Zf([qe()],Yu.prototype,"profileName",void 0);Zf([qe()],Yu.prototype,"network",void 0);Zf([qe()],Yu.prototype,"disconnecting",void 0);Zf([qe()],Yu.prototype,"loading",void 0);Zf([qe()],Yu.prototype,"switched",void 0);Zf([qe()],Yu.prototype,"text",void 0);Zf([qe()],Yu.prototype,"remoteFeatures",void 0);Yu=Zf([ot("w3m-account-settings-view")],Yu);const bBe=Mt` 2794 :host { 2795 display: inline-flex; 2796 background-color: var(--wui-color-gray-glass-002); 2797 border-radius: var(--wui-border-radius-3xl); 2798 padding: var(--wui-spacing-3xs); 2799 position: relative; 2800 height: 36px; 2801 min-height: 36px; 2802 overflow: hidden; 2803 } 2804 2805 :host::before { 2806 content: ''; 2807 position: absolute; 2808 pointer-events: none; 2809 top: 4px; 2810 left: 4px; 2811 display: block; 2812 width: var(--local-tab-width); 2813 height: 28px; 2814 border-radius: var(--wui-border-radius-3xl); 2815 background-color: var(--wui-color-gray-glass-002); 2816 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 2817 transform: translateX(calc(var(--local-tab) * var(--local-tab-width))); 2818 transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md); 2819 will-change: background-color, opacity; 2820 } 2821 2822 :host([data-type='flex'])::before { 2823 left: 3px; 2824 transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px))); 2825 } 2826 2827 :host([data-type='flex']) { 2828 display: flex; 2829 padding: 0px 0px 0px 12px; 2830 gap: 4px; 2831 } 2832 2833 :host([data-type='flex']) > button > wui-text { 2834 position: absolute; 2835 left: 18px; 2836 opacity: 0; 2837 } 2838 2839 button[data-active='true'] > wui-icon, 2840 button[data-active='true'] > wui-text { 2841 color: var(--wui-color-fg-100); 2842 } 2843 2844 button[data-active='false'] > wui-icon, 2845 button[data-active='false'] > wui-text { 2846 color: var(--wui-color-fg-200); 2847 } 2848 2849 button[data-active='true']:disabled, 2850 button[data-active='false']:disabled { 2851 background-color: transparent; 2852 opacity: 0.5;
2853 cursor: not-allowed; 2854 } 2855 2856 button[data-active='true']:disabled > wui-text { 2857 color: var(--wui-color-fg-200); 2858 } 2859 2860 button[data-active='false']:disabled > wui-text { 2861 color: var(--wui-color-fg-300); 2862 } 2863 2864 button > wui-icon, 2865 button > wui-text { 2866 pointer-events: none; 2867 transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md); 2868 will-change: color; 2869 } 2870 2871 button { 2872 width: var(--local-tab-width); 2873 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); 2874 will-change: background-color; 2875 } 2876 2877 :host([data-type='flex']) > button { 2878 width: 34px; 2879 position: relative; 2880 display: flex; 2881 justify-content: flex-start; 2882 } 2883 2884 button:hover:enabled, 2885 button:active:enabled { 2886 background-color: transparent !important; 2887 } 2888 2889 button:hover:enabled > wui-icon, 2890 button:active:enabled > wui-icon { 2891 transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); 2892 color: var(--wui-color-fg-125); 2893 } 2894 2895 button:hover:enabled > wui-text, 2896 button:active:enabled > wui-text { 2897 transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); 2898 color: var(--wui-color-fg-125); 2899 } 2900 2901 button { 2902 border-radius: var(--wui-border-radius-3xl); 2903 } 2904`;var P0=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Ff=class extends ut{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=` 2905 --local-tab: ${this.activeTab}; 2906 --local-tab-width: ${this.localTabWidth}; 2907 `,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((e,t)=>{var i;const r=t===this.activeTab;return le` 2908 <button 2909 ?disabled=${this.disabled} 2910 @click=${()=>this.onTabClick(t)} 2911 data-active=${r} 2912 data-testid="tab-${(i=e.label)==null?void 0:i.toLowerCase()}" 2913 > 2914 ${this.iconTemplate(e)} 2915 <wui-text variant="small-600" color="inherit"> ${e.label} </wui-text> 2916 </button> 2917 `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?le`<wui-icon size="xs" color="inherit" name=${e.icon}></wui-icon>`:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,t){const r=this.buttons[this.activeTab],i=this.buttons[e],s=r==null?void 0:r.querySelector("wui-text"),o=i==null?void 0:i.querySelector("wui-text"),a=i==null?void 0:i.getBoundingClientRect(),c=o==null?void 0:o.getBoundingClientRect();r&&s&&!t&&e!==this.activeTab&&(s.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),r.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),i&&a&&c&&o&&(e!==this.activeTab||t)&&(this.localTabWidth=`${Math.round(a.width+c.width)+6}px`,i.animate([{width:`${a.width+c.width}px`}],{duration:t?0:500,fill:"forwards",easing:"ease"}),o.animate([{opacity:1}],{duration:t?0:125,delay:t?0:200,fill:"forwards",easing:"ease"}))}};Ff.styles=[Dn,Jr,bBe];P0([be({type:Array})],Ff.prototype,"tabs",void 0);P0([be()],Ff.prototype,"onTabChange",void 0);P0([be({type:Array})],Ff.prototype,"buttons",void 0);P0([be({type:Boolean})],Ff.prototype,"disabled",void 0);P0([be()],Ff.prototype,"localTabWidth",void 0);P0([qe()],Ff.prototype,"activeTab",void 0);P0([qe()],Ff.prototype,"isDense",void 0);Ff=P0([ot("wui-tabs")],Ff);const vBe=Mt` 2918 :host { 2919 display: flex; 2920 justify-content: center; 2921 align-items: center; 2922 height: var(--wui-spacing-m); 2923 padding: 0 var(--wui-spacing-3xs) !important; 2924 border-radius: var(--wui-border-radius-5xs); 2925 transition: 2926 border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1), 2927 background-color var(--wui-duration-lg) var(--wui-ease-out-power-1); 2928 will-change: border-radius, background-color; 2929 } 2930 2931 :host > wui-text { 2932 transform: translateY(5%); 2933 } 2934 2935 :host([data-variant='main']) { 2936 background-color: var(--wui-color-accent-glass-015); 2937 color: var(--wui-color-accent-100); 2938 } 2939 2940 :host([data-variant='shade']) { 2941 background-color: var(--wui-color-gray-glass-010); 2942 color: var(--wui-color-fg-200); 2943 } 2944 2945 :host([data-variant='success']) { 2946 background-color: var(--wui-icon-box-bg-success-100); 2947 color: var(--wui-color-success-100); 2948 } 2949 2950 :host([data-variant='error']) { 2951 background-color: var(--wui-icon-box-bg-error-100); 2952 color: var(--wui-color-error-100); 2953 } 2954 2955 :host([data-size='lg']) { 2956 padding: 11px 5px !important; 2957 } 2958 2959 :host([data-size='lg']) > wui-text { 2960 transform: translateY(2%); 2961 } 2962 2963 :host([data-size='xs']) { 2964 height: var(--wui-spacing-2l); 2965 padding: 0 var(--wui-spacing-3xs) !important; 2966 } 2967 2968 :host([data-size='xs']) >
2968 wui-text { 2969 transform: translateY(2%); 2970 } 2971`;var KU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Z_=class extends ut{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;const e=this.size==="md"||this.size==="xs"?"mini-700":"micro-700";return le` 2972 <wui-text data-variant=${this.variant} variant=${e} color="inherit"> 2973 <slot></slot> 2974 </wui-text> 2975 `}};Z_.styles=[Dn,vBe];KU([be()],Z_.prototype,"variant",void 0);KU([be()],Z_.prototype,"size",void 0);Z_=KU([ot("wui-tag")],Z_);const xBe=Mt` 2976 button { 2977 display: flex; 2978 align-items: center; 2979 padding: var(--wui-spacing-xxs); 2980 border-radius: var(--wui-border-radius-xxs); 2981 column-gap: var(--wui-spacing-xs); 2982 } 2983 2984 wui-image, 2985 .icon-box { 2986 width: var(--wui-spacing-xxl); 2987 height: var(--wui-spacing-xxl); 2988 border-radius: var(--wui-border-radius-3xs); 2989 } 2990 2991 wui-text { 2992 flex: 1; 2993 } 2994 2995 .icon-box { 2996 position: relative; 2997 } 2998 2999 .icon-box[data-active='true'] { 3000 background-color: var(--wui-color-gray-glass-005); 3001 } 3002 3003 .circle { 3004 position: absolute; 3005 left: 16px; 3006 top: 15px; 3007 width: var(--wui-spacing-1xs); 3008 height: var(--wui-spacing-1xs); 3009 background-color: var(--wui-color-success-100); 3010 border: 2px solid var(--wui-color-modal-bg); 3011 border-radius: 50%; 3012 } 3013`;var Qf=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Gu=class extends ut{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return le` 3014 <button> 3015 ${this.leftImageTemplate()} ${this.textTemplate()} ${this.rightImageTemplate()} 3016 </button> 3017 `}leftImageTemplate(){const e=this.icon?le`<wui-icon 3018 size=${this.iconSize} 3019 color="fg-200" 3020 name=${this.icon} 3021 class="icon" 3022 ></wui-icon>`:le`<wui-image src=${this.imageSrc} alt=${this.alt}></wui-image>`;return le` 3023 <wui-flex 3024 alignItems="center" 3025 justifyContent="center" 3026 class="icon-box" 3027 data-active=${!!this.icon} 3028 > 3029 ${e} 3030 <wui-flex class="circle"></wui-flex> 3031 </wui-flex> 3032 `}textTemplate(){return le` 3033 <wui-text variant="paragraph-500" color="fg-100"> 3034 ${zi.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})} 3035 </wui-text> 3036 `}rightImageTemplate(){return le`<wui-icon name="chevronBottom" size="xs" color="fg-200"></wui-icon>`}};Gu.styles=[Dn,Jr,xBe];Qf([be()],Gu.prototype,"address",void 0);Qf([be()],Gu.prototype,"profileName",void 0);Qf([be()],Gu.prototype,"alt",void 0);Qf([be()],Gu.prototype,"imageSrc",void 0);Qf([be()],Gu.prototype,"icon",void 0);Qf([be()],Gu.prototype,"iconSize",void 0);Qf([be({type:Boolean})],Gu.prototype,"loading",void 0);Qf([be({type:Number})],Gu.prototype,"charsStart",void 0);Qf([be({type:Number})],Gu.prototype,"charsEnd",void 0);Gu=Qf([ot("wui-wallet-switch")],Gu);const EBe=Mt` 3037 wui-flex { 3038 width: 100%; 3039 } 3040 3041 :host > wui-flex:first-child { 3042 transform: translateY(calc(var(--wui-spacing-xxs) * -1)); 3043 } 3044 3045 wui-icon-link { 3046 margin-right: calc(var(--wui-icon-box-size-md) * -1); 3047 } 3048 3049 wui-notice-card { 3050 margin-bottom: var(--wui-spacing-3xs); 3051 } 3052 3053 wui-list-item > wui-text { 3054 flex: 1; 3055 } 3056 3057 w3m-transactions-view { 3058 max-height: 200px; 3059 } 3060 3061 .tab-content-container { 3062 height: 300px; 3063 overflow-y: auto; 3064 overflow-x: hidden; 3065 scrollbar-width: none; 3066 } 3067 3068 .tab-content-container::-webkit-scrollbar {
3069 display: none; 3070 } 3071 3072 .account-button { 3073 width: auto; 3074 border: none; 3075 display: flex; 3076 align-items: center; 3077 justify-content: center; 3078 gap: var(--wui-spacing-s); 3079 height: 48px; 3080 padding: var(--wui-spacing-xs); 3081 padding-right: var(--wui-spacing-s); 3082 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 3083 background-color: var(--wui-color-gray-glass-002); 3084 border-radius: 24px; 3085 transition: background-color 0.2s linear; 3086 } 3087 3088 .account-button:hover { 3089 background-color: var(--wui-color-gray-glass-005); 3090 } 3091 3092 .avatar-container { 3093 position: relative; 3094 } 3095 3096 wui-avatar.avatar { 3097 width: 32px; 3098 height: 32px; 3099 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 3100 } 3101 3102 wui-wallet-switch { 3103 margin-top: var(--wui-spacing-xs); 3104 } 3105 3106 wui-avatar.network-avatar { 3107 width: 16px; 3108 height: 16px; 3109 position: absolute; 3110 left: 100%; 3111 top: 100%; 3112 transform: translate(-75%, -75%); 3113 box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); 3114 } 3115 3116 .account-links { 3117 display: flex; 3118 justify-content: space-between; 3119 align-items: center; 3120 } 3121 3122 .account-links wui-flex { 3123 cursor: pointer; 3124 display: flex; 3125 align-items: center; 3126 justify-content: center; 3127 flex: 1; 3128 background: red; 3129 align-items: center; 3130 justify-content: center; 3131 height: 48px; 3132 padding: 10px; 3133 flex: 1 0 0; 3134 border-radius: var(--XS, 16px); 3135 border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); 3136 background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); 3137 transition: 3138 background-color var(--wui-ease-out-power-1) var(--wui-duration-md), 3139 opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 3140 will-change: background-color, opacity; 3141 } 3142 3143 .account-links wui-flex:hover { 3144 background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); 3145 } 3146 3147 .account-links wui-flex wui-icon { 3148 width: var(--S, 20px); 3149 height: var(--S, 20px); 3150 } 3151 3152 .account-links wui-flex wui-icon svg path { 3153 stroke: #667dff; 3154 } 3155`;var td=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let pl=class extends ut{constructor(){super(),this.unsubscribe=[],this.caipAddress=_t.state.caipAddress,this.address=tt.getPlainAddress(_t.state.caipAddress),this.profileImage=_t.state.profileImage,this.profileName=_t.state.profileName,this.disconnecting=!1,this.balance=_t.state.balance,this.balanceSymbol=_t.state.balanceSymbol,this.features=Ue.state.features,this.remoteFeatures=Ue.state.remoteFeatures,this.namespace=ue.state.activeChain,this.activeConnectorIds=Ge.state.activeConnectorIds,this.unsubscribe.push(_t.subscribeKey("caipAddress",e=>{this.address=tt.getPlainAddress(e),this.caipAddress=e}),_t.subscribeKey("balance",e=>this.balance=e),_t.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),_t.subscribeKey("profileName",e=>this.profileName=e),_t.subscribeKey("profileImage",e=>this.profileImage=e),Ue.subscribeKey("features",e=>this.features=e),Ue.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),Ge.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),ue.subscribeKey("activeChain",e=>this.namespace=e),ue.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.chainNamespace&&(this.namespace=e==null?void 0:e.chainNamespace)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress||!this.namespace)return null;const e=this.activeConnectorIds[this.namespace],t=e?Ge.getConnectorById(e):void 0,r=Hr.getConnectorImage(t);return le`<wui-flex 3156 flexDirection="column" 3157 .padding=${["0","xl","m","xl"]} 3158 alignItems="center" 3159 gap="s" 3160 > 3161 <wui-avatar 3162 alt=${Nt(this.caipAddress)} 3163 address=${Nt(tt.getPlainAddress(this.caipAddress))} 3164 imageSrc=${Nt(this.profileImage===null?void 0:this.profileImage)} 3165 data-testid="single-account-avatar" 3166 ></wui-avatar> 3167 <wui-wallet-switch 3168 profileName=${this.profileName} 3169 address=${this.address} 3170 imageSrc=${r} 3171 alt=${t==null?void 0:t.name} 3172 @click=${this.onGoToProfileWalletsView.bind(this)} 3173 data-testid="wui-wallet-switch" 3174 ></wui-wallet-switch> 3175 <wui-flex flexDirection="column" alignItems="center"> 3176 <wui-text variant="paragraph-500" color="fg-200"> 3177 ${tt.formatBalance(this.balance,this.balanceSymbol)} 3178 </wui-text> 3179 </wui-flex> 3180 ${this.explorerBtnTemplate()} 3181 </wui-flex> 3182 3183 <wui-flex flexDirection="column" gap="xs" .padding=${["0","s","s","s"]}> 3184 ${this.authCardTemplate()} <w3m-account-auth-button></w3m-account-auth-button> 3185 ${this.orderedFeaturesTemplate()} ${this.activityTemplate()} 3186 <wui-list-item 3187 variant="icon" 3188 iconVariant="overlay" 3189 icon="disconnect" 3190 ?chevron=${!1} 3191 .loading=${this.disconnecting} 3192 @click=${this.onDisconnect.bind(this)} 3193 data-testid="disconnect-button" 3194 > 3195 <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text> 3196 </wui-list-item> 3197 </wui-flex>`}onrampTemplate(){var r;if(!this.namespace)return null;const e=(r=this.remoteFeatures)==null?void 0:r.onramp,t=sr.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace);return!e||!t?null:le` 3198 <wui-list-item 3199 data-testid="w3m-account-default-onramp-button" 3200 iconVariant="blue" 3201 icon="card" 3202 ?chevron=${!0} 3203 @click=${this.handleClickPay.bind(this)} 3204 > 3205 <wui-text variant="paragraph-500" color="fg-100">Buy crypto</wui-text> 3206 </wui-list-item> 3207 `}orderedFeaturesTemplate(){var t;return(((t=this.features)==null?void 0:t.walletFeaturesOrder)||sr.DEFAULT_FEATURES.walletFeaturesOrder).map(r=>{switch(r){case"onramp":return this.onrampTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}activityTemplate(){var t;return this.namespace&&((t=this.remoteFeatures)==null?void 0:t.activity)&&sr.ACTIVITY_ENABLED_CHAIN_NAMESPACES.includes(this.namespace)?le` <wui-list-item 3208 iconVariant="blue" 3209 icon="clock" 3210 iconSize="sm" 3211 ?chevron=${!0} 3212 @click=${this.onTransactions.bind(this)} 3213 data-testid="w3m-account-default-activity-button" 3214 > 3215 <wui-text variant="paragraph-500" color="fg-100">Activity</wui-text> 3216 </wui-list-item>`:null}swapsTemplate(){var r;const e=(r=this.remoteFeatures)==null?void 0:r.swaps,t=ue.state.activeChain===Be.CHAIN.EVM;return!e||!t?null:le` 3217 <wui-list-item 3218 iconVariant="blue" 3219 icon="recycleHorizontal" 3220 ?chevron=${!0} 3221 @click=${this.handleClickSwap.bind(this)} 3222 data-testid="w3m-account-default-swaps-button" 3223 > 3224 <wui-text variant="paragraph-500" color="fg-100">Swap</wui-text> 3225 </wui-list-item> 3226 `}sendTemplate(){var i;const e=(i=this.features)==null?void 0:i.send,t=ue.state.activeChain;if(!t)throw new Error("SendController:sendTemplate - namespace is required");const r=sr.SEND_SUPPORTED_NAMESPACES.includes(t);return!e||!r?null:le` 3227 <wui-list-item 3228 iconVariant="blue" 3229 icon="send" 3230 ?chevron=${!0} 3231 @click=${this.handleClickSend.bind(this)} 3232 data-testid="w3m-account-default-send-button" 3233 > 3234 <wui-text variant="paragraph-500" color="fg-100">Send</wui-text> 3235 </wui-list-item> 3236 `}authCardTemplate(){const e=ue.state.activeChain;if(!e)throw new Error("AuthCardTemplate:authCardTemplate - namespace is required");const t=Ge.getConnectorId(e),r=Ge.getAuthConnector(),{origin:i}=location;return!r||t!==Be.CONNECTOR_ID.AUTH||i.includes(sr.SECURE_SITE)?null:le` 3237 <wui-notice-card 3238 @click=${this.onGoToUpgradeView.bind(this)} 3239 label="Upgrade your wallet" 3240 description="Transition to a self-custodial wallet" 3241 icon="wallet" 3242 data-testid="w3m-wallet-upgrade-card" 3243 ></wui-notice-card> 3244 `}handleClickPay(){it.push("OnRampProviders")}handleClickSwap(){it.push("Swap")}handleClickSend(){it.push("WalletSend")}explorerBtnTemplate(){return _t.state.addressExplorerUrl?le` 3245 <wui-button size="md" variant="neutral" @click=${this.onExplorer.bind(this)}> 3246 <wui-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wui-icon> 3247 Block Explorer 3248 <wui-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wui-icon> 3249 </wui-button>
3249 3250 `:null}onTransactions(){xn.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:Xs(ue.state.activeChain)===fi.ACCOUNT_TYPES.SMART_ACCOUNT}}),it.push("Transactions")}async onDisconnect(){var e;try{this.disconnecting=!0;const r=nt.getConnections(this.namespace).length>0,i=this.namespace&&Ge.state.activeConnectorIds[this.namespace],s=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await nt.disconnect(s?{id:i,namespace:this.namespace}:{}),r&&s&&(it.push("ProfileWallets"),Ir.showSuccess("Wallet deleted"))}catch{xn.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Ir.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){const e=_t.state.addressExplorerUrl;e&&tt.openHref(e,"_blank")}onGoToUpgradeView(){xn.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),it.push("UpgradeEmailWallet")}onGoToProfileWalletsView(){it.push("ProfileWallets")}};pl.styles=EBe;td([qe()],pl.prototype,"caipAddress",void 0);td([qe()],pl.prototype,"address",void 0);td([qe()],pl.prototype,"profileImage",void 0);td([qe()],pl.prototype,"profileName",void 0);td([qe()],pl.prototype,"disconnecting",void 0);td([qe()],pl.prototype,"balance",void 0);td([qe()],pl.prototype,"balanceSymbol",void 0);td([qe()],pl.prototype,"features",void 0);td([qe()],pl.prototype,"remoteFeatures",void 0);td([qe()],pl.prototype,"namespace",void 0);td([qe()],pl.prototype,"activeConnectorIds",void 0);pl=td([ot("w3m-account-default-widget")],pl);const ABe=Mt` 3251 span { 3252 font-weight: 500; 3253 font-size: 40px; 3254 color: var(--wui-color-fg-100); 3255 line-height: 130%; /* 52px */ 3256 letter-spacing: -1.6px; 3257 text-align: center; 3258 } 3259 3260 .pennies { 3261 color: var(--wui-color-fg-200); 3262 } 3263`;var YU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Q_=class extends ut{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return le`<span>$${this.dollars}<span class="pennies">.${this.pennies}</span></span>`}};Q_.styles=[Dn,ABe];YU([be()],Q_.prototype,"dollars",void 0);YU([be()],Q_.prototype,"pennies",void 0);Q_=YU([ot("wui-balance")],Q_);const SBe=Mt` 3264 :host { 3265 position: relative; 3266 } 3267 3268 button { 3269 display: flex; 3270 justify-content: center; 3271 align-items: center; 3272 height: 48px; 3273 width: 100%; 3274 background-color: var(--wui-color-accent-glass-010); 3275 border-radius: var(--wui-border-radius-xs); 3276 border: 1px solid var(--wui-color-accent-glass-010); 3277 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); 3278 will-change: background-color; 3279 } 3280 3281 wui-tooltip { 3282 padding: 7px var(--wui-spacing-s) 8px var(--wui-spacing-s); 3283 position: absolute; 3284 top: -8px; 3285 left: 50%; 3286 transform: translate(-50%, -100%); 3287 opacity: 0; 3288 display: none; 3289 } 3290 3291 @media (hover: hover) and (pointer: fine) { 3292 button:hover:enabled { 3293 background-color: var(--wui-color-accent-glass-015); 3294 } 3295 3296 button:active:enabled { 3297 background-color: var(--wui-color-accent-glass-020); 3298 } 3299 } 3300`;var GU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let X_=class extends ut{constructor(){super(...arguments),this.text="",this.icon="card"}render(){return le`<button> 3301 <wui-icon color="accent-100" name=${this.icon} size="lg"></wui-icon> 3302 </button>`}};X_.styles=[Dn,Jr,SBe];GU([be()],X_.prototype,"text",void 0);GU([be()],X_.prototype,"icon",void 0);X_=GU([ot("wui-icon-button")],X_);const _Be=Mt` 3303 :host { 3304 display: block; 3305 padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); 3306 border-radius: var(--wui-border-radius-xxs); 3307 3308 color: var(--wui-color-bg-100); 3309 position: relative; 3310 } 3311 3312 :host([data-variant='shade']) { 3313 background-color: var(--wui-color-bg-150); 3314 border: 1px solid var(--wui-color-gray-glass-005); 3315 } 3316 3317 :host([data-variant='shade']) > wui-text { 3318 color: var(--wui-color-fg-150); 3319 } 3320 3321 :host([data-variant='fill']) { 3322 background-color: var(--wui-color-fg-100); 3323 border: none; 3324 } 3325 3326 wui-icon { 3327 position: absolute; 3328 width: 12px !important; 3329 height: 4px !important; 3330 } 3331 3332 wui-icon[data-placement='top'] { 3333 bottom: 0px; 3334 left: 50%; 3335 transform: translate(-50%, 95%); 3336 } 3337 3338 wui-icon[data-placement='bottom'] { 3339 top: 0; 3340 left: 50%; 3341 transform: translate(-50%, -95%) rotate(180deg); 3342 } 3343 3344 wui-icon[data-placement='right'] { 3345 top: 50%; 3346 left: 0; 3347 transform: translate(-65%, -50%) rotate(90deg); 3348 } 3349 3350 wui-icon[data-placement='left'] { 3351 top: 50%; 3352 right: 0%; 3353 transform: translate(65%, -50%) rotate(270deg); 3354 } 3355`;var IR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Nx=class extends ut{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.message=""}render(){return this.dataset.variant=this.variant,le`<wui-icon 3356 data-placement=${this.placement} 3357 color="fg-100" 3358 size="inherit" 3359 name=${this.variant==="fill"?"cursor":"cursorTransparent"} 3360 ></wui-icon> 3361 <wui-text color="inherit" variant="small-500">${this.message}</wui-text>`}};Nx.styles=[Dn,Jr,_Be];IR([be()],Nx.prototype,"placement",void 0);IR([be()],Nx.prototype,"variant",void 0);IR([be()],Nx.prototype,"message",void 0);Nx=IR([ot("wui-tooltip")],Nx);const CBe={getTabsByNamespace(n){var t;return!!n&&n===Be.CHAIN.EVM?((t=Ue.state.remoteFeatures)==null?void 0:t.activity)===!1?Ry.ACCOUNT_TABS.filter(r=>r.label!=="Activity"):Ry.ACCOUNT_TABS:[]}},TBe=Mt` 3362 button { 3363 padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); 3364 border-radius: var(--wui-border-radius-3xs); 3365 background-color: transparent; 3366 color: var(--wui-color-accent-100); 3367 } 3368 3369 button:disabled { 3370 background-color: transparent; 3371 color: var(--wui-color-gray-glass-015); 3372 } 3373 3374 button:hover { 3375 background-color: var(--wui-color-gray-glass-005); 3376 } 3377`;var NR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Rx=class extends ut{constructor(){super(...arguments),this.tabIdx=void 0,this.disabled=!1,this.color="inherit"}render(){return le` 3378 <button ?disabled=${this.disabled} tabindex=${Nt(this.tabIdx)}> 3379 <slot name="iconLeft"></slot> 3380 <wui-text variant="small-600" color=${this.color}> 3381 <slot></slot> 3382 </wui-text> 3383 <slot name="iconRight"></slot> 3384 </button> 3385 `}};Rx.styles=[Dn,Jr,TBe];NR([be()],Rx.prototype,"tabIdx",void 0);NR([be({type:Boolean})],Rx.prototype,"disabled",void 0);NR([be()],Rx.prototype,"color",void 0);Rx=NR([ot("wui-link")],Rx);var RB;(function(n){n.approve="approved",n.bought="bought",n.borrow="borrowed",n.burn="burnt",n.cancel="canceled",n.claim="claimed",n.deploy="deployed",n.deposit="deposited",n.execute="executed",n.mint="minted",
3385n.receive="received",n.repay="repaid",n.send="sent",n.sell="sold",n.stake="staked",n.trade="swapped",n.unstake="unstaked",n.withdraw="withdrawn"})(RB||(RB={}));const IBe=Mt` 3386 :host > wui-flex { 3387 display: flex; 3388 justify-content: center; 3389 align-items: center; 3390 position: relative; 3391 width: 40px; 3392 height: 40px; 3393 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 3394 background-color: var(--wui-color-gray-glass-005); 3395 } 3396 3397 :host > wui-flex wui-image { 3398 display: block; 3399 } 3400 3401 :host > wui-flex, 3402 :host > wui-flex wui-image, 3403 .swap-images-container, 3404 .swap-images-container.nft, 3405 wui-image.nft { 3406 border-top-left-radius: var(--local-left-border-radius); 3407 border-top-right-radius: var(--local-right-border-radius); 3408 border-bottom-left-radius: var(--local-left-border-radius); 3409 border-bottom-right-radius: var(--local-right-border-radius); 3410 } 3411 3412 wui-icon { 3413 width: 20px; 3414 height: 20px; 3415 } 3416 3417 wui-icon-box { 3418 position: absolute; 3419 right: 0; 3420 bottom: 0; 3421 transform: translate(20%, 20%); 3422 } 3423 3424 .swap-images-container { 3425 position: relative; 3426 width: 40px; 3427 height: 40px; 3428 overflow: hidden; 3429 } 3430 3431 .swap-images-container wui-image:first-child { 3432 position: absolute; 3433 width: 40px; 3434 height: 40px; 3435 top: 0; 3436 left: 0%; 3437 clip-path: inset(0px calc(50% + 2px) 0px 0%); 3438 } 3439 3440 .swap-images-container wui-image:last-child { 3441 clip-path: inset(0px 0px 0px calc(50% + 2px)); 3442 } 3443`;var ib=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let fg=class extends ut{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""}}render(){const[e,t]=this.images,r=(e==null?void 0:e.type)==="NFT",i=t!=null&&t.url?t.type==="NFT":r,s=r?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)",o=i?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)";return this.style.cssText=` 3444 --local-left-border-radius: ${s}; 3445 --local-right-border-radius: ${o}; 3446 `,le`<wui-flex> ${this.templateVisual()} ${this.templateIcon()} </wui-flex>`}templateVisual(){const[e,t]=this.images,r=e==null?void 0:e.type;return this.images.length===2&&(e!=null&&e.url||t!=null&&t.url)?le`<div class="swap-images-container"> 3447 ${e!=null&&e.url?le`<wui-image src=${e.url} alt="Transaction image"></wui-image>`:null} 3448 ${t!=null&&t.url?le`<wui-image src=${t.url} alt="Transaction image"></wui-image>`:null} 3449 </div>`:e!=null&&e.url?le`<wui-image src=${e.url} alt="Transaction image"></wui-image>`:r==="NFT"?le`<wui-icon size="inherit" color="fg-200" name="nftPlaceholder"></wui-icon>`:le`<wui-icon size="inherit" color="fg-200" name="coinPlaceholder"></wui-icon>`}templateIcon(){let e="accent-100",t;return t=this.getIcon(),this.status&&(e=this.getStatusColor()),t?le` 3450 <wui-icon-box 3451 size="xxs" 3452 iconColor=${e} 3453 backgroundColor=${e} 3454 background="opaque" 3455 icon=${t} 3456 ?border=${!0} 3457 borderColor="wui-color-bg-125" 3458 ></wui-icon-box> 3459 `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontalBold":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};fg.styles=[IBe];ib([be()],fg.prototype,"type",void 0);ib([be()],fg.prototype,"status",void 0);ib([be()],fg.prototype,"direction",void 0);ib([be({type:Boolean})],fg.prototype,"onlyDirectionIcon",void 0);ib([be({type:Array})],fg.prototype,"images",void 0);ib([be({type:Object})],fg.prototype,"secondImage",void 0);fg=ib([ot("wui-transaction-visual")],fg);const NBe=Mt` 3460 :host > wui-flex:first-child {
3461 align-items: center; 3462 column-gap: var(--wui-spacing-s); 3463 padding: 6.5px var(--wui-spacing-xs) 6.5px var(--wui-spacing-xs); 3464 width: 100%; 3465 } 3466 3467 :host > wui-flex:first-child wui-text:nth-child(1) { 3468 text-transform: capitalize; 3469 } 3470 3471 wui-transaction-visual { 3472 width: 40px; 3473 height: 40px; 3474 } 3475 3476 wui-flex { 3477 flex: 1; 3478 } 3479 3480 :host wui-flex wui-flex { 3481 overflow: hidden; 3482 } 3483 3484 :host .description-container wui-text span { 3485 word-break: break-all; 3486 } 3487 3488 :host .description-container wui-text { 3489 overflow: hidden; 3490 } 3491 3492 :host .description-separator-icon { 3493 margin: 0px 6px; 3494 } 3495 3496 :host wui-text > span { 3497 overflow: hidden; 3498 display: -webkit-box; 3499 -webkit-box-orient: vertical; 3500 -webkit-line-clamp: 1; 3501 } 3502`;var wh=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let ou=class extends ut{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return le` 3503 <wui-flex> 3504 <wui-transaction-visual 3505 .status=${this.status} 3506 direction=${Nt(this.direction)} 3507 type=${this.type} 3508 onlyDirectionIcon=${Nt(this.onlyDirectionIcon)} 3509 .images=${this.images} 3510 ></wui-transaction-visual> 3511 <wui-flex flexDirection="column" gap="3xs"> 3512 <wui-text variant="paragraph-600" color="fg-100"> 3513 ${RB[this.type]||this.type} 3514 </wui-text> 3515 <wui-flex class="description-container"> 3516 ${this.templateDescription()} ${this.templateSecondDescription()} 3517 </wui-flex> 3518 </wui-flex> 3519 <wui-text variant="micro-700" color="fg-300"><span>${this.date}</span></wui-text> 3520 </wui-flex> 3521 `}templateDescription(){var t;const e=(t=this.descriptions)==null?void 0:t[0];return e?le` 3522 <wui-text variant="small-500" color="fg-200"> 3523 <span>${e}</span> 3524 </wui-text> 3525 `:null}templateSecondDescription(){var t;const e=(t=this.descriptions)==null?void 0:t[1];return e?le` 3526 <wui-icon class="description-separator-icon" size="xxs" name="arrowRight"></wui-icon> 3527 <wui-text variant="small-400" color="fg-200"> 3528 <span>${e}</span> 3529 </wui-text> 3530 `:null}};ou.styles=[Dn,NBe];wh([be()],ou.prototype,"type",void 0);wh([be({type:Array})],ou.prototype,"descriptions",void 0);wh([be()],ou.prototype,"date",void 0);wh([be({type:Boolean})],ou.prototype,"onlyDirectionIcon",void 0);wh([be()],ou.prototype,"status",void 0);wh([be()],ou.prototype,"direction",void 0);wh([be({type:Array})],ou.prototype,"images",void 0);wh([be({type:Array})],ou.prototype,"price",void 0);wh([be({type:Array})],ou.prototype,"amount",void 0);wh([be({type:Array})],ou.prototype,"symbol",void 0);ou=wh([ot("wui-transaction-list-item")],ou);const RBe=Mt` 3531 :host { 3532 display: block; 3533 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 3534 background: linear-gradient( 3535 120deg, 3536 var(--wui-color-bg-200) 5%, 3537 var(--wui-color-bg-200) 48%, 3538 var(--wui-color-bg-300) 55%, 3539 var(--wui-color-bg-300) 60%, 3540 var(--wui-color-bg-300) calc(60% + 10px), 3541 var(--wui-color-bg-200) calc(60% + 12px), 3542 var(--wui-color-bg-200) 100% 3543 ); 3544 background-size: 250%; 3545 animation: shimmer 3s linear infinite reverse; 3546 } 3547 3548 :host([variant='light']) { 3549 background: linear-gradient( 3550 120deg, 3551 var(--wui-color-bg-150) 5%, 3552 var(--wui-color-bg-150) 48%, 3553 var(--wui-color-bg-200) 55%, 3554 var(--wui-color-bg-200) 60%, 3555 var(--wui-color-bg-200) calc(60% + 10px), 3556 var(--wui-color-bg-150) calc(60% + 12px), 3557 var(--wui-color-bg-150) 100% 3558 ); 3559 background-size: 250%; 3560 } 3561 3562 @keyframes shimmer { 3563 from { 3564 background-position: -250% 0; 3565 } 3566 to { 3567 background-position: 250% 0; 3568 } 3569 } 3570`;var d4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let S1=class extends ut{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=` 3571 width: ${this.width}; 3572 height: ${this.height}; 3573 border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`}; 3574 `,le`<slot></slot>`}};S1.styles=[RBe];d4([be()],S1.prototype,"width",void 0);d4([be()],S1.prototype,"height",void 0);d4([be()],S1.prototype,"borderRadius",void 0);d4([be()],S1.prototype,"variant",void 0);S1=d4([ot("wui-shimmer")],S1);const MBe=Mt` 3575 :host > wui-flex:first-child { 3576 column-gap: var(--wui-spacing-s); 3577 padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); 3578 width: 100%; 3579 } 3580 3581 wui-flex { 3582 display: flex; 3583 flex: 1; 3584 } 3585`;var kBe=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let MB=class extends ut{render(){return le` 3586 <wui-flex alignItems="center"> 3587 <wui-shimmer width="40px" height="40px"></wui-shimmer> 3588 <wui-flex flexDirection="column" gap="2xs"> 3589 <wui-shimmer width="72px" height="16px" borderRadius="4xs"></wui-shimmer> 3590 <wui-shimmer width="148px" height="14px" borderRadius="4xs"></wui-shimmer> 3591 </wui-flex> 3592 <wui-shimmer width="24px" height="12px" borderRadius="5xs"></wui-shimmer> 3593 </wui-flex> 3594 `}};MB.styles=[Dn,MBe];MB=kBe([ot("wui-transaction-list-item-loader")],MB);const OBe=Mt` 3595 :host { 3596 min-height: 100%; 3597 } 3598 3599 .group-container[last-group='true'] { 3600 padding-bottom: var(--wui-spacing-m); 3601 } 3602 3603 .contentContainer { 3604 height: 280px; 3605 } 3606 3607 .contentContainer > wui-icon-box { 3608 width: 40px; 3609 height: 40px; 3610 border-radius: var(--wui-border-radius-xxs); 3611 } 3612 3613 .contentContainer > .textContent { 3614 width: 65%; 3615 } 3616 3617 .emptyContainer { 3618 height: 100%; 3619 } 3620`;var sb=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const $I="last-transaction",PBe=7;let pg=class extends ut{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.caipAddress=ue.state.activeCaipAddress,this.transactionsByYear=mc.state.transactionsByYear,this.loading=mc.state.loading,this.empty=mc.state.empty,this.next=mc.state.next,mc.clearCursor(
3620),this.unsubscribe.push(ue.subscribeKey("activeCaipAddress",e=>{e&&this.caipAddress!==e&&(mc.resetTransactions(),mc.fetchTransactions(e)),this.caipAddress=e}),ue.subscribeKey("activeCaipNetwork",()=>{this.updateTransactionView()}),mc.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){this.updateTransactionView(),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return le` ${this.empty?null:this.templateTransactionsByYear()} 3621 ${this.loading?this.templateLoading():null} 3622 ${!this.loading&&this.empty?this.templateEmpty():null}`}updateTransactionView(){mc.resetTransactions(),this.caipAddress&&mc.fetchTransactions(tt.getPlainAddress(this.caipAddress))}templateTransactionsByYear(){return Object.keys(this.transactionsByYear).sort().reverse().map(t=>{const r=parseInt(t,10),i=new Array(12).fill(null).map((s,o)=>{var u;const a=C2.getTransactionGroupTitle(r,o),c=(u=this.transactionsByYear[r])==null?void 0:u[o];return{groupTitle:a,transactions:c}}).filter(({transactions:s})=>s).reverse();return i.map(({groupTitle:s,transactions:o},a)=>{const c=a===i.length-1;return o?le` 3623 <wui-flex 3624 flexDirection="column" 3625 class="group-container" 3626 last-group="${c?"true":"false"}" 3627 data-testid="month-indexes" 3628 > 3629 <wui-flex 3630 alignItems="center" 3631 flexDirection="row" 3632 .padding=${["xs","s","s","s"]} 3633 > 3634 <wui-text variant="paragraph-500" color="fg-200" data-testid="group-title" 3635 >${s}</wui-text 3636 > 3637 </wui-flex> 3638 <wui-flex flexDirection="column" gap="xs"> 3639 ${this.templateTransactions(o,c)} 3640 </wui-flex> 3641 </wui-flex> 3642 `:null})})}templateRenderTransaction(e,t){const{date:r,descriptions:i,direction:s,isAllNFT:o,images:a,status:c,transfers:u,type:d}=this.getTransactionListItemProps(e),f=(u==null?void 0:u.length)>1;return(u==null?void 0:u.length)===2&&!o?le` 3643 <wui-transaction-list-item 3644 date=${r} 3645 .direction=${s} 3646 id=${t&&this.next?$I:""} 3647 status=${c} 3648 type=${d} 3649 .images=${a} 3650 .descriptions=${i} 3651 ></wui-transaction-list-item> 3652 `:f?u.map((w,y)=>{const b=C2.getTransferDescription(w),E=t&&y===u.length-1;return le` <wui-transaction-list-item 3653 date=${r} 3654 direction=${w.direction} 3655 id=${E&&this.next?$I:""} 3656 status=${c} 3657 type=${d} 3658 .onlyDirectionIcon=${!0} 3659 .images=${[a[y]]} 3660 .descriptions=${[b]} 3661 ></wui-transaction-list-item>`}):le` 3662 <wui-transaction-list-item 3663 date=${r} 3664 .direction=${s} 3665 id=${t&&this.next?$I:""} 3666 status=${c} 3667 type=${d} 3668 .images=${a} 3669 .descriptions=${i} 3670 ></wui-transaction-list-item> 3671 `}templateTransactions(e,t){return e.map((r,i)=>{const s=t&&i===e.length-1;return le`${this.templateRenderTransaction(r,s)}`})}emptyStateActivity(){return le`<wui-flex 3672 class="emptyContainer" 3673 flexGrow="1" 3674 flexDirection="column" 3675 justifyContent="center" 3676 alignItems="center" 3677 .padding=${["3xl","xl","3xl","xl"]} 3678 gap="xl" 3679 data-testid="empty-activity-state" 3680 > 3681 <wui-icon-box 3682 backgroundColor="gray-glass-005" 3683 background="gray" 3684 iconColor="fg-200" 3685 icon="wallet" 3686 size="lg" 3687 ?border=${!0} 3688 borderColor="wui-color-bg-125" 3689 ></wui-icon-box> 3690 <wui-flex flexDirection="column" alignItems="center" gap="xs"> 3691 <wui-text align="center" variant="paragraph-500" color="fg-100" 3692 >No Transactions yet</wui-text 3693 > 3694 <wui-text align="center" variant="small-500" color="fg-200" 3695 >Start trading on dApps <br /> 3696 to grow your wallet!</wui-text 3697 > 3698 </wui-flex> 3699 </wui-flex>`}emptyStateAccount(){return le`<wui-flex 3700 class="contentContainer" 3701 alignItems="center" 3702 justifyContent="center" 3703 flexDirection="column" 3704 gap="l" 3705 data-testid="empty-account-state" 3706 > 3707 <wui-icon-box 3708 icon="swapHorizontal" 3709 size="inherit" 3710 iconColor="fg-200" 3711 backgroundColor="fg-200" 3712 iconSize="lg" 3713 ></wui-icon-box> 3714 <wui-flex 3715 class="textContent" 3716 gap="xs" 3717 flexDirection="column" 3718 justifyContent="center" 3719 flexDirection="column" 3720 > 3721 <wui-text variant="paragraph-500" align="center" color="fg-100">No activity yet</wui-text> 3722 <wui-text variant="small-400" align="center" color="fg-200" 3723 >Your next transactions will appear here</wui-text 3724 > 3725 </wui-flex> 3726 <wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link> 3727 </wui-flex>`}templateEmpty(){return this.page==="account"?le`${this.emptyStateAccount()}`:le`${this.emptyStateActivity()}`}templateLoading(){return this.page==="activity"?Array(PBe).fill(le` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map(e=>e):null}onReceiveClick(){it.push("WalletReceive")}createPaginationObserver(){const{projectId:e}=Ue.state;this.paginationObserver=new IntersectionObserver(([t])=>{t!=null&&t.isIntersecting&&!this.loading&&(mc.fetchTransactions(tt.getPlainAddress(this.caipAddress)),xn.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:tt.getPlainAddress(this.caipAddress),projectId:e,cursor:this.next,isSmartAccount:Xs(ue.state.activeChain)===fi.ACCOUNT_TYPES.SMART_ACCOUNT}}))},{}),this.setPaginationObserver()}setPaginationObserver(){var t,r,i;(t=this.paginationObserver)==null||t.disconnect();const e=(r=this.shadowRoot)==null?void 0:r.querySelector(`#${$I}`);e&&((i=this.paginationObserver)==null||i.observe(e))}getTransactionListItemProps(e){var c,u,d,f,m;
3727const t=RD.formatDate((c=e==null?void 0:e.metadata)==null?void 0:c.minedAt),r=C2.getTransactionDescriptions(e),i=e==null?void 0:e.transfers,s=(u=e==null?void 0:e.transfers)==null?void 0:u[0],o=!!s&&((d=e==null?void 0:e.transfers)==null?void 0:d.every(w=>!!w.nft_info)),a=C2.getTransactionImages(i);return{date:t,direction:s==null?void 0:s.direction,descriptions:r,isAllNFT:o,images:a,status:(f=e.metadata)==null?void 0:f.status,transfers:i,type:(m=e.metadata)==null?void 0:m.operationType}}};pg.styles=OBe;sb([be()],pg.prototype,"page",void 0);sb([qe()],pg.prototype,"caipAddress",void 0);sb([qe()],pg.prototype,"transactionsByYear",void 0);sb([qe()],pg.prototype,"loading",void 0);sb([qe()],pg.prototype,"empty",void 0);sb([qe()],pg.prototype,"next",void 0);pg=sb([ot("w3m-activity-list")],pg);const DBe=Mt` 3728 :host { 3729 width: 100%; 3730 max-height: 280px; 3731 overflow: scroll; 3732 scrollbar-width: none; 3733 } 3734 3735 :host::-webkit-scrollbar { 3736 display: none; 3737 } 3738`;var BBe=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let kB=class extends ut{render(){return le`<w3m-activity-list page="account"></w3m-activity-list>`}};kB.styles=DBe;kB=BBe([ot("w3m-account-activity-widget")],kB);const LBe=Mt` 3739 .contentContainer { 3740 height: 280px; 3741 } 3742 3743 .contentContainer > wui-icon-box { 3744 width: 40px; 3745 height: 40px; 3746 border-radius: var(--wui-border-radius-xxs); 3747 } 3748 3749 .contentContainer > .textContent { 3750 width: 65%; 3751 } 3752`;var $Be=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let OB=class extends ut{render(){return le`${this.nftTemplate()}`}nftTemplate(){return le` <wui-flex 3753 class="contentContainer" 3754 alignItems="center" 3755 justifyContent="center" 3756 flexDirection="column" 3757 gap="l" 3758 > 3759 <wui-icon-box 3760 icon="wallet" 3761 size="inherit" 3762 iconColor="fg-200" 3763 backgroundColor="fg-200" 3764 iconSize="lg" 3765 ></wui-icon-box> 3766 <wui-flex 3767 class="textContent" 3768 gap="xs" 3769 flexDirection="column" 3770 justifyContent="center" 3771 flexDirection="column" 3772 > 3773 <wui-text 3774 variant="paragraph-500" 3775 align="center" 3776 color="fg-100" 3777 data-testid="nft-template-title" 3778 >Coming soon</wui-text 3779 > 3780 <wui-text 3781 variant="small-400" 3782 align="center" 3783 color="fg-200" 3784 data-testid="nft-template-description" 3785 >Stay tuned for our upcoming NFT feature</wui-text 3786 > 3787 </wui-flex> 3788 <wui-link @click=${this.onReceiveClick.bind(this)} data-testid="link-receive-funds" 3789 >Receive funds</wui-link 3790 > 3791 </wui-flex>`}onReceiveClick(){it.push("WalletReceive")}};OB.styles=LBe;OB=$Be([ot("w3m-account-nfts-widget")],OB);const UBe=Mt` 3792 button { 3793 width: 100%; 3794 display: flex; 3795 gap: var(--wui-spacing-s); 3796 align-items: center; 3797 justify-content: flex-start; 3798 padding: var(--wui-spacing-s) var(--wui-spacing-m) var(--wui-spacing-s) var(--wui-spacing-s); 3799 background-color: var(--wui-color-gray-glass-002); 3800 border-radius: var(--wui-border-radius-xs); 3801 } 3802 3803 wui-icon-box { 3804 width: var(--wui-spacing-2xl); 3805 height: var(--wui-spacing-2xl); 3806 } 3807 3808 wui-flex { 3809 width: auto; 3810 } 3811`;var D0=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Wf=class extends ut{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroun
3811dColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return le` 3812 <button ?disabled=${this.disabled}> 3813 <wui-icon-box 3814 iconColor=${this.iconColor} 3815 backgroundColor=${this.iconBackgroundColor} 3816 size="inherit" 3817 icon=${this.icon} 3818 iconSize="md" 3819 ></wui-icon-box> 3820 <wui-flex flexDirection="column" justifyContent="spaceBetween"> 3821 ${this.titleTemplate()} 3822 <wui-text variant="small-400" color="fg-200"> ${this.description}</wui-text></wui-flex 3823 > 3824 </button> 3825 `}titleTemplate(){return this.tag?le` <wui-flex alignItems="center" gap="xxs" 3826 ><wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text 3827 ><wui-tag tagType="main" size="md">${this.tag}</wui-tag> 3828 </wui-flex>`:le`<wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text>`}};Wf.styles=[Dn,Jr,UBe];D0([be()],Wf.prototype,"icon",void 0);D0([be()],Wf.prototype,"text",void 0);D0([be()],Wf.prototype,"description",void 0);D0([be()],Wf.prototype,"tag",void 0);D0([be()],Wf.prototype,"iconBackgroundColor",void 0);D0([be()],Wf.prototype,"iconColor",void 0);D0([be({type:Boolean})],Wf.prototype,"disabled",void 0);Wf=D0([ot("wui-list-description")],Wf);const jBe=Mt` 3829 button { 3830 padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); 3831 display: flex; 3832 justify-content: space-between; 3833 width: 100%; 3834 border-radius: var(--wui-border-radius-xs); 3835 background-color: var(--wui-color-gray-glass-002); 3836 } 3837 3838 button[data-clickable='false'] { 3839 pointer-events: none; 3840 background-color: transparent; 3841 } 3842 3843 wui-image, 3844 wui-icon { 3845 width: var(--wui-spacing-3xl); 3846 height: var(--wui-spacing-3xl); 3847 } 3848 3849 wui-image { 3850 border-radius: var(--wui-border-radius-3xl); 3851 } 3852`;var ob=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let gg=class extends ut{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return le` 3853 <button data-clickable=${String(this.clickable)}> 3854 <wui-flex gap="s" alignItems="center"> 3855 ${this.visualTemplate()} 3856 <wui-flex flexDirection="column" justifyContent="spaceBetween"> 3857 <wui-text variant="paragraph-500" color="fg-100">${this.tokenName}</wui-text> 3858 <wui-text variant="small-400" color="fg-200"> 3859 ${zi.formatNumberToLocalString(this.tokenAmount,4)} ${this.tokenCurrency} 3860 </wui-text> 3861 </wui-flex> 3862 </wui-flex> 3863 <wui-text variant="paragraph-500" color="fg-100">$${this.tokenValue.toFixed(2)}</wui-text> 3864 </button> 3865 `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?le`<wui-image alt=${this.tokenName} src=${this.tokenImageUrl}></wui-image>`:le`<wui-icon name="coinPlaceholder" color="fg-100"></wui-icon>`}};gg.styles=[Dn,Jr,jBe];ob([be()],gg.prototype,"tokenName",void 0);ob([be()],gg.prototype,"tokenImageUrl",void 0);ob([be({type:Number})],gg.prototype,"tokenValue",void 0);ob([be()],gg.prototype,"tokenAmount",void 0);ob([be()],gg.prototype,"tokenCurrency",void 0);ob([be({type:Boolean})],gg.prototype,"clickable",void 0);gg=ob([ot("wui-list-token")],gg);const zBe=Mt` 3866 :host { 3867 width: 100%; 3868 } 3869 3870 wui-flex { 3871 width: 100%; 3872 } 3873 3874 .contentContainer { 3875 max-height: 280px; 3876 overflow: scroll; 3877 scrollbar-width: none; 3878 } 3879 3880 .contentContainer::-webkit-scrollbar {
3881 display: none; 3882 } 3883`;var ZU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let J_=class extends ut{constructor(){super(),this.unsubscribe=[],this.tokenBalance=_t.state.tokenBalance,this.remoteFeatures=Ue.state.remoteFeatures,this.unsubscribe.push(_t.subscribe(e=>{this.tokenBalance=e.tokenBalance}),Ue.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return le`${this.tokenTemplate()}`}tokenTemplate(){var e;return this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>0?le`<wui-flex class="contentContainer" flexDirection="column" gap="xs"> 3884 ${this.tokenItemTemplate()} 3885 </wui-flex>`:le` <wui-flex flexDirection="column" gap="xs" 3886 >${this.onRampTemplate()} 3887 <wui-list-description 3888 @click=${this.onReceiveClick.bind(this)} 3889 text="Receive funds" 3890 description="Transfer tokens on your wallet" 3891 icon="arrowBottomCircle" 3892 iconColor="fg-200" 3893 iconBackgroundColor="fg-200" 3894 data-testid="receive-funds" 3895 ></wui-list-description 3896 ></wui-flex>`}onRampTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.onramp?le`<wui-list-description 3897 @click=${this.onBuyClick.bind(this)} 3898 text="Buy Crypto" 3899 description="Easy with card or bank account" 3900 icon="card" 3901 iconColor="success-100" 3902 iconBackgroundColor="success-100" 3903 tag="popular" 3904 data-testid="buy-crypto" 3905 ></wui-list-description>`:le``}tokenItemTemplate(){var e;return(e=this.tokenBalance)==null?void 0:e.map(t=>le`<wui-list-token 3906 tokenName=${t.name} 3907 tokenImageUrl=${t.iconUrl} 3908 tokenAmount=${t.quantity.numeric} 3909 tokenValue=${t.value} 3910 tokenCurrency=${t.symbol} 3911 ></wui-list-token>`)}onReceiveClick(){it.push("WalletReceive")}onBuyClick(){xn.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:Xs(ue.state.activeChain)===fi.ACCOUNT_TYPES.SMART_ACCOUNT}}),it.push("OnRampProviders")}};J_.styles=zBe;ZU([qe()],J_.prototype,"tokenBalance",void 0);ZU([qe()],J_.prototype,"remoteFeatures",void 0);J_=ZU([ot("w3m-account-tokens-widget")],J_);const FBe=Mt` 3912 :host { 3913 width: 100%; 3914 display: block; 3915 } 3916`;var QU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let eC=class extends ut{constructor(){super(),this.unsubscribe=[],this.text="",this.open=Vl.state.open,this.unsubscribe.push(it.subscribeKey("view",()=>{Vl.hide()}),Yn.subscribeKey("open",e=>{e||Vl.hide()}),Vl.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),Vl.hide()}render(){return le` 3917 <div 3918 @pointermove=${this.onMouseEnter.bind(this)} 3919 @pointerleave=${this.onMouseLeave.bind(this)} 3920 > 3921 ${this.renderChildren()} 3922 </div> 3923 `}renderChildren(){return le`<slot></slot> `}onMouseEnter(){const e=this.getBoundingClientRect();this.open||Vl.showTooltip({message:this.text,triggerRect:{width:e.width,height:e.height,left:e.left,top:e.top},variant:"shade"})}onMouseLeave(e){this.contains(e.relatedTarget)||Vl.hide()}};eC.styles=[FBe];QU([be()],eC.prototype,"text",void 0);QU([qe()],eC.prototype,"open",void 0);eC=QU([ot("w3m-tooltip-trigger")],eC);const WBe=Mt` 3924 :host { 3925 pointer-events: none; 3926 } 3927 3928 :host > wui-flex { 3929 display: var(--w3m-tooltip-display); 3930 opacity: var(--w3m-tooltip-opacity); 3931 padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); 3932 border-radius: var(--wui-border-radius-xxs); 3933 color: var(--wui-color-bg-100); 3934 position: fixed; 3935 top: var(--w3m-tooltip-top); 3936 left: var(--w3m-tooltip-left); 3937 transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px)); 3938 max-width: calc(var(--w3m-modal-width) - var(--wui-spacing-xl)); 3939 transition: opacity 0.2s var(--wui-ease-out-power-2); 3940 will-change: opacity; 3941 } 3942 3943 :host([data-variant='shade']) > wui-flex { 3944 background-color: var(--wui-color-bg-150); 3945 border: 1px solid var(--wui-color-gray-glass-005); 3946 } 3947 3948 :host([data-variant='shade']) > wui-flex > wui-text { 3949 color: var(--wui-color-fg-150); 3950 } 3951 3952 :host([data-variant='fill']) > wui-flex { 3953 background-color: var(--wui-color-fg-100); 3954 border: none; 3955 } 3956 3957 wui-icon { 3958 position: absolute; 3959 width: 12px !important; 3960 height: 4px !important; 3961 color: var(--wui-color-bg-150); 3962 } 3963 3964 wui-icon[data-placement='top'] { 3965 bottom: 0px; 3966 left: 50%; 3967 transform: translate(-50%, 95%); 3968 } 3969 3970 wui-icon[data-placement='bottom'] { 3971 top: 0; 3972 left: 50%; 3973 transform: translate(-50%, -95%) rotate(180deg); 3974 } 3975 3976 wui-icon[data-placement='right'] { 3977 top: 50%; 3978 left: 0; 3979 transform: translate(-65%, -50%) rotate(90deg); 3980 } 3981 3982 wui-icon[data-placement='left'] { 3983 top: 50%; 3984 right: 0%; 3985 transform: translate(65%, -50%) rotate(270deg); 3986 } 3987`;var h4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let _1=class extends ut{constructor(){super(),this.unsubscribe=[],this.open=Vl.state.open,this.message=Vl.state.message,this.triggerRect=Vl.state.triggerRect,this.variant=Vl.state.variant,this.unsubscribe.push(Vl.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}
3987disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;const e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=` 3988 --w3m-tooltip-top: ${e}px; 3989 --w3m-tooltip-left: ${t}px; 3990 --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px; 3991 --w3m-tooltip-display: ${this.open?"flex":"none"}; 3992 --w3m-tooltip-opacity: ${this.open?1:0}; 3993 `,le`<wui-flex> 3994 <wui-icon data-placement="top" color="fg-100" size="inherit" name="cursor"></wui-icon> 3995 <wui-text color="inherit" variant="small-500">${this.message}</wui-text> 3996 </wui-flex>`}};_1.styles=[WBe];h4([qe()],_1.prototype,"open",void 0);h4([qe()],_1.prototype,"message",void 0);h4([qe()],_1.prototype,"triggerRect",void 0);h4([qe()],_1.prototype,"variant",void 0);_1=h4([ot("w3m-tooltip"),ot("w3m-tooltip")],_1);const HBe=Mt` 3997 wui-flex { 3998 width: 100%; 3999 } 4000 4001 wui-promo { 4002 position: absolute; 4003 top: -32px; 4004 } 4005 4006 wui-profile-button { 4007 margin-top: calc(-1 * var(--wui-spacing-2l)); 4008 } 4009 4010 wui-promo + wui-profile-button { 4011 margin-top: var(--wui-spacing-2l); 4012 } 4013 4014 wui-tabs { 4015 width: 100%; 4016 } 4017 4018 .contentContainer { 4019 height: 280px; 4020 } 4021 4022 .contentContainer > wui-icon-box { 4023 width: 40px; 4024 height: 40px; 4025 border-radius: var(--wui-border-radius-xxs); 4026 } 4027 4028 .contentContainer > .textContent { 4029 width: 65%; 4030 } 4031`;var yh=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const VBe=48,qBe=430;let au=class extends ut{constructor(){super(),this.unsubscribe=[],this.address=_t.state.address,this.profileName=_t.state.profileName,this.network=ue.state.activeCaipNetwork,this.currentTab=_t.state.currentTab,this.tokenBalance=_t.state.tokenBalance,this.features=Ue.state.features,this.namespace=ue.state.activeChain,this.activeConnectorIds=Ge.state.activeConnectorIds,this.remoteFeatures=Ue.state.remoteFeatures,this.unsubscribe.push(_t.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance):Yn.close()}),Ge.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),ue.subscribeKey("activeChain",e=>this.namespace=e),ue.subscribeKey("activeCaipNetwork",e=>this.network=e),Ue.subscribeKey("features",e=>this.features=e),Ue.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}firstUpdated(){_t.fetchTokenBalance()}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");if(!this.namespace)return null;const e=this.activeConnectorIds[this.namespace],t=e?Ge.getConnectorById(e):void 0,{icon:r,iconSize:i}=this.getAuthData();return le`<wui-flex 4032 flexDirection="column" 4033 .padding=${["0","xl","m","xl"]} 4034 alignItems="center" 4035 gap="m" 4036 data-testid="w3m-account-wallet-features-widget" 4037 > 4038 <wui-flex flexDirection="column" justifyContent="center" alignItems="center" gap="xs"> 4039 <wui-wallet-switch 4040 profileName=${this.profileName} 4041 address=${this.address} 4042 icon=${r} 4043 iconSize=${i} 4044 alt=${t==null?void 0:t.name} 4045 @click=${this.onGoToProfileWalletsView.bind(this)} 4046 data-testid="wui-wallet-switch" 4047 ></wui-wallet-switch> 4048 4049 ${this.tokenBalanceTemplate()} 4050 </wui-flex> 4051 ${this.orderedWalletFeatures()} ${this.tabsTemplate()} ${this.listContentTemplate()} 4052 </wui-flex>`}orderedWalletFeatures(){var r;const e=((r=this.features)==null?void 0:r.walletFeaturesOrder)||sr.DEFAULT_FEATURES.walletFeaturesOrder;return e.every(i=>{var s,o;return i==="send"||i==="receive"?!((s=this.features)!=null&&s[i]):i==="swaps"||i==="onramp"?!((o=this.remoteFeatures)!=null&&o[i]):!0})?null:le`<wui-flex gap="s"> 4053 ${e.map(i=>{switch(i){case"onramp":return this.onrampTemplate();case"swaps":return this.swapsTemplate();
4053case"receive":return this.receiveTemplate();case"send":return this.sendTemplate();default:return null}})} 4054 </wui-flex>`}onrampTemplate(){var t;return((t=this.remoteFeatures)==null?void 0:t.onramp)?le` 4055 <w3m-tooltip-trigger text="Buy"> 4056 <wui-icon-button 4057 data-testid="wallet-features-onramp-button" 4058 @click=${this.onBuyClick.bind(this)} 4059 icon="card" 4060 ></wui-icon-button> 4061 </w3m-tooltip-trigger> 4062 `:null}swapsTemplate(){var r;const e=(r=this.remoteFeatures)==null?void 0:r.swaps,t=ue.state.activeChain===Be.CHAIN.EVM;return!e||!t?null:le` 4063 <w3m-tooltip-trigger text="Swap"> 4064 <wui-icon-button 4065 data-testid="wallet-features-swaps-button" 4066 @click=${this.onSwapClick.bind(this)} 4067 icon="recycleHorizontal" 4068 > 4069 </wui-icon-button> 4070 </w3m-tooltip-trigger> 4071 `}receiveTemplate(){var t;return((t=this.features)==null?void 0:t.receive)?le` 4072 <w3m-tooltip-trigger text="Receive"> 4073 <wui-icon-button 4074 data-testid="wallet-features-receive-button" 4075 @click=${this.onReceiveClick.bind(this)} 4076 icon="arrowBottomCircle" 4077 > 4078 </wui-icon-button> 4079 </w3m-tooltip-trigger> 4080 `:null}sendTemplate(){var i;const e=(i=this.features)==null?void 0:i.send,t=ue.state.activeChain,r=sr.SEND_SUPPORTED_NAMESPACES.includes(t);return!e||!r?null:le` 4081 <w3m-tooltip-trigger text="Send"> 4082 <wui-icon-button 4083 data-testid="wallet-features-send-button" 4084 @click=${this.onSendClick.bind(this)} 4085 icon="send" 4086 ></wui-icon-button> 4087 </w3m-tooltip-trigger> 4088 `}watchSwapValues(){this.watchTokenBalance=setInterval(()=>_t.fetchTokenBalance(e=>this.onTokenBalanceError(e)),1e4)}onTokenBalanceError(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===Be.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE&&clearInterval(this.watchTokenBalance)}listContentTemplate(){return this.currentTab===0?le`<w3m-account-tokens-widget></w3m-account-tokens-widget>`:this.currentTab===1?le`<w3m-account-nfts-widget></w3m-account-nfts-widget>`:this.currentTab===2?le`<w3m-account-activity-widget></w3m-account-activity-widget>`:le`<w3m-account-tokens-widget></w3m-account-tokens-widget>`}tokenBalanceTemplate(){var e;if(this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>=0){const t=tt.calculateBalance(this.tokenBalance),{dollars:r="0",pennies:i="00"}=tt.formatTokenBalance(t);return le`<wui-balance dollars=${r} pennies=${i}></wui-balance>`}return le`<wui-balance dollars="0" pennies="00"></wui-balance>`}tabsTemplate(){const e=CBe.getTabsByNamespace(ue.state.activeChain);if(e.length===0)return null;const t=tt.isMobile()&&window.innerWidth<qBe;let r="104px";return t?r=`${(window.innerWidth-VBe)/e.length}px`:e.length===2?r="156px":r="104px",le`<wui-tabs 4089 .onTabChange=${this.onTabChange.bind(this)} 4090 .activeTab=${this.currentTab} 4091 localTabWidth=${r} 4092 .tabs=${e} 4093 ></wui-tabs>`}onTabChange(e){_t.setCurrentTab(e)}onBuyClick(){it.push("OnRampProviders")}onSwapClick(){var e,t,r;(e=this.network)!=null&&e.caipNetworkId&&!sr.SWAP_SUPPORTED_NETWORKS.includes((t=this.network)==null?void 0:t.caipNetworkId)?it.push("UnsupportedChain",{swapUnsupportedChain:!0}):(xn.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:((r=this.network)==null?void 0:r.caipNetworkId)||"",isSmartAccount:Xs(ue.state.activeChain)===fi.ACCOUNT_TYPES.SMART_ACCOUNT}}),it.push("Swap"))}getAuthData(){const e=wt.getConnectedSocialProvider(),t=wt.getConnectedSocialUsername(),r=Ge.getAuthConnector(),i=(r==null?void 0:r.provider.getEmail())??"";return{name:Xd.getAuthName({email:i,socialUsername:t,socialProvider:e}),icon:e??"mail",iconSize:e?"xl":"md"}}onReceiveClick(){it.push("WalletReceive")}onGoToProfileWalletsView(){it.push("ProfileWallets")}onSendClick(){var e;xn.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:((e=this.network)==null?void 0:e.caipNetworkId)||"",isSmartAccount:Xs(ue.state.activeChain)===fi.ACCOUNT_TYPES.SMART_ACCOUNT}}),it.push("WalletSend")}};au.styles=HBe;yh([qe()],au.prototype,"watchTokenBalance",void 0);yh([qe()],au.prototype,"address",void 0);yh([qe()],au.prototype,"profileName",void 0);yh([qe()],au.prototype,"network",void 0);yh([qe()],au.prototype,"currentTab",void 0);yh([qe()],au.prototype,"tokenBalance",void 0);yh([qe()],au.prototype,"features",void 0);yh([qe()],au.prototype,"namespace",void 0);yh([qe()],au.prototype,"activeConnectorIds",void 0);yh([qe()],au.prototype,"remoteFeatures",void 0);au=yh([ot("w3m-account-wallet-features-widget")],au);var hse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let zN=class extends ut{constructor(){super(),this.unsubscribe=[],this.namespace=ue.state.activeChain,this.unsubscribe.push(ue.subscribeKey("activeChain",e=>{this.namespace=e}))}
4093render(){if(!this.namespace)return null;const e=Ge.getConnectorId(this.namespace),t=Ge.getAuthConnector();return le` 4094 ${t&&e===Be.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()} 4095 `}walletFeaturesTemplate(){return le`<w3m-account-wallet-features-widget></w3m-account-wallet-features-widget>`}defaultTemplate(){return le`<w3m-account-default-widget></w3m-account-default-widget>`}};hse([qe()],zN.prototype,"namespace",void 0);zN=hse([ot("w3m-account-view")],zN);const KBe=Mt` 4096 :host { 4097 position: relative; 4098 background-color: var(--wui-color-gray-glass-002); 4099 display: flex; 4100 justify-content: center; 4101 align-items: center; 4102 width: var(--local-size); 4103 height: var(--local-size); 4104 border-radius: inherit; 4105 border-radius: var(--local-border-radius); 4106 } 4107 4108 :host > wui-flex { 4109 overflow: hidden; 4110 border-radius: inherit; 4111 border-radius: var(--local-border-radius); 4112 } 4113 4114 :host::after { 4115 content: ''; 4116 position: absolute; 4117 top: 0; 4118 bottom: 0; 4119 left: 0; 4120 right: 0; 4121 border-radius: inherit; 4122 border: 1px solid var(--wui-color-gray-glass-010); 4123 pointer-events: none; 4124 } 4125 4126 :host([name='Extension'])::after { 4127 border: 1px solid var(--wui-color-accent-glass-010); 4128 } 4129 4130 :host([data-wallet-icon='allWallets']) { 4131 background-color: var(--wui-all-wallets-bg-100); 4132 } 4133 4134 :host([data-wallet-icon='allWallets'])::after { 4135 border: 1px solid var(--wui-color-accent-glass-010); 4136 } 4137 4138 wui-icon[data-parent-size='inherit'] { 4139 width: 75%; 4140 height: 75%; 4141 align-items: center; 4142 } 4143 4144 wui-icon[data-parent-size='sm'] { 4145 width: 18px; 4146 height: 18px; 4147 } 4148 4149 wui-icon[data-parent-size='md'] { 4150 width: 24px; 4151 height: 24px; 4152 } 4153 4154 wui-icon[data-parent-size='lg'] { 4155 width: 42px; 4156 height: 42px; 4157 } 4158 4159 wui-icon[data-parent-size='full'] { 4160 width: 100%; 4161 height: 100%; 4162 } 4163 4164 :host > wui-icon-box { 4165 position: absolute; 4166 overflow: hidden; 4167 right: -1px; 4168 bottom: -2px; 4169 z-index: 1; 4170 border: 2px solid var(--wui-color-bg-150, #1e1f1f); 4171 padding: 1px; 4172 } 4173`;var ab=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let mg=class extends ut{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return this.size==="lg"?e="m":this.size==="md"?e="xs":e="xxs",this.style.cssText=` 4174 --local-border-radius: var(--wui-border-radius-${e}); 4175 --local-size: var(--wui-wallet-image-size-${this.size}); 4176 `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),le` 4177 <wui-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wui-flex> 4178 `}templateVisual(){return this.imageSrc?le`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:this.walletIcon?le`<wui-icon 4179 data-parent-size="md" 4180 size="md" 4181 color="inherit" 4182 name=${this.walletIcon} 4183 ></wui-icon>`:le`<wui-icon 4184 data-parent-size=${this.size} 4185 size="inherit" 4186 color="inherit" 4187 name="walletPlaceholder" 4188 ></wui-icon>`}};mg.styles=[Jr,Dn,KBe];ab([be()],mg.prototype,"size",void 0);ab([be()],mg.prototype,"name",void 0);ab([be()],mg.prototype,"imageSrc",void 0);ab([be()],mg.prototype,"walletIcon",void 0);ab([be({type:Boolean})],mg.prototype,"installed",void 0);ab([be()],mg.prototype,"badgeSize",void 0);mg=ab([ot("wui-wallet-image")],mg);const YBe=Mt` 4189 wui-image { 4190 width: var(--wui-spacing-2xl); 4191 height: var(--wui-spacing-2xl); 4192 border-radius: var(--wui-border-radius-3xs); 4193 } 4194 4195 wui-image, 4196 .icon-box { 4197 width: var(--wui-spacing-2xl); 4198 height: var(--wui-spacing-2xl); 4199 border-radius: var(--wui-border-radius-3xs); 4200 } 4201 4202 wui-icon:not(.custom-icon, .icon-badge) { 4203 cursor: pointer; 4204 } 4205 4206 .icon-box { 4207 position: relative; 4208 background-color: var(--wui-color-gray-glass-002); 4209 } 4210 4211 .icon-badge { 4212 position: absolute; 4213 top: 18px; 4214 left: 23px; 4215 z-index: 3; 4216 background-color: var(--wui-color-gray-glass-005); 4217 border: 2px solid var(--wui-color-modal-bg); 4218 border-radius: 50%; 4219 padding: var(--wui-spacing-4xs); 4220 } 4221`;var vl=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Ga=class extends ut{constructor(){super(...arguments),this.address="",this.profileName="",this.content=[],this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadge=void 0,this.iconBadgeSize="md",this.buttonVariant="neutral",this.enableMoreButton=!1,this.charsStart=4,this.charsEnd=6}render(){return le` 4222 <wui-flex flexDirection="column" rowGap="xs"> 4223 ${this.topTemplate()} ${this.bottomTemplate()} 4224 </wui-flex> 4225 `}topTemplate(){return le` 4226 <wui-flex alignItems="flex-start" justifyContent="space-between"> 4227 ${this.imageOrIconTemplate()} 4228 <wui-icon-link 4229 iconColor="fg-200" 4230 size="sm" 4231 icon="copy" 4232 @click=${this.dispatchCopyEvent} 4233 ></wui-icon-link> 4234 <wui-icon-link 4235 iconColor="fg-200" 4236 size="sm" 4237 icon="externalLink" 4238 @click=${this.dispatchExternalLinkEvent} 4239 ></wui-icon-link> 4240 ${this.enableMoreButton?le`<wui-icon-link 4241 iconColor="fg-200" 4242 size="sm" 4243 icon="threeDots" 4244 @click=${this.dispatchMoreButtonEvent} 4245 data-testid="wui-active-profile-wallet-item-more-button" 4246 ></wui-icon-link>`:null} 4247 </wui-flex> 4248 `}bottomTemplate(){return le` <wui-flex flexDirection="column">${this.contentTemplate()}</wui-flex> `}imageOrIconTemplate(){return this.icon?le` 4249 <wui-flex flexGrow="1" alignItems="center"> 4250 <wui-flex alignItems="center" justifyContent="center" class="icon-box"> 4251 <wui-icon 4252 size=${this.iconSize} 4253 color="fg-200" 4254 name=${this.icon} 4255 class="custom-icon" 4256 ></wui-icon> 4257 4258 ${this.iconBadge?le`<wui-icon 4259 color="fg-175" 4260 size=${this.iconBadgeSize} 4261 name=${this.iconBadge} 4262 class="icon-badge" 4263 ></wui-icon>`:null} 4264 </wui-flex> 4265 </wui-flex> 4266 `:le` 4267 <wui-flex flexGrow="1" alignItems="center"> 4268 <wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image> 4269 </wui-flex> 4270 `}contentTemplate(){return this.content.length===0?null:le` 4271 <wui-flex flexDirection="column" rowGap="s"> 4272 ${this.content.map(e=>this.labelAndTagTemplate(e))} 4273 </wui-flex> 4274 `}
4274labelAndTagTemplate({address:e,profileName:t,label:r,description:i,enableButton:s,buttonType:o,buttonLabel:a,buttonVariant:c,tagVariant:u,tagLabel:d,alignItems:f="flex-end"}){return le` 4275 <wui-flex justifyContent="space-between" alignItems=${f} columnGap="3xs"> 4276 <wui-flex flexDirection="column" rowGap="4xs"> 4277 ${r?le`<wui-text variant="micro-600" color="fg-200">${r}</wui-text>`:null} 4278 4279 <wui-flex alignItems="center" columnGap="3xs"> 4280 <wui-text variant="small-500" color="fg-100"> 4281 ${zi.getTruncateString({string:t||e,charsStart:t?16:this.charsStart,charsEnd:t?0:this.charsEnd,truncate:t?"end":"middle"})} 4282 </wui-text> 4283 4284 ${u&&d?le`<wui-tag variant=${u} size="xs">${d}</wui-tag>`:null} 4285 </wui-flex> 4286 4287 ${i?le`<wui-text variant="tiny-500" color="fg-200">${i}</wui-text>`:null} 4288 </wui-flex> 4289 4290 ${s?this.buttonTemplate({buttonType:o,buttonLabel:a,buttonVariant:c}):null} 4291 </wui-flex> 4292 `}buttonTemplate({buttonType:e,buttonLabel:t,buttonVariant:r}){return le` 4293 <wui-button 4294 size="xs" 4295 variant=${r} 4296 @click=${e==="disconnect"?this.dispatchDisconnectEvent.bind(this):this.dispatchSwitchEvent.bind(this)} 4297 data-testid=${e==="disconnect"?"wui-active-profile-wallet-item-disconnect-button":"wui-active-profile-wallet-item-switch-button"} 4298 > 4299 ${t} 4300 </wui-button> 4301 `}dispatchDisconnectEvent(){this.dispatchEvent(new CustomEvent("disconnect",{bubbles:!0,composed:!0}))}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("switch",{bubbles:!0,composed:!0}))}dispatchExternalLinkEvent(){this.dispatchEvent(new CustomEvent("externalLink",{bubbles:!0,composed:!0}))}dispatchMoreButtonEvent(){this.dispatchEvent(new CustomEvent("more",{bubbles:!0,composed:!0}))}dispatchCopyEvent(){this.dispatchEvent(new CustomEvent("copy",{bubbles:!0,composed:!0}))}};Ga.styles=[Dn,Jr,YBe];vl([be()],Ga.prototype,"address",void 0);vl([be()],Ga.prototype,"profileName",void 0);vl([be({type:Array})],Ga.prototype,"content",void 0);vl([be()],Ga.prototype,"alt",void 0);vl([be()],Ga.prototype,"imageSrc",void 0);vl([be()],Ga.prototype,"icon",void 0);vl([be()],Ga.prototype,"iconSize",void 0);vl([be()],Ga.prototype,"iconBadge",void 0);vl([be()],Ga.prototype,"iconBadgeSize",void 0);vl([be()],Ga.prototype,"buttonVariant",void 0);vl([be({type:Boolean})],Ga.prototype,"enableMoreButton",void 0);vl([be({type:Number})],Ga.prototype,"charsStart",void 0);vl([be({type:Number})],Ga.prototype,"charsEnd",void 0);Ga=vl([ot("wui-active-profile-wallet-item")],Ga);const GBe=Mt` 4302 wui-image, 4303 .icon-box { 4304 width: var(--wui-spacing-2xl); 4305 height: var(--wui-spacing-2xl); 4306 border-radius: var(--wui-border-radius-3xs); 4307 } 4308 4309 .right-icon { 4310 cursor: pointer; 4311 } 4312 4313 .icon-box { 4314 position: relative; 4315 background-color: var(--wui-color-gray-glass-002); 4316 } 4317 4318 .icon-badge { 4319 position: absolute; 4320 top: 18px; 4321 left: 23px; 4322 z-index: 3; 4323 background-color: var(--wui-color-gray-glass-005); 4324 border: 2px solid var(--wui-color-modal-bg); 4325 border-radius: 50%; 4326 padding: var(--wui-spacing-4xs); 4327 } 4328`;var Xa=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Bo=class extends ut{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.buttonLabel="",this.buttonVariant="accent",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadgeSize="md",this.rightIcon="off",this.rightIconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return le` 4329 <wui-flex alignItems="center" columnGap="xs"> 4330 ${this.imageOrIconTemplate()} ${this.labelAndDescriptionTemplate()} 4331 ${this.buttonActionTemplate()} 4332 </wui-flex> 4333 `}imageOrIconTemplate(){return this.icon?le` 4334 <wui-flex alignItems="center" justifyContent="center" class="icon-box"> 4335 <wui-flex alignItems="center" justifyContent="center" class="icon-box"> 4336 <wui-icon 4337 size=${this.iconSize} 4338 color="fg-200" 4339 name=${this.icon} 4340 class="custom-icon" 4341 ></wui-icon> 4342 ${this.iconBadge?le`<wui-icon 4343 color="fg-175" 4344 size=${this.iconBadgeSize} 4345 name=${this.iconBadge} 4346 class="icon-badge" 4347 ></wui-icon>`:null} 4348 </wui-flex> 4349 </wui-flex> 4350 `:le`<wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>`}labelAndDescriptionTemplate(){return le` 4351 <wui-flex 4352 flexDirection="column" 4353 flexGrow="1" 4354 justifyContent="flex-start" 4355 alignItems="flex-start" 4356 > 4357 <wui-text variant="small-500" color="fg-100"> 4358 ${zi.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})} 4359 </wui-text> 4360 </wui-flex> 4361 `}buttonActionTemplate(){return le` 4362 <wui-flex columnGap="3xs" alignItems="center" justifyContent="center"> 4363 <wui-button 4364 size="xs" 4365 variant=${this.buttonVariant} 4366 .loading=${this.loading} 4367 @click=${this.handleButtonClick} 4368 data-testid="wui-inactive-profile-wallet-item-button" 4369 > 4370 ${this.buttonLabel} 4371 </wui-button>
4371 4372 4373 <wui-icon-link 4374 iconColor="fg-200" 4375 size=${this.rightIconSize} 4376 icon=${this.rightIcon} 4377 class="right-icon" 4378 @click=${this.handleIconClick} 4379 ></wui-icon-link> 4380 </wui-flex> 4381 `}handleButtonClick(){this.dispatchEvent(new CustomEvent("buttonClick",{bubbles:!0,composed:!0}))}handleIconClick(){this.dispatchEvent(new CustomEvent("iconClick",{bubbles:!0,composed:!0}))}};Bo.styles=[Dn,Jr,GBe];Xa([be()],Bo.prototype,"address",void 0);Xa([be()],Bo.prototype,"profileName",void 0);Xa([be()],Bo.prototype,"alt",void 0);Xa([be()],Bo.prototype,"buttonLabel",void 0);Xa([be()],Bo.prototype,"buttonVariant",void 0);Xa([be()],Bo.prototype,"imageSrc",void 0);Xa([be()],Bo.prototype,"icon",void 0);Xa([be()],Bo.prototype,"iconSize",void 0);Xa([be()],Bo.prototype,"iconBadge",void 0);Xa([be()],Bo.prototype,"iconBadgeSize",void 0);Xa([be()],Bo.prototype,"rightIcon",void 0);Xa([be()],Bo.prototype,"rightIconSize",void 0);Xa([be({type:Boolean})],Bo.prototype,"loading",void 0);Xa([be({type:Number})],Bo.prototype,"charsStart",void 0);Xa([be({type:Number})],Bo.prototype,"charsEnd",void 0);Bo=Xa([ot("wui-inactive-profile-wallet-item")],Bo);const ZBe=Mt` 4382 :host { 4383 position: relative; 4384 display: flex; 4385 width: 100%; 4386 height: 1px; 4387 background-color: var(--wui-color-gray-glass-005); 4388 justify-content: center; 4389 align-items: center; 4390 } 4391 4392 :host > wui-text { 4393 position: absolute; 4394 padding: 0px 10px; 4395 background-color: var(--wui-color-modal-bg); 4396 transition: background-color var(--wui-duration-lg) var(--wui-ease-out-power-1); 4397 will-change: background-color; 4398 } 4399`;var fse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let FN=class extends ut{constructor(){super(...arguments),this.text=""}render(){return le`${this.template()}`}template(){return this.text?le`<wui-text variant="small-500" color="fg-200">${this.text}</wui-text>`:null}};FN.styles=[Dn,ZBe];fse([be()],FN.prototype,"text",void 0);FN=fse([ot("wui-separator")],FN);const e9={getAuthData(n){var o,a;const e=n.connectorId===Be.CONNECTOR_ID.AUTH;if(!e)return{isAuth:!1,icon:void 0,iconSize:void 0,name:void 0};const t=((o=n==null?void 0:n.auth)==null?void 0:o.name)??wt.getConnectedSocialProvider(),r=((a=n==null?void 0:n.auth)==null?void 0:a.username)??wt.getConnectedSocialUsername(),i=Ge.getAuthConnector(),s=(i==null?void 0:i.provider.getEmail())??"";return{isAuth:!0,icon:t??"mail",iconSize:t?"xl":"md",name:e?Xd.getAuthName({email:s,socialUsername:r,socialProvider:t}):void 0}}},QBe=Mt` 4400 :host { 4401 --connect-scroll--top-opacity: 0; 4402 --connect-scroll--bottom-opacity: 0; 4403 } 4404 4405 .balance-amount { 4406 flex: 1; 4407 } 4408 4409 .wallet-list { 4410 scrollbar-width: none; 4411 overflow-y: scroll; 4412 overflow-x: hidden; 4413 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 4414 will-change: opacity; 4415 mask-image: linear-gradient( 4416 to bottom, 4417 rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px, 4418 rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px, 4419 black 40px, 4420 black calc(100% - 40px), 4421 rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px), 4422 rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100% 4423 ); 4424 } 4425 4426 .active-wallets { 4427 background-color: var(--wui-color-gray-glass-002); 4428 border-radius: var(--wui-border-radius-xs); 4429 } 4430 4431 .active-wallets-box { 4432 height: 330px; 4433 } 4434 4435 .empty-wallet-list-box { 4436 height: 400px; 4437 } 4438 4439 .empty-box { 4440 width: 100%; 4441 padding: var(--wui-spacing-l); 4442 background-color: var(--wui-color-gray-glass-002); 4443 border-radius: var(--wui-border-radius-xs); 4444 } 4445 4446 wui-separator { 4447 margin: var(--wui-spacing-xs) 0 var(--wui-spacing-xs) 0; 4448 } 4449 4450 .active-connection { 4451 padding: var(--wui-spacing-xs); 4452 } 4453 4454 .recent-connection { 4455 padding: var(--wui-spacing-xs) 0 var(--wui-spacing-xs) 0; 4456 } 4457 4458 @media (max-width: 430px) { 4459 .active-wallets-box, 4460 .empty-wallet-list-box { 4461 height: auto; 4462 max-height: clamp(360px, 470px, 80vh); 4463 } 4464 } 4465`;var xl=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const XBe=16,JBe=4,Ru={ADDRESS_DISPLAY:{START:4,END:6},BADGE:{SIZE:"md",ICON:"lightbulb"},SCROLL_THRESHOLD:50,OPACITY_RANGE:[0,1]},BS={eip155:"ethereum",solana:"solana",bip122:"bitcoin"},BY=[{namespace:"eip155",icon:BS.eip155,label:"EVM"},{namespace:"solana",icon:BS.solana,label:"Solana"},{namespace:"bip122",icon:BS.bip122,label:"Bitcoin"}],eLe={eip155:{title:"Add EVM Wallet",description:"Add your first EVM wallet"},solana:{title:"Add Solana Wallet",description:"Add your first Solana wallet"},bip122:{title:"Add Bitcoin Wallet",description:"Add your first Bitcoin wallet"}};let da=class extends ut{constructor(){var e,t;super(),this.unsubscribers=[],this.currentTab=0,this.namespace=ue.state.activeChain,this.namespaces=Array.from(ue.state.chains.keys()),this.caipAddress=void 0,this.profileName=void 0,this.activeConnectorIds=Ge.state.activeConnectorIds,this.lastSelectedAddress="",this.lastSelectedConnectorId="",this.isSwitching=!1,this.caipNetwork=ue.state.activeCaipNetwork,this.user=_t.state.user,this.remoteFeatures=Ue.state.remoteFeatures,this.tabWidth="",this.currentTab=this.namespace?this.namespaces.indexOf(this.namespace):0,this.caipAddress=(e=ue.getAccountData(this.namespace))==null?void 0:e.caipAddress,this.profileName=(t=ue.getAccountData(this.namespace))==null?void 0:t.profileName,this.unsubscribers.push(nt.subscribeKey("connections",()=>this.onConnectionsChange()),nt.subscribeKey("recentConnections",()=>this.requestUpdate()),Ge.subscribeKey("activeConnectorIds",r=>{this.activeConnectorIds=r}),ue.subscribeKey("activeCaipNetwork",r=>this.caipNetwork=r),_t.subscribeKey("user",r=>this.user=r),Ue.subscribeKey("remoteFeatures",r=>this.remoteFeatures=r)),this.chainListener=ue.subscribeChainProp("accountState",r=>{this.caipAddress=r==null?void 0:r.caipAddress,this.profileName=r==null?void 0:r.profileName},this.namespace)}disconnectedCallback(){var e,t,r;
4465this.unsubscribers.forEach(i=>i()),(e=this.resizeObserver)==null||e.disconnect(),(t=this.tabsResizeObserver)==null||t.disconnect(),this.removeScrollListener(),(r=this.chainListener)==null||r.call(this)}firstUpdated(){var i,s;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".wallet-list"),t=(s=this.shadowRoot)==null?void 0:s.querySelector("wui-tabs");if(!e)return;const r=()=>this.updateScrollOpacity(e);if(requestAnimationFrame(r),e.addEventListener("scroll",r),this.resizeObserver=new ResizeObserver(r),this.resizeObserver.observe(e),r(),t){const o=()=>{var u;const c=BY.filter(d=>this.namespaces.includes(d.namespace)).length;if(c>1){const d=(u=this.getBoundingClientRect())==null?void 0:u.width,f=JBe*2,m=XBe*2,y=(d-m-f)/c;this.tabWidth=`${y}px`,this.requestUpdate()}};this.tabsResizeObserver=new ResizeObserver(o),this.tabsResizeObserver.observe(this),o()}}render(){const e=this.namespace;if(!e)throw new Error("Namespace is not set");return le` 4466 <wui-flex flexDirection="column" .padding=${["0","l","l","l"]} gap="l"> 4467 ${this.renderTabs()} ${this.renderHeader(e)} ${this.renderConnections(e)} 4468 ${this.renderAddConnectionButton(e)} 4469 </wui-flex> 4470 `}renderTabs(){const e=BY.filter(r=>this.namespaces.includes(r.namespace));return e.length>1?le` 4471 <wui-tabs 4472 .onTabChange=${r=>this.handleTabChange(r)} 4473 .activeTab=${this.currentTab} 4474 localTabWidth=${this.tabWidth} 4475 .tabs=${e} 4476 ></wui-tabs> 4477 `:null}renderHeader(e){const r=this.getActiveConnections(e).flatMap(({accounts:i})=>i).length+(this.caipAddress?1:0);return le` 4478 <wui-flex alignItems="center" columnGap="3xs"> 4479 <wui-icon 4480 name=${BS[e]??BS.eip155} 4481 size="lg" 4482 ></wui-icon> 4483 <wui-text color="fg-200" variant="small-400" 4484 >${r>1?"Wallets":"Wallet"}</wui-text 4485 > 4486 <wui-text 4487 color="fg-100" 4488 variant="small-400" 4489 class="balance-amount" 4490 data-testid="balance-amount" 4491 > 4492 ${r} 4493 </wui-text> 4494 <wui-link 4495 color="fg-200" 4496 @click=${()=>nt.disconnect({namespace:e})} 4497 ?disabled=${!this.hasAnyConnections(e)} 4498 data-testid="disconnect-all-button" 4499 > 4500 Disconnect All 4501 </wui-link> 4502 </wui-flex> 4503 `}renderConnections(e){const t=this.hasAnyConnections(e);return le` 4504 <wui-flex flexDirection="column" class=${Y_({"wallet-list":!0,"active-wallets-box":t,"empty-wallet-list-box":!t})} rowGap="s"> 4505 ${t?this.renderActiveConnections(e):this.renderEmptyState(e)} 4506 </wui-flex> 4507 `}renderActiveConnections(e){const t=this.getActiveConnections(e),r=this.activeConnectorIds[e],i=this.getPlainAddress();return le` 4508 ${i||r||t.length>0?le`<wui-flex 4509 flexDirection="column" 4510 .padding=${["l","0","xs","0"]} 4511 class="active-wallets" 4512 > 4513 ${this.renderActiveProfile(e)} ${this.renderActiveConnectionsList(e)} 4514 </wui-flex>`:null} 4515 ${this.renderRecentConnections(e)} 4516 `}renderActiveProfile(e){const t=this.activeConnectorIds[e];if(!t)return null;const{connections:r}=ju.getConnectionsData(e),i=Ge.getConnectorById(t),s=Hr.getConnectorImage(i),o=this.getPlainAddress();if(!o)return null;const a=e===Be.CHAIN.BITCOIN,c=e9.getAuthData({connectorId:t,accounts:[]}),u=this.getActiveConnections(e).flatMap(m=>m.accounts).length>0,d=r.find(m=>m.connectorId===t),f=d==null?void 0:d.accounts.filter(m=>!xi.isLowerCaseMatch(m.address,o));return le` 4517 <wui-flex flexDirection="column" .padding=${["0","l","0","l"]}> 4518 <wui-active-profile-wallet-item 4519 address=${o} 4520 alt=${i==null?void 0:i.name} 4521 .content=${this.getProfileContent({address:o,connections:r,connectorId:t,namespace:e})} 4522 .charsStart=${Ru.ADDRESS_DISPLAY.START} 4523 .charsEnd=${Ru.ADDRESS_DISPLAY.END} 4524 .icon=${c.icon} 4525 .iconSize=${c.iconSize} 4526 .iconBadge=${this.isSmartAccount(o)?Ru.BADGE.ICON:void 0} 4527 .iconBadgeSize=${this.isSmartAccount(o)?Ru.BADGE.SIZE:void 0} 4528 imageSrc=${s} 4529 ?enableMoreButton=${c.isAuth} 4530 @copy=${()=>this.handleCopyAddress(o)} 4531 @disconnect=${()=>this.handleDisconnect(e,{id:t})} 4532 @switch=${()=>{a&&d&&(f!=null&&f[0])&&this.handleSwitchWallet(d,f[0].address,e)}} 4533 @externalLink=${()=>this.handleExternalLink(o)} 4534 @more=${()=>this.handleMore()} 4535 data-testid="wui-active-profile-wallet-item" 4536 ></wui-active-profile-wallet-item> 4537 ${u?le`<wui-separator></wui-separator>`:null} 4538 </wui-flex> 4539 `}renderActiveConnectionsList(e){const t=this.getActiveConnections(e);return t.length===0?null:le` 4540 <wui-flex flexDirection="column" .padding=${["0","xs","0","xs"]}> 4541 ${this.renderConnectionList(t,!1,e)} 4542 </wui-flex> 4543 `}renderRecentConnections(e){const{recentConnections:t}=ju.getConnectionsData(e);return t.flatMap(i=>i.accounts).length===0?null:le` 4544 <wui-flex flexDirection="column" .padding=${["0","xs","0","xs"]} rowGap="xs"> 4545 <wui-text color="fg-200" variant="micro-500" data-testid="recently-connected-text" 4546 >RECENTLY CONNECTED</wui-text 4547 > 4548 <wui-flex flexDirection="column" .padding=${["0","xs","0","xs"]}> 4549 ${this.renderConnectionList(t,!0,e)} 4550 </wui-flex> 4551 </wui-flex> 4552 `}renderConnectionList(e,t,r){return e.filter(i=>i.accounts.length>0).map((i,s)=>{const o=Ge.getConnectorById(i.connectorId),a=Hr.getConnectorImage(o)??"",c=e9.getAuthData(i);return i.accounts.map((u,d)=>{const f=s!==0||d!==0,m=this.isAccountLoading(i.connectorId,u.address);return le` 4553 <wui-flex flexDirection="column"> 4554 ${f?le`<wui-separator></wui-separator>`:null} 4555 <wui-inactive-profile-wallet-item 4556 address=${u.address} 4557 alt=${i.connectorId} 4558 buttonLabel=${t?"Connect":"Switch"} 4559 buttonVariant=${t?"neutral":"accent"} 4560 rightIcon=${t?"bin":"off"} 4561 rightIconSize="sm" 4562 class=${t?"recent-connection":"active-connection"} 4563 data-testid=${t?"recent-connection":"active-connection"} 4564 imageSrc=${a} 4565 .iconBadge=${this.isSmartAccount(u.address)?Ru.BADGE.ICON:void 0} 4566 .iconBadgeSize=${this.isSmartAccount(u.address)?Ru.BADGE.SIZE:void 0} 4567 .icon=${c.icon} 4568 .iconSize=${c.iconSize} 4569 .loading=${m} 4570 .showBalance=${!1} 4571 .charsStart=${Ru.ADDRESS_DISPLAY.START} 4572 .charsEnd=${Ru.ADDRESS_DISPLAY.END} 4573 @buttonClick=${()=>this.handleSwitchWallet(i,u.address,r)} 4574 @iconClick=${()=>this.handleWalletAction({connection:i,address:u.address,isRecentConnection:t,namespace:r})} 4575 ></wui-inactive-profile-wallet-item> 4576 </wui-flex> 4577 `})})}renderAddConnectionButton(e){if(!this.isMultiWalletEnabled()&&this.caipAddress||!this.hasAnyConnections(e))return null;const{title:t}=this.getChainLabelInfo(e);return le` 4578 <wui-list-item 4579 variant="icon" 4580 iconVariant="overlay" 4581 icon="plus" 4582 iconSize="sm" 4583 ?chevron=${!0} 4584 @click=${()=>this.handleAddConnection(e)} 4585 data-testid="add-connection-button" 4586 > 4587 <wui-text variant="paragraph-500" color="fg-200">${t}</wui-text> 4588 </wui-list-item> 4589 `}renderEmptyState(e){const{title:t,description:r}=this.getChainLabelInfo(e);return le` 4590 <wui-flex alignItems="flex-start" class="empty-template" data-testid="empty-template"> 4591 <wui-flex 4592 flexDirection="column" 4593 alignItems="center" 4594 justifyContent="center" 4595 rowGap="s" 4596 class="empty-box" 4597 > 4598 <wui-icon-box 4599 size="lg" 4600 icon="wallet" 4601 background="gray" 4602 iconColor="fg-200" 4603 backgroundColor="glass-002" 4604 ></wui-icon-box> 4605 4606 <wui-flex flexDirection="column" alignItems="center" justifyContent="center" gap="3xs"> 4607 <wui-text color="fg-100" variant="paragraph-500" data-testid="empty-state-text" 4608 >No wallet connected</wui-text 4609 > 4610 <wui-text color="fg-200" variant="tiny-500" data-testid="empty-state-description" 4611 >${r}</wui-text 4612 > 4613 </wui-flex> 4614 4615 <wui-button 4616 variant="neutral" 4617 size="md" 4618 @click=${()=>this.handleAddConnection(e)} 4619 data-testid="empty-state-button" 4620 > 4621 <wui-icon color="inherit" slot="iconLeft" name="plus"></wui-icon> 4622 ${t} 4623 </wui-button>
4623 4624 </wui-flex> 4625 </wui-flex> 4626 `}handleTabChange(e){var r,i,s;const t=this.namespaces[e];t&&((r=this.chainListener)==null||r.call(this),this.currentTab=this.namespaces.indexOf(t),this.namespace=t,this.caipAddress=(i=ue.getAccountData(t))==null?void 0:i.caipAddress,this.profileName=(s=ue.getAccountData(t))==null?void 0:s.profileName,this.chainListener=ue.subscribeChainProp("accountState",o=>{this.caipAddress=o==null?void 0:o.caipAddress},t))}async handleSwitchWallet(e,t,r){try{this.isSwitching=!0,this.lastSelectedConnectorId=e.connectorId,this.lastSelectedAddress=t,await nt.switchConnection({connection:e,address:t,namespace:r,closeModalOnConnect:!1,onChange({hasSwitchedAccount:i,hasSwitchedWallet:s}){s?Ir.showSuccess("Wallet switched"):i&&Ir.showSuccess("Account switched")}})}catch{Ir.showError("Failed to switch wallet")}finally{this.isSwitching=!1}}handleWalletAction(e){const{connection:t,address:r,isRecentConnection:i,namespace:s}=e;i?(wt.deleteAddressFromConnection({connectorId:t.connectorId,address:r,namespace:s}),nt.syncStorageConnections(),Ir.showSuccess("Wallet deleted")):this.handleDisconnect(s,{id:t.connectorId})}async handleDisconnect(e,{id:t}){try{await nt.disconnect({id:t,namespace:e}),Ir.showSuccess("Wallet disconnected")}catch{Ir.showError("Failed to disconnect wallet")}}handleCopyAddress(e){tt.copyToClopboard(e),Ir.showSuccess("Address copied")}handleMore(){it.push("AccountSettings")}handleExternalLink(e){var r,i;const t=(i=(r=this.caipNetwork)==null?void 0:r.blockExplorers)==null?void 0:i.default.url;t&&tt.openHref(`${t}/address/${e}`,"_blank")}handleAddConnection(e){Ge.setFilterByNamespace(e),it.push("Connect")}getChainLabelInfo(e){return eLe[e]??{title:"Add Wallet",description:"Add your first wallet"}}isSmartAccount(e){var r,i;if(!this.namespace)return!1;const t=(i=(r=this.user)==null?void 0:r.accounts)==null?void 0:i.find(s=>s.type==="smartAccount");return t&&e?xi.isLowerCaseMatch(t.address,e):!1}getPlainAddress(){return this.caipAddress?tt.getPlainAddress(this.caipAddress):void 0}getActiveConnections(e){const t=this.activeConnectorIds[e],{connections:r}=ju.getConnectionsData(e),[i]=r.filter(c=>xi.isLowerCaseMatch(c.connectorId,t));if(!t)return r;const s=e===Be.CHAIN.BITCOIN,{address:o}=this.caipAddress?Ha.parseCaipAddress(this.caipAddress):{};let a=[...o?[o]:[]];return s&&i&&(a=i.accounts.map(c=>c.address)||[]),ju.excludeConnectorAddressFromConnections({connectorId:t,addresses:a,connections:r})}hasAnyConnections(e){const t=this.getActiveConnections(e),{recentConnections:r}=ju.getConnectionsData(e);return!!this.caipAddress||t.length>0||r.length>0}isAccountLoading(e,t){return xi.isLowerCaseMatch(this.lastSelectedConnectorId,e)&&xi.isLowerCaseMatch(this.lastSelectedAddress,t)&&this.isSwitching}getProfileContent(e){const{address:t,connections:r,connectorId:i,namespace:s}=e,[o]=r.filter(c=>xi.isLowerCaseMatch(c.connectorId,i));if(s===Be.CHAIN.BITCOIN&&(o!=null&&o.accounts.every(c=>typeof c.type=="string")))return this.getBitcoinProfileContent(o.accounts,t);const a=e9.getAuthData({connectorId:i,accounts:[]});return[{address:t,tagLabel:"Active",tagVariant:"success",enableButton:!0,profileName:this.profileName,buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral",...a.isAuth?{description:this.isSmartAccount(t)?"Smart Account":"EOA Account"}:{}}]}getBitcoinProfileContent(e,t){const r=e.length>1,i=this.getPlainAddress();return e.map(s=>{const o=xi.isLowerCaseMatch(s.address,i);let a="PAYMENT";return s.type==="ordinal"&&(a="ORDINALS"),{address:s.address,tagLabel:xi.isLowerCaseMatch(s.address,t)?"Active":void 0,tagVariant:xi.isLowerCaseMatch(s.address,t)?"success":void 0,enableButton:!0,...r?{label:a,alignItems:"flex-end",buttonType:o?"disconnect":"switch",buttonLabel:o?"Disconnect":"Switch",buttonVariant:o?"neutral":"accent"}:{alignItems:"center",buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral"}}})}removeScrollListener(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".wallet-list");e&&e.removeEventListener("scroll",()=>this.handleConnectListScroll())}handleConnectListScroll(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".wallet-list");e&&this.updateScrollOpacity(e)}isMultiWalletEnabled(){var e;return!!((e=this.remoteFeatures)!=null&&e.multiWallet)}updateScrollOpacity(e){e.style.setProperty("--connect-scroll--top-opacity",dN.interpolate([0,Ru.SCROLL_THRESHOLD],Ru.OPACITY_RANGE,e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",dN.interpolate([0,Ru.SCROLL_THRESHOLD],Ru.OPACITY_RANGE,e.scrollHeight-e.scrollTop-e.offsetHeight).toString())}onConnectionsChange(){if(this.isMultiWalletEnabled()&&this.namespace){const{connections:e}=ju.getConnectionsData(this.namespace);e.length===0&&it.reset("ProfileWallets")}this.requestUpdate()}};da.styles=QBe;xl([qe()],da.prototype,"currentTab",void 0);xl([qe()],da.prototype,"namespace",void 0);xl([qe()],da.prototype,"namespaces",void 0);xl([qe()],da.prototype,"caipAddress",void 0);xl([qe()],da.prototype,"profileName",void 0);xl([qe()],da.prototype,"activeConnectorIds",void 0);xl([qe()],da.prototype,"lastSelectedAddress",void 0);xl([qe()],da.prototype,"lastSelectedConnectorId",void 0);xl([qe()],da.prototype,"isSwitching",void 0);xl([qe()],da.prototype,"caipNetwork",void 0);xl([qe()],da.prototype,"user",void 0);xl([qe()],da.prototype,"remoteFeatures",void 0);xl([qe()],da.prototype,"tabWidth",void 0);da=xl([ot("w3m-profile-wallets-view")],da);/** 4627 * @license 4628 * Copyright 2020 Google LLC 4629 * SPDX-License-Identifier: BSD-3-Clause 4630 */const f4=()=>new tLe;let tLe=class{};const t9=new WeakMap,p4=HU(class extends use{render(n){return Gs}update(n,[e]){var r;const t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(r=n.options)==null?void 0:r.host,this.rt(this.ct=n.element)),Gs}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=t9.get(e);t===void 0&&(t=new WeakMap,t9.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,n),n!==void 0&&this.G.call(this.ht,n)}else this.G.value=n}get lt(){var n,e;return typeof this.G=="function"?(n=t9.get(this.ht??globalThis))==null?void 0:n.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),nLe=Mt` 4631 :host { 4632 display: flex; 4633 align-items: center; 4634 justify-content: center; 4635 } 4636 4637 label { 4638 position: relative; 4639 display: inline-block; 4640 width: 32px; 4641 height: 22px; 4642 } 4643 4644 input { 4645 width: 0; 4646 height: 0; 4647 opacity: 0; 4648 } 4649 4650 span { 4651 position: absolute; 4652 cursor: pointer; 4653 top: 0; 4654 left: 0; 4655 right: 0; 4656 bottom: 0; 4657 background-color: var(--wui-color-blue-100); 4658 border-width: 1px; 4659 border-style: solid; 4660 border-color: var(--wui-color-gray-glass-002); 4661 border-radius: 999px; 4662 transition: 4663 background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), 4664 border-color var(--wui-ease-inout-power-1) var(--wui-duration-md); 4665 will-change: background-color, border-color; 4666 } 4667 4668 span:before { 4669 position: absolute; 4670 content: ''; 4671 height: 16px; 4672 width: 16px; 4673 left: 3px; 4674 top: 2px; 4675 background-color: var(--wui-color-inverse-100); 4676 transition: transform var(--wui-ease-inout-power-1) var(--wui-duration-lg); 4677 will-change: transform; 4678 border-radius: 50%; 4679 } 4680 4681 input:checked + span { 4682 border-color: var(--wui-color-gray-glass-005); 4683 background-color: var(--wui-color-blue-100); 4684 } 4685 4686 input:not(:checked) + span { 4687 background-color: var(--wui-color-gray-glass-010); 4688 } 4689 4690 input:checked + span:before { 4691 transform: translateX(calc(100% - 7px)); 4692 } 4693`;var pse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let WN=class extends ut{constructor(){super(...arguments),this.inputElementRef=f4(),this.checked=void 0}render(){return le` 4694 <label> 4695 <input 4696 ${p4(this.inputElementRef)} 4697 type="checkbox" 4698 ?checked=${Nt(this.checked)} 4699 @change=${this.dispatchChangeEvent.bind(this)} 4700 />
4701 <span></span> 4702 </label> 4703 `}dispatchChangeEvent(){var e;this.dispatchEvent(new CustomEvent("switchChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.checked,bubbles:!0,composed:!0}))}};WN.styles=[Dn,Jr,J8,nLe];pse([be({type:Boolean})],WN.prototype,"checked",void 0);WN=pse([ot("wui-switch")],WN);const rLe=Mt` 4704 :host { 4705 height: 100%; 4706 } 4707 4708 button { 4709 display: flex; 4710 align-items: center; 4711 justify-content: center; 4712 column-gap: var(--wui-spacing-1xs); 4713 padding: var(--wui-spacing-xs) var(--wui-spacing-s); 4714 background-color: var(--wui-color-gray-glass-002); 4715 border-radius: var(--wui-border-radius-xs); 4716 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 4717 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); 4718 will-change: background-color; 4719 cursor: pointer; 4720 } 4721 4722 wui-switch { 4723 pointer-events: none; 4724 } 4725`;var gse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let HN=class extends ut{constructor(){super(...arguments),this.checked=void 0}render(){return le` 4726 <button> 4727 <wui-icon size="xl" name="walletConnectBrown"></wui-icon> 4728 <wui-switch ?checked=${Nt(this.checked)}></wui-switch> 4729 </button> 4730 `}};HN.styles=[Dn,Jr,rLe];gse([be({type:Boolean})],HN.prototype,"checked",void 0);HN=gse([ot("wui-certified-switch")],HN);const iLe=Mt` 4731 button { 4732 background-color: var(--wui-color-fg-300); 4733 border-radius: var(--wui-border-radius-4xs); 4734 width: 16px; 4735 height: 16px; 4736 } 4737 4738 button:disabled { 4739 background-color: var(--wui-color-bg-300); 4740 } 4741 4742 wui-icon { 4743 color: var(--wui-color-bg-200) !important; 4744 } 4745 4746 button:focus-visible { 4747 background-color: var(--wui-color-fg-250); 4748 border: 1px solid var(--wui-color-accent-100); 4749 } 4750 4751 @media (hover: hover) and (pointer: fine) { 4752 button:hover:enabled { 4753 background-color: var(--wui-color-fg-250); 4754 } 4755 4756 button:active:enabled { 4757 background-color: var(--wui-color-fg-225); 4758 } 4759 } 4760`;var mse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let VN=class extends ut{constructor(){super(...arguments),this.icon="copy"}render(){return le` 4761 <button> 4762 <wui-icon color="inherit" size="xxs" name=${this.icon}></wui-icon> 4763 </button> 4764 `}};VN.styles=[Dn,Jr,iLe];mse([be()],VN.prototype,"icon",void 0);VN=mse([ot("wui-input-element")],VN);const sLe=Mt` 4765 :host { 4766 position: relative; 4767 width: 100%; 4768 display: inline-block; 4769 color: var(--wui-color-fg-275); 4770 } 4771 4772 input { 4773 width: 100%; 4774 border-radius: var(--wui-border-radius-xs); 4775 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 4776 background: var(--wui-color-gray-glass-002); 4777 font-size: var(--wui-font-size-paragraph); 4778 letter-spacing: var(--wui-letter-spacing-paragraph); 4779 color: var(--wui-color-fg-100); 4780 transition: 4781 background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), 4782 border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), 4783 box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); 4784 will-change: background-color, border-color, box-shadow; 4785 caret-color: var(--wui-color-accent-100); 4786 } 4787 4788 input:disabled { 4789 cursor: not-allowed; 4790 border: 1px solid var(--wui-color-gray-glass-010); 4791 } 4792 4793 input:disabled::placeholder, 4794 input:disabled + wui-icon { 4795 color: var(--wui-color-fg-300); 4796 } 4797 4798 input::placeholder { 4799 color: var(--wui-color-fg-275); 4800 } 4801 4802 input:focus:enabled { 4803 background-color: var(--wui-color-gray-glass-005); 4804 -webkit-box-shadow: 4805 inset 0 0 0 1px var(--wui-color-accent-100),
4806 0px 0px 0px 4px var(--wui-box-shadow-blue); 4807 -moz-box-shadow: 4808 inset 0 0 0 1px var(--wui-color-accent-100), 4809 0px 0px 0px 4px var(--wui-box-shadow-blue); 4810 box-shadow: 4811 inset 0 0 0 1px var(--wui-color-accent-100), 4812 0px 0px 0px 4px var(--wui-box-shadow-blue); 4813 } 4814 4815 input:hover:enabled { 4816 background-color: var(--wui-color-gray-glass-005); 4817 } 4818 4819 wui-icon { 4820 position: absolute; 4821 top: 50%; 4822 transform: translateY(-50%); 4823 pointer-events: none; 4824 } 4825 4826 .wui-size-sm { 4827 padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s); 4828 } 4829 4830 wui-icon + .wui-size-sm { 4831 padding: 9px var(--wui-spacing-m) 10px 36px; 4832 } 4833 4834 wui-icon[data-input='sm'] { 4835 left: var(--wui-spacing-s); 4836 } 4837 4838 .wui-size-md { 4839 padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m); 4840 } 4841 4842 wui-icon + .wui-size-md, 4843 wui-loading-spinner + .wui-size-md { 4844 padding: 10.5px var(--wui-spacing-3xl) 10.5px var(--wui-spacing-3xl); 4845 } 4846 4847 wui-icon[data-input='md'] { 4848 left: var(--wui-spacing-l); 4849 } 4850 4851 .wui-size-lg { 4852 padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l); 4853 letter-spacing: var(--wui-letter-spacing-medium-title); 4854 font-size: var(--wui-font-size-medium-title); 4855 font-weight: var(--wui-font-weight-light); 4856 line-height: 130%; 4857 color: var(--wui-color-fg-100); 4858 height: 64px; 4859 } 4860 4861 .wui-padding-right-xs { 4862 padding-right: var(--wui-spacing-xs); 4863 } 4864 4865 .wui-padding-right-s { 4866 padding-right: var(--wui-spacing-s); 4867 } 4868 4869 .wui-padding-right-m { 4870 padding-right: var(--wui-spacing-m); 4871 } 4872 4873 .wui-padding-right-l { 4874 padding-right: var(--wui-spacing-l); 4875 } 4876 4877 .wui-padding-right-xl { 4878 padding-right: var(--wui-spacing-xl); 4879 } 4880 4881 .wui-padding-right-2xl { 4882 padding-right: var(--wui-spacing-2xl); 4883 } 4884 4885 .wui-padding-right-3xl { 4886 padding-right: var(--wui-spacing-3xl); 4887 } 4888 4889 .wui-padding-right-4xl { 4890 padding-right: var(--wui-spacing-4xl); 4891 } 4892 4893 .wui-padding-right-5xl { 4894 padding-right: var(--wui-spacing-5xl); 4895 } 4896 4897 wui-icon + .wui-size-lg, 4898 wui-loading-spinner + .wui-size-lg { 4899 padding-left: 50px; 4900 } 4901 4902 wui-icon[data-input='lg'] { 4903 left: var(--wui-spacing-l); 4904 } 4905 4906 .wui-size-mdl { 4907 padding: 17.25px var(--wui-spacing-m) 17.25px var(--wui-spacing-m); 4908 } 4909 wui-icon + .wui-size-mdl, 4910 wui-loading-spinner + .wui-size-mdl { 4911 padding: 17.25px var(--wui-spacing-3xl) 17.25px 40px; 4912 } 4913 wui-icon[data-input='mdl'] { 4914 left: var(--wui-spacing-m); 4915 } 4916 4917 input:placeholder-shown ~ ::slotted(wui-input-element), 4918 input:placeholder-shown ~ ::slotted(wui-icon) { 4919 opacity: 0; 4920 pointer-events: none; 4921 } 4922 4923 input::-webkit-outer-spin-button, 4924 input::-webkit-inner-spin-button { 4925 -webkit-appearance: none; 4926 margin: 0; 4927 } 4928 4929 input[type='number'] { 4930 -moz-appearance: textfield; 4931 } 4932 4933 ::slotted(wui-input-element), 4934 ::slotted(wui-icon) { 4935 position: absolute; 4936 top: 50%; 4937 transform: translateY(-50%); 4938 } 4939 4940 ::slotted(wui-input-element) { 4941 right: var(--wui-spacing-m); 4942 } 4943 4944 ::slotted(wui-icon) { 4945 right: 0px; 4946 } 4947`;var Xf=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Zu=class extends ut{constructor(){super(...arguments),this.inputElementRef=f4(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){const e=`wui-padding-right-${this.inputRightPadding}`,r={[`wui-size-${this.size}`]:!0,[e]:!!this.inputRightPadding};return le`${this.templateIcon()} 4948 <input 4949 data-testid="wui-input-text" 4950 ${p4(this.inputElementRef)} 4951 class=${Y_(r)} 4952 type=${this.type} 4953 enterkeyhint=${Nt(this.enterKeyHint)} 4954 ?disabled=${this.disabled} 4955 placeholder=${this.placeholder} 4956 @input=${this.dispatchInputChangeEvent.bind(this)} 4957 .value=${this.value||""} 4958 tabindex=${Nt(this.tabIdx)} 4959 /> 4960 <slot></slot>`}templateIcon(){return this.icon?le`<wui-icon 4961 data-input=${this.size} 4962 size=${this.size} 4963 color="inherit" 4964 name=${this.icon} 4965 ></wui-icon>`:null}dispatchInputChangeEvent(){var e;
4965this.dispatchEvent(new CustomEvent("inputChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.value,bubbles:!0,composed:!0}))}};Zu.styles=[Dn,Jr,sLe];Xf([be()],Zu.prototype,"size",void 0);Xf([be()],Zu.prototype,"icon",void 0);Xf([be({type:Boolean})],Zu.prototype,"disabled",void 0);Xf([be()],Zu.prototype,"placeholder",void 0);Xf([be()],Zu.prototype,"type",void 0);Xf([be()],Zu.prototype,"keyHint",void 0);Xf([be()],Zu.prototype,"value",void 0);Xf([be()],Zu.prototype,"inputRightPadding",void 0);Xf([be()],Zu.prototype,"tabIdx",void 0);Zu=Xf([ot("wui-input-text")],Zu);const oLe=Mt` 4966 :host { 4967 position: relative; 4968 display: inline-block; 4969 width: 100%; 4970 } 4971`;var aLe=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let PB=class extends ut{constructor(){super(...arguments),this.inputComponentRef=f4()}render(){return le` 4972 <wui-input-text 4973 ${p4(this.inputComponentRef)} 4974 placeholder="Search wallet" 4975 icon="search" 4976 type="search" 4977 enterKeyHint="search" 4978 size="sm" 4979 > 4980 <wui-input-element @click=${this.clearValue} icon="close"></wui-input-element> 4981 </wui-input-text> 4982 `}clearValue(){const e=this.inputComponentRef.value,t=e==null?void 0:e.inputElementRef.value;t&&(t.value="",t.focus(),t.dispatchEvent(new Event("input")))}};PB.styles=[Dn,oLe];PB=aLe([ot("wui-search-bar")],PB);const wse=Wi`<svg viewBox="0 0 48 54" fill="none"> 4983 <path 4984 d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z" 4985 /> 4986</svg>`,cLe=Mt` 4987 :host { 4988 display: flex; 4989 flex-direction: column; 4990 align-items: center; 4991 width: 104px; 4992 row-gap: var(--wui-spacing-xs); 4993 padding: var(--wui-spacing-xs) 10px; 4994 background-color: var(--wui-color-gray-glass-002); 4995 border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); 4996 position: relative; 4997 } 4998 4999 wui-shimmer[data-type='network'] { 5000 border: none; 5001 -webkit-clip-path: var(--wui-path-network); 5002 clip-path: var(--wui-path-network); 5003 } 5004 5005 svg { 5006 position: absolute; 5007 width: 48px; 5008 height: 54px; 5009 z-index: 1; 5010 } 5011 5012 svg > path { 5013 stroke: var(--wui-color-gray-glass-010); 5014 stroke-width: 1px; 5015 } 5016 5017 @media (max-width: 350px) { 5018 :host { 5019 width: 100%; 5020 } 5021 } 5022`;var yse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let qN=class extends ut{constructor(){super(...arguments),this.type="wallet"}render(){return le` 5023 ${this.shimmerTemplate()} 5024 <wui-shimmer width="56px" height="20px" borderRadius="xs"></wui-shimmer> 5025 `}shimmerTemplate(){return this.type==="network"?le` <wui-shimmer 5026 data-type=${this.type} 5027 width="48px" 5028 height="54px" 5029 borderRadius="xs" 5030 ></wui-shimmer> 5031 ${wse}`:le`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}};qN.styles=[Dn,Jr,cLe];yse([be()],qN.prototype,"type",void 0);qN=yse([ot("wui-card-select-loader")],qN);const lLe=Mt` 5032 :host { 5033 display: grid; 5034 width: inherit; 5035 height: inherit; 5036 } 5037`;var nd=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let gl=class extends ut{render(){return this.style.cssText=` 5038 grid-template-rows: ${this.gridTemplateRows}; 5039 grid-template-columns: ${this.gridTemplateColumns}; 5040 justify-items: ${this.justifyItems}; 5041 align-items: ${this.alignItems}; 5042 justify-content: ${this.justifyContent}; 5043 align-content: ${this.alignContent}; 5044 column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; 5045 row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; 5046 gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; 5047 padding-top: ${this.padding&&zi.getSpacingStyles(this.padding,0)}; 5048 padding-right: ${this.padding&&zi.getSpacingStyles(this.padding,1)}; 5049 padding-bottom: ${this.padding&&zi.getSpacingStyles(this.padding,2)}; 5050 padding-left: ${this.padding&&zi.getSpacingStyles(this.padding,3)}; 5051 margin-top: ${this.margin&&zi.getSpacingStyles(this.margin,
50510)}; 5052 margin-right: ${this.margin&&zi.getSpacingStyles(this.margin,1)}; 5053 margin-bottom: ${this.margin&&zi.getSpacingStyles(this.margin,2)}; 5054 margin-left: ${this.margin&&zi.getSpacingStyles(this.margin,3)}; 5055 `,le`<slot></slot>`}};gl.styles=[Dn,lLe];nd([be()],gl.prototype,"gridTemplateRows",void 0);nd([be()],gl.prototype,"gridTemplateColumns",void 0);nd([be()],gl.prototype,"justifyItems",void 0);nd([be()],gl.prototype,"alignItems",void 0);nd([be()],gl.prototype,"justifyContent",void 0);nd([be()],gl.prototype,"alignContent",void 0);nd([be()],gl.prototype,"columnGap",void 0);nd([be()],gl.prototype,"rowGap",void 0);nd([be()],gl.prototype,"gap",void 0);nd([be()],gl.prototype,"padding",void 0);nd([be()],gl.prototype,"margin",void 0);gl=nd([ot("wui-grid")],gl);const uLe=Mt` 5056 button { 5057 display: flex; 5058 flex-direction: column; 5059 justify-content: center; 5060 align-items: center; 5061 cursor: pointer; 5062 width: 104px; 5063 row-gap: var(--wui-spacing-xs); 5064 padding: var(--wui-spacing-s) var(--wui-spacing-0); 5065 background-color: var(--wui-color-gray-glass-002); 5066 border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); 5067 transition: 5068 color var(--wui-duration-lg) var(--wui-ease-out-power-1), 5069 background-color var(--wui-duration-lg) var(--wui-ease-out-power-1), 5070 border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1); 5071 will-change: background-color, color, border-radius; 5072 outline: none; 5073 border: none; 5074 } 5075 5076 button > wui-flex > wui-text { 5077 color: var(--wui-color-fg-100); 5078 max-width: 86px; 5079 white-space: nowrap; 5080 overflow: hidden; 5081 text-overflow: ellipsis; 5082 justify-content: center; 5083 } 5084 5085 button > wui-flex > wui-text.certified { 5086 max-width: 66px; 5087 } 5088 5089 button:hover:enabled { 5090 background-color: var(--wui-color-gray-glass-005); 5091 } 5092 5093 button:disabled > wui-flex > wui-text { 5094 color: var(--wui-color-gray-glass-015); 5095 } 5096 5097 [data-selected='true'] { 5098 background-color: var(--wui-color-accent-glass-020); 5099 } 5100 5101 @media (hover: hover) and (pointer: fine) { 5102 [data-selected='true']:hover:enabled { 5103 background-color: var(--wui-color-accent-glass-015); 5104 } 5105 } 5106 5107 [data-selected='true']:active:enabled { 5108 background-color: var(--wui-color-accent-glass-010); 5109 } 5110 5111 @media (max-width: 350px) { 5112 button { 5113 width: 100%; 5114 } 5115 } 5116`;var g4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let C1=class extends ut{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(t=>{t.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var t,r;const e=((t=this.wallet)==null?void 0:t.badge_type)==="certified";return le` 5117 <button> 5118 ${this.imageTemplate()} 5119 <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="3xs"> 5120 <wui-text 5121 variant="tiny-500" 5122 color="inherit" 5123 class=${Nt(e?"certified":void 0)} 5124 >${(r=this.wallet)==null?void 0:r.name}</wui-text 5125 > 5126 ${e?le`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null} 5127 </wui-flex> 5128 </button> 5129 `}imageTemplate(){var e,t;return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():le` 5130 <wui-wallet-image 5131 size="md" 5132 imageSrc=${Nt(this.imageSrc)} 5133 name=${(e=this.wallet)==null?void 0:e.name} 5134 .installed=${(t=this.wallet)==null?void 0:t.installed} 5135 badgeSize="sm" 5136 > 5137 </wui-wallet-image> 5138 `}shimmerTemplate(){return le`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=Hr.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await Hr.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};C1.styles=uLe;g4([qe()],C1.prototype,"visible",void 0);g4([qe()],C1.prototype,"imageSrc",void 0);g4([qe()],C1.prototype,"imageLoading",void 0);g4([be()],C1.prototype,"wallet",void 0);C1=g4([ot("w3m-all-wallets-list-item")],C1);const dLe=Mt` 5139 wui-grid { 5140 max-height: clamp(360px, 400px, 80vh); 5141 overflow: scroll; 5142 scrollbar-width: none; 5143 grid-auto-rows: min-content; 5144 grid-template-columns: repeat(auto-fill, 104px); 5145 } 5146 5147 @media (max-width: 350px) { 5148 wui-grid { 5149 grid-template-columns: repeat(2, 1fr); 5150 } 5151 } 5152 5153 wui-grid[data-scroll='false'] { 5154 overflow: hidden; 5155 } 5156 5157 wui-grid::-webkit-scrollbar {
5158 display: none; 5159 } 5160 5161 wui-loading-spinner { 5162 padding-top: var(--wui-spacing-l); 5163 padding-bottom: var(--wui-spacing-l); 5164 justify-content: center; 5165 grid-column: 1 / span 4; 5166 } 5167`;var hE=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const LY="local-paginator";let b0=class extends ut{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!Ft.state.wallets.length,this.wallets=Ft.state.wallets,this.recommended=Ft.state.recommended,this.featured=Ft.state.featured,this.filteredWallets=Ft.state.filteredWallets,this.unsubscribe.push(Ft.subscribeKey("wallets",e=>this.wallets=e),Ft.subscribeKey("recommended",e=>this.recommended=e),Ft.subscribeKey("featured",e=>this.featured=e),Ft.subscribeKey("filteredWallets",e=>this.filteredWallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(t=>t()),(e=this.paginationObserver)==null||e.disconnect()}render(){return le` 5168 <wui-grid 5169 data-scroll=${!this.loading} 5170 .padding=${["0","s","s","s"]} 5171 columnGap="xxs" 5172 rowGap="l" 5173 justifyContent="space-between" 5174 > 5175 ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()} 5176 ${this.paginationLoaderTemplate()} 5177 </wui-grid> 5178 `}async initialFetch(){var t;this.loading=!0;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-grid");e&&(await Ft.fetchWalletsByPage({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,t){return[...Array(e)].map(()=>le` 5179 <wui-card-select-loader type="wallet" id=${Nt(t)}></wui-card-select-loader> 5180 `)}getWallets(){var i;const e=[...this.featured,...this.recommended];((i=this.filteredWallets)==null?void 0:i.length)>0?e.push(...this.filteredWallets):e.push(...this.wallets);const t=tt.uniqueBy(e,"id"),r=Uf.markWalletsAsInstalled(t);return Uf.markWalletsWithDisplayIndex(r)}walletsTemplate(){return this.getWallets().map(t=>le` 5181 <w3m-all-wallets-list-item 5182 @click=${()=>this.onConnectWallet(t)} 5183 .wallet=${t} 5184 ></w3m-all-wallets-list-item> 5185 `)}paginationLoaderTemplate(){const{wallets:e,recommended:t,featured:r,count:i}=Ft.state,s=window.innerWidth<352?3:4,o=e.length+t.length;let c=Math.ceil(o/s)*s-o+s;return c-=e.length?r.length%s:0,i===0&&r.length>0?null:i===0||[...r,...e,...t].length<i?this.shimmerTemplate(c,LY):null}createPaginationObserver(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(`#${LY}`);e&&(this.paginationObserver=new IntersectionObserver(([r])=>{if(r!=null&&r.isIntersecting&&!this.loading){const{page:i,count:s,wallets:o}=Ft.state;o.length<s&&Ft.fetchWalletsByPage({page:i+1})}}),this.paginationObserver.observe(e))}onConnectWallet(e){Ge.selectWalletConnector(e)}};b0.styles=dLe;hE([qe()],b0.prototype,"loading",void 0);hE([qe()],b0.prototype,"wallets",void 0);hE([qe()],b0.prototype,"recommended",void 0);hE([qe()],b0.prototype,"featured",void 0);hE([qe()],b0.prototype,"filteredWallets",void 0);b0=hE([ot("w3m-all-wallets-list")],b0);const hLe=Mt` 5186 wui-grid, 5187 wui-loading-spinner, 5188 wui-flex { 5189 height: 360px; 5190 } 5191 5192 wui-grid { 5193 overflow: scroll; 5194 scrollbar-width: none; 5195 grid-auto-rows: min-content; 5196 grid-template-columns: repeat(auto-fill, 104px); 5197 } 5198 5199 wui-grid[data-scroll='false'] { 5200 overflow: hidden; 5201 } 5202 5203 wui-grid::-webkit-scrollbar {
5204 display: none; 5205 } 5206 5207 wui-loading-spinner { 5208 justify-content: center; 5209 align-items: center; 5210 } 5211 5212 @media (max-width: 350px) { 5213 wui-grid { 5214 grid-template-columns: repeat(2, 1fr); 5215 } 5216 } 5217`;var RR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Mx=class extends ut{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?le`<wui-loading-spinner color="accent-100"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){(this.query.trim()!==this.prevQuery.trim()||this.badge!==this.prevBadge)&&(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await Ft.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){const{search:e}=Ft.state,t=Uf.markWalletsAsInstalled(e);return e.length?le` 5218 <wui-grid 5219 data-testid="wallet-list" 5220 .padding=${["0","s","s","s"]} 5221 rowGap="l" 5222 columnGap="xs" 5223 justifyContent="space-between" 5224 > 5225 ${t.map(r=>le` 5226 <w3m-all-wallets-list-item 5227 @click=${()=>this.onConnectWallet(r)} 5228 .wallet=${r} 5229 data-testid="wallet-search-item-${r.id}" 5230 ></w3m-all-wallets-list-item> 5231 `)} 5232 </wui-grid> 5233 `:le` 5234 <wui-flex 5235 data-testid="no-wallet-found" 5236 justifyContent="center" 5237 alignItems="center" 5238 gap="s" 5239 flexDirection="column" 5240 > 5241 <wui-icon-box 5242 size="lg" 5243 iconColor="fg-200" 5244 backgroundColor="fg-300" 5245 icon="wallet" 5246 background="transparent" 5247 ></wui-icon-box> 5248 <wui-text data-testid="no-wallet-found-text" color="fg-200" variant="paragraph-500"> 5249 No Wallet found 5250 </wui-text> 5251 </wui-flex> 5252 `}onConnectWallet(e){Ge.selectWalletConnector(e)}};Mx.styles=hLe;RR([qe()],Mx.prototype,"loading",void 0);RR([be()],Mx.prototype,"query",void 0);RR([be()],Mx.prototype,"badge",void 0);Mx=RR([ot("w3m-all-wallets-search")],Mx);var XU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let tC=class extends ut{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=tt.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return le` 5253 <wui-flex .padding=${["0","s","s","s"]} gap="xs"> 5254 <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar> 5255 <wui-certified-switch 5256 ?checked=${this.badge} 5257 @click=${this.onClick.bind(this)} 5258 data-testid="wui-certified-switch" 5259 ></wui-certified-switch> 5260 ${this.qrButtonTemplate()} 5261 </wui-flex> 5262 ${e||this.badge?le`<w3m-all-wallets-search 5263 query=${this.search} 5264 badge=${Nt(this.badge)} 5265 ></w3m-all-wallets-search>`:le`<w3m-all-wallets-list badge=${Nt(this.badge)}></w3m-all-wallets-list>`} 5266 `}onInputChange(e){this.onDebouncedSearch(e.detail)}onClick(){if(this.badge==="certified"){this.badge=void 0;return}this.badge="certified",Ir.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})}qrButtonTemplate(){return tt.isMobile()?le` 5267 <wui-icon-box 5268 size="lg" 5269 iconSize="xl" 5270 iconColor="accent-100" 5271 backgroundColor="accent-100" 5272 icon="qrCode" 5273 background="transparent" 5274 border 5275 borderColor="wui-accent-glass-010" 5276 @click=${this.onWalletConnectQr.bind(this)} 5277 ></wui-icon-box> 5278 `:null}onWalletConnectQr(){it.push("ConnectingWalletConnect")}};XU([qe()],tC.prototype,"search",void 0);XU([qe()],tC.prototype,"badge",void 0);tC=XU([ot("w3m-all-wallets-view")],tC);const fLe=Mt` 5279 button { 5280 column-gap: var(--wui-spacing-s); 5281 padding: 16.5px var(--wui-spacing-l) 16.5px var(--wui-spacing-xs); 5282 width: 100%; 5283 background-color: var(--wui-color-gray-glass-002); 5284 border-radius: var(--wui-border-radius-xs); 5285 color: var(--wui-color-fg-100); 5286 justify-content: center;
5287 align-items: center; 5288 } 5289 5290 button:disabled { 5291 background-color: var(--wui-color-gray-glass-015); 5292 color: var(--wui-color-gray-glass-015); 5293 } 5294`;var MR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let kx=class extends ut{constructor(){super(...arguments),this.text="",this.disabled=!1,this.tabIdx=void 0}render(){return le` 5295 <button ?disabled=${this.disabled} tabindex=${Nt(this.tabIdx)}> 5296 <wui-text align="center" variant="paragraph-500" color="inherit">${this.text}</wui-text> 5297 </button> 5298 `}};kx.styles=[Dn,Jr,fLe];MR([be()],kx.prototype,"text",void 0);MR([be({type:Boolean})],kx.prototype,"disabled",void 0);MR([be()],kx.prototype,"tabIdx",void 0);kx=MR([ot("wui-list-button")],kx);const pLe=Mt` 5299 :host { 5300 position: relative; 5301 display: inline-block; 5302 } 5303 5304 wui-text { 5305 margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); 5306 } 5307`;var m4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let T1=class extends ut{constructor(){super(...arguments),this.disabled=!1}render(){return le` 5308 <wui-input-text 5309 type="email" 5310 placeholder="Email" 5311 icon="mail" 5312 size="mdl" 5313 .disabled=${this.disabled} 5314 .value=${this.value} 5315 data-testid="wui-email-input" 5316 tabIdx=${Nt(this.tabIdx)} 5317 ></wui-input-text> 5318 ${this.templateError()} 5319 `}templateError(){return this.errorMessage?le`<wui-text variant="tiny-500" color="error-100">${this.errorMessage}</wui-text>`:null}};T1.styles=[Dn,pLe];m4([be()],T1.prototype,"errorMessage",void 0);m4([be({type:Boolean})],T1.prototype,"disabled",void 0);m4([be()],T1.prototype,"value",void 0);m4([be()],T1.prototype,"tabIdx",void 0);T1=m4([ot("wui-email-input")],T1);const gLe=Mt` 5320 wui-separator { 5321 margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); 5322 width: calc(100% + var(--wui-spacing-s) * 2); 5323 } 5324 5325 wui-email-input { 5326 width: 100%; 5327 } 5328 5329 form { 5330 width: 100%; 5331 display: block; 5332 position: relative; 5333 } 5334 5335 wui-icon-link, 5336 wui-loading-spinner { 5337 position: absolute; 5338 top: 50%; 5339 transform: translateY(-50%); 5340 } 5341 5342 wui-icon-link { 5343 right: var(--wui-spacing-xs); 5344 } 5345 5346 wui-loading-spinner { 5347 right: var(--wui-spacing-m); 5348 } 5349 5350 wui-text { 5351 margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); 5352 } 5353`;var fE=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let v0=class extends ut{constructor(){super(),this.unsubscribe=[],this.formRef=f4(),this.email="",this.loading=!1,this.error="",this.remoteFeatures=Ue.state.remoteFeatures,this.unsubscribe.push(Ue.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",t=>{t.key==="Enter"&&this.onSubmitEmail(t)})}render(){const e=nt.hasAnyConnection(Be.CONNECTOR_ID.AUTH);return le` 5354 <form ${p4(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}> 5355 <wui-email-input 5356 @focus=${this.onFocusEvent.bind(this)} 5357 .disabled=${this.loading} 5358 @inputChange=${this.onEmailInputChange.bind(this)} 5359 tabIdx=${Nt(this.tabIdx)} 5360 ?disabled=${e} 5361 > 5362 </wui-email-input> 5363 5364 ${this.submitButtonTemplate()}${this.loadingTemplate()} 5365 <input type="submit" hidden /> 5366 </form> 5367 ${this.templateError()} 5368 `}submitButtonTemplate(){return!this.loading&&this.email.length>3?le` 5369 <wui-icon-link 5370 size="sm" 5371 icon="chevronRight" 5372 iconcolor="accent-100" 5373 @click=${this.onSubmitEmail.bind(this)} 5374 > 5375 </wui-icon-link> 5376 `:null}loadingTemplate(){return this.loading?le`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:null}templateError(){return this.error?le`<wui-text variant="tiny-500" color="error-100">${this.error}</wui-text>`:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){var r;if(!Be.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(i=>i===ue.state.activeChain)){const i=ue.getFirstCaipNetworkSupportsAuthConnector();if(i){it.push("SwitchNetwork",{network:i});return}}try{if(this.loading)return;this.loading=!0,e.preventDefault();const i=Ge.getAuthConnector();if(!i)throw new Error("w3m-email-login-widget: Auth connector not found");const{action:s}=await i.provider.connectEmail({email:this.email});if(xn.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),s==="VERIFY_OTP")xn.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),it.push("EmailVerifyOtp",{email:this.email});else if(s==="VERIFY_DEVICE")it.push("EmailVerifyDevice",{email:this.email});else if(s==="CONNECT"){const o=(r=this.remoteFeatures)==null?void 0:r.multiWallet;await nt.connectExternal(i,ue.state.activeChain),o?(it.replace("ProfileWallets"),Ir.showSuccess("New Wallet Added")):it.replace("Account")}}catch(i){const s=tt.parseError(i);s!=null&&s.includes("Invalid email")?this.error="Invalid email. Try again.":Ir.showError(i)}finally{this.loading=!1}}onFocusEvent(){xn.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};v0.styles=gLe;fE([be()],v0.prototype,"tabIdx",void 0);fE([qe()],v0.prototype,"email",void 0);fE([qe()],v0.prototype,"loading",void 0);fE([qe()],v0.prototype,"error",void 0);fE([qe()],v0.prototype,"remoteFeatures",void 0);
5376v0=fE([ot("w3m-email-login-widget")],v0);const mLe=Mt` 5377 label { 5378 display: flex; 5379 align-items: center; 5380 cursor: pointer; 5381 -webkit-user-select: none; 5382 -moz-user-select: none; 5383 -ms-user-select: none; 5384 user-select: none; 5385 column-gap: var(--wui-spacing-1xs); 5386 } 5387 5388 label > input[type='checkbox'] { 5389 height: 0; 5390 width: 0; 5391 opacity: 0; 5392 pointer-events: none; 5393 position: absolute; 5394 } 5395 5396 label > span { 5397 width: var(--wui-spacing-xl); 5398 height: var(--wui-spacing-xl); 5399 min-width: var(--wui-spacing-xl); 5400 min-height: var(--wui-spacing-xl); 5401 border-radius: var(--wui-border-radius-3xs); 5402 border-width: 1px; 5403 border-style: solid; 5404 border-color: var(--wui-color-gray-glass-010); 5405 display: flex; 5406 align-items: center; 5407 justify-content: center; 5408 transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); 5409 will-change: background-color; 5410 } 5411 5412 label > span:hover, 5413 label > input[type='checkbox']:focus-visible + span { 5414 background-color: var(--wui-color-gray-glass-010); 5415 } 5416 5417 label input[type='checkbox']:checked + span { 5418 background-color: var(--wui-color-blue-base-90); 5419 } 5420 5421 label > span > wui-icon { 5422 opacity: 0; 5423 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-lg); 5424 will-change: opacity; 5425 } 5426 5427 label > input[type='checkbox']:checked + span wui-icon { 5428 opacity: 1; 5429 } 5430`;var bse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let KN=class extends ut{constructor(){super(...arguments),this.inputElementRef=f4(),this.checked=void 0}render(){return le` 5431 <label> 5432 <input 5433 ${p4(this.inputElementRef)} 5434 ?checked=${Nt(this.checked)} 5435 type="checkbox" 5436 @change=${this.dispatchChangeEvent} 5437 /> 5438 <span> 5439 <wui-icon name="checkmarkBold" color="inverse-100" size="xxs"></wui-icon> 5440 </span> 5441 <slot></slot> 5442 </label> 5443 `}dispatchChangeEvent(){var e;this.dispatchEvent(new CustomEvent("checkboxChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.checked,bubbles:!0,composed:!0}))}};KN.styles=[Dn,mLe];bse([be({type:Boolean})],KN.prototype,"checked",void 0);KN=bse([ot("wui-checkbox")],KN);const wLe=Mt` 5444 :host { 5445 display: flex; 5446 align-items: center; 5447 justify-content: center; 5448 } 5449 wui-checkbox { 5450 padding: var(--wui-spacing-s); 5451 } 5452 a { 5453 text-decoration: none; 5454 color: var(--wui-color-fg-150); 5455 font-weight: 500; 5456 } 5457`;var vse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let YN=class extends ut{constructor(){super(),this.unsubscribe=[],this.checked=Gy.state.isLegalCheckboxChecked,this.unsubscribe.push(Gy.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var i;const{termsConditionsUrl:e,privacyPolicyUrl:t}=Ue.state,r=(i=Ue.state.features)==null?void 0:i.legalCheckbox;return!e&&!t||!r?null:le` 5458 <wui-checkbox 5459 ?checked=${this.checked} 5460 @checkboxChange=${this.onCheckboxChange.bind(this)} 5461 data-testid="wui-checkbox" 5462 > 5463 <wui-text color="fg-250" variant="small-400" align="left"> 5464 I agree to our ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()} 5465 </wui-text> 5466 </wui-checkbox> 5467 `}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=Ue.state;return e&&t?"and":""}termsTemplate(){const{termsConditionsUrl:e}=Ue.state;return e?le`<a rel="noreferrer" target="_blank" href=${e}>terms of service</a>`:null}privacyTemplate(){const{privacyPolicyUrl:e}=Ue.state;return e?le`<a rel="noreferrer" target="_blank" href=${e}>privacy policy</a>`:null}onCheckboxChange(){Gy.setIsLegalCheckboxChecked(!this.checked)}};YN.styles=[wLe];vse([qe()],YN.prototype,"checked",void 0);YN=vse([ot("w3m-legal-checkbox")],YN);const Ent=/[.*+?^${}()|[\]\\]/gu,Ant=/[0-9,.]/u,yLe="https://reown.com",bLe=Mt` 5468 .reown-logo { 5469 height: var(--wui-spacing-xxl); 5470 } 5471 5472 a { 5473 text-decoration: none; 5474 cursor: pointer; 5475 } 5476 5477 a:hover { 5478 opacity: 0.9; 5479 } 5480`;var vLe=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let DB=class extends ut{render(){return le` 5481 <a 5482 data-testid="ux-branding-reown" 5483 href=${yLe} 5484 rel="noreferrer" 5485 target="_blank" 5486 style="text-decoration: none;" 5487 > 5488 <wui-flex 5489 justifyContent="center" 5490 alignItems="center" 5491 gap="xs" 5492 .padding=${["0","0","l","0"]} 5493 > 5494 <wui-text variant="small-500" color="fg-100"> UX by </wui-text> 5495 <wui-icon name="reown" size="xxxl" class="reown-logo"></wui-icon> 5496 </wui-flex> 5497 </a> 5498 `}};DB.styles=[Dn,Jr,bLe];DB=vLe([ot("wui-ux-by-reown")],DB);const xLe=Mt` 5499 :host > wui-flex { 5500 background-color: var(--wui-color-gray-glass-005); 5501 } 5502 5503 :host wui-ux-by-reown { 5504 padding-top: 0; 5505 } 5506 5507 :host wui-ux-by-reown.branding-only { 5508 padding-top: var(--wui-spacing-m); 5509 } 5510 5511 a { 5512 text-decoration: none; 5513 color: var(--wui-color-fg-175); 5514 font-weight: 500; 5515 } 5516`;var xse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let GN=class extends ut{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=Ue.state.remoteFeatures,this.unsubscribe.push(Ue.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}
5516disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var s;const{termsConditionsUrl:e,privacyPolicyUrl:t}=Ue.state,r=(s=Ue.state.features)==null?void 0:s.legalCheckbox;return!e&&!t||r?le` 5517 <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex> 5518 `:le` 5519 <wui-flex flexDirection="column"> 5520 <wui-flex .padding=${["m","s","s","s"]} justifyContent="center"> 5521 <wui-text color="fg-250" variant="small-400" align="center"> 5522 By connecting your wallet, you agree to our <br /> 5523 ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()} 5524 </wui-text> 5525 </wui-flex> 5526 ${this.reownBrandingTemplate()} 5527 </wui-flex> 5528 `}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=Ue.state;return e&&t?"and":""}termsTemplate(){const{termsConditionsUrl:e}=Ue.state;return e?le`<a href=${e} target="_blank" rel="noopener noreferrer" 5529 >Terms of Service</a 5530 >`:null}privacyTemplate(){const{privacyPolicyUrl:e}=Ue.state;return e?le`<a href=${e} target="_blank" rel="noopener noreferrer" 5531 >Privacy Policy</a 5532 >`:null}reownBrandingTemplate(e=!1){var t;return(t=this.remoteFeatures)!=null&&t.reownBranding?e?le`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:le`<wui-ux-by-reown></wui-ux-by-reown>`:null}};GN.styles=[xLe];xse([qe()],GN.prototype,"remoteFeatures",void 0);GN=xse([ot("w3m-legal-footer")],GN);const ELe=Mt` 5533 :host { 5534 display: flex; 5535 justify-content: center; 5536 align-items: center; 5537 width: 40px; 5538 height: 40px; 5539 border-radius: var(--wui-border-radius-3xl); 5540 border: 1px solid var(--wui-color-gray-glass-005); 5541 overflow: hidden; 5542 } 5543 5544 wui-icon { 5545 width: 100%; 5546 height: 100%; 5547 } 5548`;var Ese=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let ZN=class extends ut{constructor(){super(...arguments),this.logo="google"}render(){return le`<wui-icon color="inherit" size="inherit" name=${this.logo}></wui-icon> `}};ZN.styles=[Dn,ELe];Ese([be()],ZN.prototype,"logo",void 0);ZN=Ese([ot("wui-logo")],ZN);const ALe=Mt` 5549 button { 5550 column-gap: var(--wui-spacing-s); 5551 padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); 5552 width: 100%; 5553 justify-content: flex-start; 5554 background-color: var(--wui-color-gray-glass-002); 5555 border-radius: var(--wui-border-radius-xs); 5556 color: var(--wui-color-fg-100); 5557 } 5558 5559 wui-text { 5560 text-transform: capitalize; 5561 } 5562 5563 wui-text[data-align='left'] { 5564 display: flex; 5565 flex: 1; 5566 } 5567 5568 wui-text[data-align='center'] { 5569 display: flex; 5570 flex: 1; 5571 justify-content: center; 5572 } 5573 5574 .invisible { 5575 opacity: 0; 5576 pointer-events: none; 5577 } 5578 5579 button:disabled { 5580 background-color: var(--wui-color-gray-glass-015); 5581 color: var(--wui-color-gray-glass-015); 5582 } 5583`;var pE=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let x0=class extends ut{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.align="left",this.disabled=!1}render(){return le` 5584 <button ?disabled=${this.disabled} tabindex=${Nt(this.tabIdx)}> 5585 <wui-logo logo=${this.logo}></wui-logo> 5586 <wui-text 5587 data-align=${this.align} 5588 variant="paragraph-500" 5589 color="inherit" 5590 align=${this.align} 5591 >${this.name}</wui-text 5592 > 5593 ${this.templatePlacement()} 5594 </button> 5595 `}templatePlacement(){return this.align==="center"?le` <wui-logo class="invisible" logo=${this.logo}></wui-logo>`:null}};x0.styles=[Dn,Jr,ALe];pE([be()],x0.prototype,"logo",void 0);pE([be()],x0.prototype,"name",void 0);pE([be()],x0.prototype,"align",void 0);pE([be()],x0.prototype,"tabIdx",void 0);pE([be({type:Boolean})],x0.prototype,"disabled",void 0);x0=pE([ot("wui-list-social")],x0);const SLe=Mt` 5596 :host { 5597 display: block; 5598 width: 100%; 5599 } 5600 5601 button { 5602 width: 100%; 5603 height: 56px; 5604 background: var(--wui-color-gray-glass-002); 5605 border-radius: var(--wui-border-radius-xs); 5606 } 5607`;var kR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Ox=class extends ut{constructor(){super(...arguments),this.logo="google",this.disabled=!1,this.tabIdx=void 0}render(){return le` 5608 <button ?disabled=${this.disabled} tabindex=${Nt(this.tabIdx)}> 5609 <wui-logo logo=${this.logo}></wui-logo> 5610 </button> 5611 `}};Ox.styles=[Dn,Jr,SLe];kR([be()],Ox.prototype,"logo",void 0);kR([be({type:Boolean})],Ox.prototype,"disabled",void 0);kR([be()],Ox.prototype,"tabIdx",void 0);Ox=kR([ot("wui-logo-select")],Ox);const _Le=Mt` 5612 wui-separator { 5613 margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-m) 5614 calc(var(--wui-spacing-m) * -1); 5615 width: calc(100% + var(--wui-spacing-s) * 2); 5616 } 5617`;var cb=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const $Y=2,UY=6;let wg=class extends ut{constructor(){super(),this.unsubscribe=[],this.walletGuide="get-started",this.tabIdx=void 0,this.connectors=Ge.state.connectors,this.remoteFeatures=Ue.state.remoteFeatures,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.isPwaLoading=!1,this.unsubscribe.push(Ge.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(t=>t.type==="AUTH")}),Ue.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}
5617disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return le` 5618 <wui-flex 5619 class="container" 5620 flexDirection="column" 5621 gap="xs" 5622 data-testid="w3m-social-login-widget" 5623 > 5624 ${this.topViewTemplate()}${this.bottomViewTemplate()} 5625 </wui-flex> 5626 `}topViewTemplate(){var r;const e=this.walletGuide==="explore";let t=(r=this.remoteFeatures)==null?void 0:r.socials;return!t&&e?(t=sr.DEFAULT_SOCIALS,this.renderTopViewContent(t)):t?this.renderTopViewContent(t):null}renderTopViewContent(e){return e.length===2?le` <wui-flex gap="xs"> 5627 ${e.slice(0,$Y).map(t=>le`<wui-logo-select 5628 data-testid=${`social-selector-${t}`} 5629 @click=${()=>{this.onSocialClick(t)}} 5630 logo=${t} 5631 tabIdx=${Nt(this.tabIdx)} 5632 ?disabled=${this.isPwaLoading||this.hasConnection()} 5633 ></wui-logo-select>`)} 5634 </wui-flex>`:le` <wui-list-social 5635 data-testid=${`social-selector-${e[0]}`} 5636 @click=${()=>{this.onSocialClick(e[0])}} 5637 logo=${Nt(e[0])} 5638 align="center" 5639 name=${`Continue with ${e[0]}`} 5640 tabIdx=${Nt(this.tabIdx)} 5641 ?disabled=${this.isPwaLoading||this.hasConnection()} 5642 ></wui-list-social>`}bottomViewTemplate(){var i;let e=(i=this.remoteFeatures)==null?void 0:i.socials;const t=this.walletGuide==="explore";return(!this.authConnector||!e||e.length===0)&&t&&(e=sr.DEFAULT_SOCIALS),!e||e.length<=$Y?null:e&&e.length>UY?le`<wui-flex gap="xs"> 5643 ${e.slice(1,UY-1).map(s=>le`<wui-logo-select 5644 data-testid=${`social-selector-${s}`} 5645 @click=${()=>{this.onSocialClick(s)}} 5646 logo=${s} 5647 tabIdx=${Nt(this.tabIdx)} 5648 ?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0} 5649 ?disabled=${this.isPwaLoading||this.hasConnection()} 5650 ></wui-logo-select>`)} 5651 <wui-logo-select 5652 logo="more" 5653 tabIdx=${Nt(this.tabIdx)} 5654 @click=${this.onMoreSocialsClick.bind(this)} 5655 ?disabled=${this.isPwaLoading||this.hasConnection()} 5656 data-testid="social-selector-more" 5657 ></wui-logo-select> 5658 </wui-flex>`:e?le`<wui-flex gap="xs"> 5659 ${e.slice(1,e.length).map(s=>le`<wui-logo-select 5660 data-testid=${`social-selector-${s}`} 5661 @click=${()=>{this.onSocialClick(s)}} 5662 logo=${s} 5663 tabIdx=${Nt(this.tabIdx)} 5664 ?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0} 5665 ?disabled=${this.isPwaLoading||this.hasConnection()} 5666 ></wui-logo-select>`)} 5667 </wui-flex>`:null}onMoreSocialsClick(){it.push("ConnectSocials")}async onSocialClick(e){if(!Be.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(r=>r===ue.state.activeChain)){const r=ue.getFirstCaipNetworkSupportsAuthConnector();if(r){it.push("SwitchNetwork",{network:r});return}}e&&await $7e(e)}async handlePwaFrameLoad(){var e;if(tt.isPWA()){this.isPwaLoading=!0;try{((e=this.authConnector)==null?void 0:e.provider)instanceof vee&&await this.authConnector.provider.init()}catch(t){Fs.open({displayMessage:"Error loading embedded wallet in PWA",debugMessage:t.message},"error")}finally{this.isPwaLoading=!1}}}hasConnection(){return nt.hasAnyConnection(Be.CONNECTOR_ID.AUTH)}};wg.styles=_Le;cb([be()],wg.prototype,"walletGuide",void 0);cb([be()],wg.prototype,"tabIdx",void 0);cb([qe()],wg.prototype,"connectors",void 0);cb([qe()],wg.prototype,"remoteFeatures",void 0);cb([qe()],wg.prototype,"authConnector",void 0);cb([qe()],wg.prototype,"isPwaLoading",void 0);wg=cb([ot("w3m-social-login-widget")],wg);const CLe=Mt` 5668 a { 5669 border: 1px solid var(--wui-color-gray-glass-010); 5670 border-radius: var(--wui-border-radius-3xl); 5671 } 5672 5673 wui-image { 5674 border-radius: var(--wui-border-radius-3xl); 5675 overflow: hidden; 5676 } 5677 5678 a.disabled > wui-icon:not(.image-icon), 5679 a.disabled > wui-image { 5680 filter: grayscale(1); 5681 } 5682 5683 a[data-variant='fill'] { 5684 color: var(--wui-color-inverse-100); 5685 background-color: var(--wui-color-accent-100); 5686 } 5687 5688 a[data-variant='shade'], 5689 a[data-variant='shadeSmall'] { 5690 background-color: transparent; 5691 background-color: var(--wui-color-gray-glass-010); 5692 color: var(--wui-color-fg-200); 5693 } 5694 5695 a[data-variant='success'] { 5696 column-gap: var(--wui-spacing-xxs); 5697 border: 1px solid var(--wui-color-success-glass-010); 5698 background-color: var(--wui-color-success-glass-010); 5699 color: var(--wui-color-success-100); 5700 } 5701 5702 a[data-variant='error'] { 5703 column-gap: var(--wui-spacing-xxs); 5704 border: 1px solid var(--wui-color-error-glass-010); 5705 background-color: var(--wui-color-error-glass-010); 5706 color: var(--wui-color-error-100); 5707 } 5708 5709 a[data-variant='transparent'] { 5710 column-gap: var(--wui-spacing-xxs); 5711 background-color: transparent; 5712 color: var(--wui-color-fg-150); 5713 } 5714 5715 a[data-variant='transparent'], 5716 a[data-variant='success'], 5717 a[data-variant='shadeSmall'], 5718 a[data-variant='error'] { 5719 padding: 7px var(--wui-spacing-s) 7px 10px; 5720 } 5721 5722 a[data-variant='transparent']:has(wui-text:first-child), 5723 a[data-variant='success']:has(wui-text:first-child), 5724 a[data-variant='shadeSmall']:has(wui-text:first-child), 5725 a[data-variant='error']:has(wui-text:first-child) { 5726 padding: 7px var(--wui-spacing-s); 5727 } 5728 5729 a[data-variant='fill'], 5730 a[data-variant='shade'] { 5731 column-gap: var(--wui-spacing-xs); 5732 padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) 5733 var(--wui-spacing-xs); 5734 } 5735 5736 a[data-variant='fill']:has(wui-text:first-child), 5737 a[data-variant='shade']:has(wui-text:first-child) { 5738 padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); 5739 } 5740 5741 a[data-variant='fill'] > wui-image, 5742 a[data-variant='shade'] > wui-image { 5743 width: 24px; 5744 height: 24px; 5745 } 5746 5747 a[data-variant='fill'] > wui-image { 5748 box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); 5749 } 5750 5751 a[data-variant='shade'] > wui-image, 5752 a[data-variant='shadeSmall'] > wui-image { 5753 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 5754 } 5755 5756 a[data-variant='fill'] > wui-icon:not(.image-icon), 5757 a[data-variant='shade'] > wui-icon:not(.image-icon) { 5758 width: 14px; 5759 height: 14px; 5760 } 5761 5762 a[data-variant='transparent'] > wui-image, 5763 a[data-variant='success'] > wui-image, 5764 a[data-variant='shadeSmall'] > wui-image, 5765 a[data-variant='error'] > wui-image { 5766 width: 14px; 5767 height: 14px; 5768 } 5769 5770 a[data-variant='transparent'] > wui-icon:not(.image-icon), 5771 a[data-variant='success'] > wui-icon:not(.image-icon), 5772 a[data-variant='shadeSmall'] > wui-icon:not(.image-icon), 5773 a[data-variant='error'] > wui-icon:not(.image-icon) { 5774 width: 12px; 5775 height: 12px; 5776 } 5777 5778 a[data-variant='fill']:focus-visible { 5779 background-color: var(--wui-color-accent-090); 5780 } 5781 5782 a[data-variant='shade']:focus-visible, 5783 a[data-variant='shadeSmall']:focus-visible { 5784 background-color: var(--wui-color-gray-glass-015); 5785 } 5786 5787 a[data-variant='transparent']:focus-visible { 5788 background-color: var(--wui-color-gray-glass-005); 5789 } 5790 5791 a[data-variant='success']:focus-visible { 5792 background-color: var(--wui-color-success-glass-015); 5793 } 5794 5795 a[data-variant='error']:focus-visible { 5796 background-color: var(--wui-color-error-glass-015); 5797 } 5798 5799 a.disabled { 5800 color: var(--wui-color-gray-glass-015); 5801 background-color: var(--wui-color-gray-glass-015); 5802 pointer-events: none; 5803 } 5804 5805 @media (hover: hover) and (pointer: fine) { 5806 a[data-variant='fill']:hover { 5807 background-color: var(--wui-color-accent-090); 5808 } 5809 5810 a[data-variant='shade']:hover, 5811 a[data-variant='shadeSmall']:hover { 5812 background-color: var(--wui-color-gray-glass-015); 5813 } 5814 5815 a[data-variant='transparent']:hover { 5816 background-color: var(--wui-color-gray-glass-005); 5817 } 5818 5819 a[data-variant='success']:hover { 5820 background-color: var(--wui-color-success-glass-015); 5821 } 5822 5823 a[data-variant='error']:hover { 5824 background-color: var(--wui-color-error-glass-015); 5825 } 5826 } 5827 5828 a[data-variant='fill']:active { 5829 background-color: var(--wui-color-accent-080); 5830 } 5831 5832 a[data-variant='shade']:active, 5833 a[data-variant='shadeSmall']:active { 5834 background-color: var(--wui-color-gray-glass-020); 5835 } 5836 5837 a[data-variant='transparent']:active { 5838 background-color: var(--wui-color-gray-glass-010); 5839 } 5840 5841 a[data-variant='success']:active { 5842 background-color: var(--wui-color-success-glass-020); 5843 } 5844 5845 a[data-variant='error']:active { 5846 background-color: var(--wui-color-error-glass-020); 5847 } 5848`;var Ig=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let ch=class extends ut{constructor(){super(...arguments),this.variant="fill",this.imageSrc=void 0,this.imageIcon=void 0,this.imageIconSize="md",this.disabled=!1,this.icon="externalLink",this.href="",this.text=void 0}render(){const t=this.variant==="success"||this.variant==="transparent"||this.variant==="shadeSmall"?"small-600":"paragraph-600";return le` 5849 <a 5850 rel="noreferrer" 5851 target="_blank" 5852 href=${this.href} 5853 class=${this.disabled?"disabled":""} 5854 data-variant=${this.variant} 5855 > 5856 ${this.imageTemplate()} 5857 <wui-text variant=${t} color="inherit"> 5858 ${this.title?this.title:zi.getHostName(this.href)} 5859 </wui-text> 5860 <wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon> 5861 </a> 5862 `}imageTemplate(){return this.imageSrc?le`<wui-image src=${this.imageSrc}></wui-image>`:this.imageIcon?le`<wui-icon 5863 name=${this.imageIcon} 5864 color="inherit" 5865 size=${this.imageIconSize} 5866 class="image-icon" 5867 ></wui-icon>`:null}};ch.styles=[Dn,Jr,CLe];Ig([be()],ch.prototype,"variant",void 0);Ig([be()],ch.prototype,"imageSrc",void 0);Ig([be()],ch.prototype,"imageIcon",void 0);Ig([be()],ch.prototype,"imageIconSize",void 0);Ig([be({type:Boolean})],ch.prototype,"disabled",void 0);Ig([be()],ch.prototype,"icon",void 0);Ig([be()],ch.prototype,"href",void 0);Ig([be()],ch.prototype,"text",void 0);ch=Ig([ot("wui-chip")],ch);const TLe=Mt` 5868 wui-flex { 5869 width: 100%; 5870 } 5871 5872 .wallet-guide { 5873 width: 100%; 5874 } 5875 5876 .chip-box { 5877 width: fit-content; 5878 background-color: var(--wui-color-gray-glass-005); 5879 border-radius: var(--wui-border-radius-3xl); 5880 } 5881`;var JU=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let nC=class extends ut{constructor(){super(...arguments),this.walletGuide="get-started"}render(){return this.walletGuide==="explore"?le`<wui-flex 5882 class="wallet-guide" 5883 flexDirection="column" 5884 alignItems="center" 5885 justifyContent="center" 5886 rowGap="xs" 5887 data-testid="w3m-wallet-guide-explore" 5888 > 5889 <wui-text variant="small-400" color="fg-200" align="center"> 5890 Looking for a self-custody wallet? 5891 </wui-text> 5892 5893 <wui-flex class="chip-box"> 5894 <wui-chip 5895 imageIcon="walletConnectLightBrown" 5896 icon="externalLink" 5897 variant="transparent" 5898 href="https://walletguide.walletconnect.network" 5899 title="Find one on WalletGuide" 5900 ></wui-chip> 5901 </wui-flex> 5902 </wui-flex>`:le`<wui-flex 5903 columnGap="4xs" 5904 flexDirection="row" 5905 alignItems="center" 5906 justifyContent="center" 5907 .padding=${["s","0","s","0"]} 5908 > 5909 <wui-text variant="small-400" class="title" color="fg-200" 5910 >Haven't got a wallet?</wui-text 5911 > 5912 <wui-link 5913 data-testid="w3m-wallet-guide-get-started" 5914 color="blue-100" 5915 class="get-started-link" 5916 @click=${this.onGetStarted} 5917 tabIdx=${Nt(this.tabIdx)} 5918 > 5919 Get started 5920 </wui-link> 5921 </wui-flex>`}onGetStarted(){it.push("Create")}};nC.styles=TLe;JU([be()],nC.prototype,"tabIdx",void 0);JU([be()],nC.prototype,"walletGuide",void 0);nC=JU([ot("w3m-wallet-guide")],nC);const ILe=Mt` 5922 :host { 5923 position: relative; 5924 border-radius: var(--wui-border-radius-xxs); 5925 width: 40px; 5926 height: 40px; 5927 overflow: hidden; 5928 background: var(--wui-color-gray-glass-002); 5929 display: flex; 5930 justify-content: center;
5931 align-items: center; 5932 flex-wrap: wrap; 5933 gap: var(--wui-spacing-4xs); 5934 padding: 3.75px !important; 5935 } 5936 5937 :host::after { 5938 content: ''; 5939 position: absolute; 5940 top: 0; 5941 bottom: 0; 5942 left: 0; 5943 right: 0; 5944 border-radius: inherit; 5945 border: 1px solid var(--wui-color-gray-glass-010); 5946 pointer-events: none; 5947 } 5948 5949 :host > wui-wallet-image { 5950 width: 14px; 5951 height: 14px; 5952 border-radius: var(--wui-border-radius-5xs); 5953 } 5954 5955 :host > wui-flex { 5956 padding: 2px; 5957 position: fixed; 5958 overflow: hidden; 5959 left: 34px; 5960 bottom: 8px; 5961 background: var(--dark-background-150, #1e1f1f); 5962 border-radius: 50%; 5963 z-index: 2; 5964 display: flex; 5965 } 5966`;var Ase=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const n9=4;let QN=class extends ut{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.length<n9;return le`${this.walletImages.slice(0,n9).map(({src:t,walletName:r})=>le` 5967 <wui-wallet-image 5968 size="inherit" 5969 imageSrc=${t} 5970 name=${Nt(r)} 5971 ></wui-wallet-image> 5972 `)} 5973 ${e?[...Array(n9-this.walletImages.length)].map(()=>le` <wui-wallet-image size="inherit" name=""></wui-wallet-image>`):null} 5974 <wui-flex> 5975 <wui-icon-box 5976 size="xxs" 5977 iconSize="xxs" 5978 iconcolor="success-100" 5979 backgroundcolor="success-100" 5980 icon="checkmark" 5981 background="opaque" 5982 ></wui-icon-box> 5983 </wui-flex>`}};QN.styles=[Dn,ILe];Ase([be({type:Array})],QN.prototype,"walletImages",void 0);QN=Ase([ot("wui-all-wallets-image")],QN);const NLe=Mt` 5984 button { 5985 column-gap: var(--wui-spacing-s); 5986 padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); 5987 width: 100%; 5988 background-color: var(--wui-color-gray-glass-002); 5989 border-radius: var(--wui-border-radius-xs); 5990 color: var(--wui-color-fg-100); 5991 } 5992 5993 button > wui-text:nth-child(2) { 5994 display: flex; 5995 flex: 1; 5996 } 5997 5998 button:disabled { 5999 background-color: var(--wui-color-gray-glass-015); 6000 color: var(--wui-color-gray-glass-015); 6001 } 6002 6003 button:disabled > wui-tag { 6004 background-color: var(--wui-color-gray-glass-010); 6005 color: var(--wui-color-fg-300); 6006 } 6007 6008 wui-icon { 6009 color: var(--wui-color-fg-200) !important; 6010 } 6011`;var El=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Za=class extends ut{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.tabIdx=void 0,this.installed=!1,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return le` 6012 <button ?disabled=${this.disabled} tabindex=${Nt(this.tabIdx)}> 6013 ${this.templateAllWallets()} ${this.templateWalletImage()} 6014 <wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text> 6015 ${this.templateStatus()} 6016 </button> 6017 `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?le` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?le` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?le`<wui-wallet-image 6018 size="sm" 6019 imageSrc=${this.imageSrc} 6020 name=${this.name} 6021 .installed=${this.installed} 6022 ></wui-wallet-image>`:!this.showAllWallets&&!this.imageSrc?le`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`:null}templateStatus(){return this.loading?le`<wui-loading-spinner 6023 size="lg" 6024 color=${this.loadingSpinnerColor} 6025 ></wui-loading-spinner>`:this.tagLabel&&this.tagVariant?le`<wui-tag variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:this.icon?le`<wui-icon color="inherit" size="sm" name=${this.icon}></wui-icon>`:null}};Za.styles=[Dn,Jr,NLe];El([be({type:Array})],Za.prototype,"walletImages",void 0);El([be()],Za.prototype,"imageSrc",void 0);El([be()],Za.prototype,"name",void 0);El([be()],Za.prototype,"tagLabel",void 0);El([be()],Za.prototype,"tagVariant",void 0);El([be()],Za.prototype,"icon",void 0);El([be()],Za.prototype,"walletIcon",void 0);El([be()],Za.prototype,"tabIdx",void 0);El([be({type:Boolean})],Za.prototype,"installed",void 0);El([be({type:Boolean})],Za.prototype,"disabled",void 0);El([be({type:Boolean})],Za.prototype,"showAllWallets",void 0);El([be({type:Boolean})],Za.prototype,"loading",void 0);El([be({type:String})],Za.prototype,"loadingSpinnerColor",void 0);Za=El([ot("wui-list-wallet")],Za);var gE=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let I1=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Ge.state.connectors,this.count=Ft.state.count,this.filteredCount=Ft.state.filteredWallets.length,this.isFetchingRecommendedWallets=Ft.state.isFetchingRecommendedWallets,this.unsubscribe.push(Ge.subscribeKey("connectors",e=>this.connectors=e),Ft.subscribeKey("count",e=>this.count=e),Ft.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),Ft.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}
6025disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.find(u=>u.id==="walletConnect"),{allWallets:t}=Ue.state;if(!e||t==="HIDE"||t==="ONLY_MOBILE"&&!tt.isMobile())return null;const r=Ft.state.featured.length,i=this.count+r,s=i<10?i:Math.floor(i/10)*10,o=this.filteredCount>0?this.filteredCount:s;let a=`${o}`;this.filteredCount>0?a=`${this.filteredCount}`:o<i&&(a=`${o}+`);const c=nt.hasAnyConnection(Be.CONNECTOR_ID.WALLET_CONNECT);return le` 6026 <wui-list-wallet 6027 name="All Wallets" 6028 walletIcon="allWallets" 6029 showAllWallets 6030 @click=${this.onAllWallets.bind(this)} 6031 tagLabel=${a} 6032 tagVariant="shade" 6033 data-testid="all-wallets" 6034 tabIdx=${Nt(this.tabIdx)} 6035 .loading=${this.isFetchingRecommendedWallets} 6036 loadingSpinnerColor=${this.isFetchingRecommendedWallets?"fg-300":"accent-100"} 6037 ?disabled=${c} 6038 ></wui-list-wallet> 6039 `}onAllWallets(){xn.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),it.push("AllWallets")}};gE([be()],I1.prototype,"tabIdx",void 0);gE([qe()],I1.prototype,"connectors",void 0);gE([qe()],I1.prototype,"count",void 0);gE([qe()],I1.prototype,"filteredCount",void 0);gE([qe()],I1.prototype,"isFetchingRecommendedWallets",void 0);I1=gE([ot("w3m-all-wallets-widget")],I1);var OR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let rC=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Ge.state.connectors,this.connections=nt.state.connections,this.unsubscribe.push(Ge.subscribeKey("connectors",e=>this.connectors=e),nt.subscribeKey("connections",e=>this.connections=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(t=>t.type==="ANNOUNCED");return e!=null&&e.length?le` 6040 <wui-flex flexDirection="column" gap="xs"> 6041 ${e.filter(Xd.showConnector).map(t=>{const i=(this.connections.get(t.chain)??[]).some(s=>xi.isLowerCaseMatch(s.connectorId,t.id));return le` 6042 <wui-list-wallet 6043 imageSrc=${Nt(Hr.getConnectorImage(t))} 6044 name=${t.name??"Unknown"} 6045 @click=${()=>this.onConnector(t)} 6046 tagVariant=${i?"shade":"success"} 6047 tagLabel=${i?"connected":"installed"} 6048 data-testid=${`wallet-selector-${t.id}`} 6049 .installed=${!0} 6050 tabIdx=${Nt(this.tabIdx)} 6051 > 6052 </wui-list-wallet> 6053 `})} 6054 </wui-flex> 6055 `:(this.style.cssText="display: none",null)}onConnector(e){e.id==="walletConnect"?tt.isMobile()?it.push("AllWallets"):it.push("ConnectingWalletConnect"):it.push("ConnectingExternal",{connector:e})}};OR([be()],rC.prototype,"tabIdx",void 0);OR([qe()],rC.prototype,"connectors",void 0);OR([qe()],rC.prototype,"connections",void 0);rC=OR([ot("w3m-connect-announced-widget")],rC);var PR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let iC=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Ge.state.connectors,this.loading=!1,this.unsubscribe.push(Ge.subscribeKey("connectors",e=>this.connectors=e)),tt.isTelegram()&&tt.isIos()&&(this.loading=!nt.state.wcUri,this.unsubscribe.push(nt.subscribeKey("wcUri",e=>this.loading=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{customWallets:e}=Ue.state;if(!(e!=null&&e.length))return this.style.cssText="display: none",null;const t=this.filterOutDuplicateWallets(e),r=nt.hasAnyConnection(Be.CONNECTOR_ID.WALLET_CONNECT);return le`<wui-flex flexDirection="column" gap="xs"> 6056 ${t.map(i=>le` 6057 <wui-list-wallet 6058 imageSrc=${Nt(Hr.getWalletImage(i))} 6059 name=${i.name??"Unknown"} 6060 @click=${()=>this.onConnectWallet(i)} 6061 data-testid=${`wallet-selector-${i.id}`} 6062 tabIdx=${Nt(this.tabIdx)} 6063 ?loading=${this.loading} 6064 ?disabled=${r} 6065 > 6066 </wui-list-wallet> 6067 `)} 6068 </wui-flex>`}filterOutDuplicateWallets(e){const t=wt.getRecentWallets(),r=this.connectors.map(a=>{var c;return(c=a.info)==null?void 0:c.rdns}
6068).filter(Boolean),i=t.map(a=>a.rdns).filter(Boolean),s=r.concat(i);if(s.includes("io.metamask.mobile")&&tt.isMobile()){const a=s.indexOf("io.metamask.mobile");s[a]="io.metamask"}return e.filter(a=>!s.includes(String(a==null?void 0:a.rdns)))}onConnectWallet(e){this.loading||it.push("ConnectingWalletConnect",{wallet:e})}};PR([be()],iC.prototype,"tabIdx",void 0);PR([qe()],iC.prototype,"connectors",void 0);PR([qe()],iC.prototype,"loading",void 0);iC=PR([ot("w3m-connect-custom-widget")],iC);var ej=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let XN=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Ge.state.connectors,this.unsubscribe.push(Ge.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const r=this.connectors.filter(s=>s.type==="EXTERNAL").filter(Xd.showConnector).filter(s=>s.id!==Be.CONNECTOR_ID.COINBASE_SDK);if(!(r!=null&&r.length))return this.style.cssText="display: none",null;const i=nt.hasAnyConnection(Be.CONNECTOR_ID.WALLET_CONNECT);return le` 6069 <wui-flex flexDirection="column" gap="xs"> 6070 ${r.map(s=>le` 6071 <wui-list-wallet 6072 imageSrc=${Nt(Hr.getConnectorImage(s))} 6073 .installed=${!0} 6074 name=${s.name??"Unknown"} 6075 data-testid=${`wallet-selector-external-${s.id}`} 6076 @click=${()=>this.onConnector(s)} 6077 tabIdx=${Nt(this.tabIdx)} 6078 ?disabled=${i} 6079 > 6080 </wui-list-wallet> 6081 `)} 6082 </wui-flex> 6083 `}onConnector(e){it.push("ConnectingExternal",{connector:e})}};ej([be()],XN.prototype,"tabIdx",void 0);ej([qe()],XN.prototype,"connectors",void 0);XN=ej([ot("w3m-connect-external-widget")],XN);var tj=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let JN=class extends ut{constructor(){super(...arguments),this.tabIdx=void 0,this.wallets=[]}render(){if(!this.wallets.length)return this.style.cssText="display: none",null;const e=nt.hasAnyConnection(Be.CONNECTOR_ID.WALLET_CONNECT);return le` 6084 <wui-flex flexDirection="column" gap="xs"> 6085 ${this.wallets.map(t=>le` 6086 <wui-list-wallet 6087 data-testid=${`wallet-selector-featured-${t.id}`} 6088 imageSrc=${Nt(Hr.getWalletImage(t))} 6089 name=${t.name??"Unknown"} 6090 @click=${()=>this.onConnectWallet(t)} 6091 tabIdx=${Nt(this.tabIdx)} 6092 ?disabled=${e} 6093 > 6094 </wui-list-wallet> 6095 `)} 6096 </wui-flex> 6097 `}onConnectWallet(e){Ge.selectWalletConnector(e)}};tj([be()],JN.prototype,"tabIdx",void 0);tj([be()],JN.prototype,"wallets",void 0);JN=tj([ot("w3m-connect-featured-widget")],JN);var DR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let sC=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=[],this.connections=nt.state.connections,this.unsubscribe.push(nt.subscribeKey("connections",e=>this.connections=e))}render(){const e=this.connectors.filter(Xd.showConnector);return e.length===0?(this.style.cssText="display: none",null):le` 6098 <wui-flex flexDirection="column" gap="xs"> 6099 ${e.map(t=>{const i=(this.connections.get(t.chain)??[]).some(s=>xi.isLowerCaseMatch(s.connectorId,t.id));return le` 6100 <wui-list-wallet 6101 imageSrc=${Nt(Hr.getConnectorImage(t))} 6102 .installed=${!0} 6103 name=${t.name??"Unknown"} 6104 tagVariant=${i?"shade":"success"} 6105 tagLabel=${i?"connected":"installed"} 6106 data-testid=${`wallet-selector-${t.id}`} 6107 @click=${()=>this.onConnector(t)} 6108 tabIdx=${Nt(this.tabIdx)} 6109 > 6110 </wui-list-wallet> 6111 `})} 6112 </wui-flex> 6113 `}onConnector(e){Ge.setActiveConnector(e),it.push("ConnectingExter
6113nal",{connector:e})}};DR([be()],sC.prototype,"tabIdx",void 0);DR([be()],sC.prototype,"connectors",void 0);DR([qe()],sC.prototype,"connections",void 0);sC=DR([ot("w3m-connect-injected-widget")],sC);var nj=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let e8=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Ge.state.connectors,this.unsubscribe.push(Ge.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(t=>t.type==="MULTI_CHAIN"&&t.name!=="WalletConnect");return e!=null&&e.length?le` 6114 <wui-flex flexDirection="column" gap="xs"> 6115 ${e.map(t=>le` 6116 <wui-list-wallet 6117 imageSrc=${Nt(Hr.getConnectorImage(t))} 6118 .installed=${!0} 6119 name=${t.name??"Unknown"} 6120 tagVariant="shade" 6121 tagLabel="multichain" 6122 data-testid=${`wallet-selector-${t.id}`} 6123 @click=${()=>this.onConnector(t)} 6124 tabIdx=${Nt(this.tabIdx)} 6125 > 6126 </wui-list-wallet> 6127 `)} 6128 </wui-flex> 6129 `:(this.style.cssText="display: none",null)}onConnector(e){Ge.setActiveConnector(e),it.push("ConnectingMultiChain")}};nj([be()],e8.prototype,"tabIdx",void 0);nj([qe()],e8.prototype,"connectors",void 0);e8=nj([ot("w3m-connect-multi-chain-widget")],e8);var BR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let oC=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Ge.state.connectors,this.loading=!1,this.unsubscribe.push(Ge.subscribeKey("connectors",e=>this.connectors=e)),tt.isTelegram()&&tt.isIos()&&(this.loading=!nt.state.wcUri,this.unsubscribe.push(nt.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const t=wt.getRecentWallets().filter(i=>!Uf.isExcluded(i)).filter(i=>!this.hasWalletConnector(i)).filter(i=>this.isWalletCompatibleWithCurrentChain(i));if(!t.length)return this.style.cssText="display: none",null;const r=nt.hasAnyConnection(Be.CONNECTOR_ID.WALLET_CONNECT);return le` 6130 <wui-flex flexDirection="column" gap="xs"> 6131 ${t.map(i=>le` 6132 <wui-list-wallet 6133 imageSrc=${Nt(Hr.getWalletImage(i))} 6134 name=${i.name??"Unknown"} 6135 @click=${()=>this.onConnectWallet(i)} 6136 tagLabel="recent" 6137 tagVariant="shade" 6138 tabIdx=${Nt(this.tabIdx)} 6139 ?loading=${this.loading} 6140 ?disabled=${r} 6141 > 6142 </wui-list-wallet> 6143 `)} 6144 </wui-flex> 6145 `}onConnectWallet(e){this.loading||Ge.selectWalletConnector(e)}hasWalletConnector(e){return this.connectors.some(t=>t.id===e.id||t.name===e.name)}isWalletCompatibleWithCurrentChain(e){const t=ue.state.activeChain;return t&&e.chains?e.chains.some(r=>{const i=r.split(":")[0];return t===i}):!0}};BR([be()],oC.prototype,"tabIdx",void 0);BR([qe()],oC.prototype,"connectors",void 0);BR([qe()],oC.prototype,"loading",void 0);oC=BR([ot("w3m-connect-recent-widget")],oC);var LR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let aC=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.wallets=[],this.loading=!1,tt.isTelegram()&&tt.isIos()&&(this.loading=!nt.state.wcUri,this.unsubscribe.push(nt.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const{connectors:e}=Ge.state,{customWallets:t,featuredWalletIds:r}=Ue.state,i=wt.getRecentWallets(),s=e.find(m=>m.id==="walletConnect"),a=e.filter(m=>m.type==="INJECTED"||m.type==="ANNOUNCED"||m.type==="MULTI_CHAIN").filter(m=>m.name!=="Browser Wallet");if(!s)return null;if(r||t||!this.wallets.length)return this.style.cssText="display: none",null;const c=a.length+i.length,u=Math.max(0,2-c),d=Uf.filterOutDuplicateWallets(this.wallets).slice(0,u);if(!d.length)return this.style.cssText="display: none",null;const f=nt.hasAnyConnection(Be.CONNECTOR_ID.WALLET_CONNECT);return le` 6146 <wui-flex flexDirection="column" gap="xs"> 6147 ${d.map(m=>le` 6148 <wui-list-wallet 6149 imageSrc=${Nt(Hr.getWalletImage(m))}
6150 name=${(m==null?void 0:m.name)??"Unknown"} 6151 @click=${()=>this.onConnectWallet(m)} 6152 tabIdx=${Nt(this.tabIdx)} 6153 ?loading=${this.loading} 6154 ?disabled=${f} 6155 > 6156 </wui-list-wallet> 6157 `)} 6158 </wui-flex> 6159 `}onConnectWallet(e){if(this.loading)return;const t=Ge.getConnector({id:e.id,rdns:e.rdns});t?it.push("ConnectingExternal",{connector:t}):it.push("ConnectingWalletConnect",{wallet:e})}};LR([be()],aC.prototype,"tabIdx",void 0);LR([be()],aC.prototype,"wallets",void 0);LR([qe()],aC.prototype,"loading",void 0);aC=LR([ot("w3m-connect-recommended-widget")],aC);var $R=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let cC=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Ge.state.connectors,this.connectorImages=bo.state.connectorImages,this.unsubscribe.push(Ge.subscribeKey("connectors",e=>this.connectors=e),bo.subscribeKey("connectorImages",e=>this.connectorImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(tt.isMobile())return this.style.cssText="display: none",null;const e=this.connectors.find(i=>i.id==="walletConnect");if(!e)return this.style.cssText="display: none",null;const t=e.imageUrl||this.connectorImages[(e==null?void 0:e.imageId)??""],r=nt.hasAnyConnection(Be.CONNECTOR_ID.WALLET_CONNECT);return le` 6160 <wui-list-wallet 6161 imageSrc=${Nt(t)} 6162 name=${e.name??"Unknown"} 6163 @click=${()=>this.onConnector(e)} 6164 tagLabel="qr code" 6165 tagVariant="main" 6166 tabIdx=${Nt(this.tabIdx)} 6167 data-testid="wallet-selector-walletconnect" 6168 ?disabled=${r} 6169 > 6170 </wui-list-wallet> 6171 `}onConnector(e){Ge.setActiveConnector(e),it.push("ConnectingWalletConnect")}};$R([be()],cC.prototype,"tabIdx",void 0);$R([qe()],cC.prototype,"connectors",void 0);$R([qe()],cC.prototype,"connectorImages",void 0);cC=$R([ot("w3m-connect-walletconnect-widget")],cC);const RLe=Mt` 6172 :host { 6173 margin-top: var(--wui-spacing-3xs); 6174 } 6175 wui-separator { 6176 margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs) 6177 calc(var(--wui-spacing-m) * -1); 6178 width: calc(100% + var(--wui-spacing-s) * 2); 6179 } 6180`;var w4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let N1=class extends ut{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=Ge.state.connectors,this.recommended=Ft.state.recommended,this.featured=Ft.state.featured,this.unsubscribe.push(Ge.subscribeKey("connectors",e=>this.connectors=e),Ft.subscribeKey("recommended",e=>this.recommended=e),Ft.subscribeKey("featured",e=>this.featured=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return le` 6181 <wui-flex flexDirection="column" gap="xs"> ${this.connectorListTemplate()} </wui-flex> 6182 `}connectorListTemplate(){const{custom:e,recent:t,announced:r,injected:i,multiChain:s,recommended:o,featured:a,external:c}=Xd.getConnectorsByType(this.connectors,this.recommended,this.featured);return Xd.getConnectorTypeOrder({custom:e,recent:t,announced:r,injected:i,multiChain:s,recommended:o,featured:a,external:c}).map(d=>{switch(d){case"injected":return le` 6183 ${s.length?le`<w3m-connect-multi-chain-widget 6184 tabIdx=${Nt(this.tabIdx)} 6185 ></w3m-connect-multi-chain-widget>`:null} 6186 ${r.length?le`<w3m-connect-announced-widget 6187 tabIdx=${Nt(this.tabIdx)} 6188 ></w3m-connect-announced-widget>`:null} 6189 ${i.length?le`<w3m-connect-injected-widget 6190 .connectors=${i} 6191 tabIdx=${Nt(this.tabIdx)} 6192 ></w3m-connect-injected-widget>`:null} 6193 `;case"walletConnect":return le`<w3m-connect-walletconnect-widget 6194 tabIdx=${Nt(this.tabIdx)} 6195 ></w3m-connect-walletconnect-widget>`;case"recent":return le`<w3m-connect-recent-widget 6196 tabIdx=${Nt(this.tabIdx)} 6197 ></w3m-connect-recent-widget>`;case"featured":return le`<w3m-connect-featured-widget 6198 .wallets=${a} 6199 tabIdx=${Nt(this.tabIdx)} 6200 ></w3m-connect-featured-widget>`;
6200case"custom":return le`<w3m-connect-custom-widget 6201 tabIdx=${Nt(this.tabIdx)} 6202 ></w3m-connect-custom-widget>`;case"external":return le`<w3m-connect-external-widget 6203 tabIdx=${Nt(this.tabIdx)} 6204 ></w3m-connect-external-widget>`;case"recommended":return le`<w3m-connect-recommended-widget 6205 .wallets=${o} 6206 tabIdx=${Nt(this.tabIdx)} 6207 ></w3m-connect-recommended-widget>`;default:return console.warn(`Unknown connector type: ${d}`),null}})}};N1.styles=RLe;w4([be()],N1.prototype,"tabIdx",void 0);w4([qe()],N1.prototype,"connectors",void 0);w4([qe()],N1.prototype,"recommended",void 0);w4([qe()],N1.prototype,"featured",void 0);N1=w4([ot("w3m-connector-list")],N1);var Sse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let BB=class extends ut{constructor(){super(...arguments),this.tabIdx=void 0}render(){return le` 6208 <wui-flex flexDirection="column" gap="xs"> 6209 <w3m-connector-list tabIdx=${Nt(this.tabIdx)}></w3m-connector-list> 6210 <w3m-all-wallets-widget tabIdx=${Nt(this.tabIdx)}></w3m-all-wallets-widget> 6211 </wui-flex> 6212 `}};Sse([be()],BB.prototype,"tabIdx",void 0);BB=Sse([ot("w3m-wallet-login-list")],BB);const MLe=Mt` 6213 :host { 6214 --connect-scroll--top-opacity: 0; 6215 --connect-scroll--bottom-opacity: 0; 6216 --connect-mask-image: none; 6217 } 6218 6219 .connect { 6220 max-height: clamp(360px, 470px, 80vh); 6221 scrollbar-width: none; 6222 overflow-y: scroll; 6223 overflow-x: hidden; 6224 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 6225 will-change: opacity; 6226 mask-image: var(--connect-mask-image); 6227 } 6228 6229 .guide { 6230 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 6231 will-change: opacity; 6232 } 6233 6234 .connect::-webkit-scrollbar {
6235 display: none; 6236 } 6237 6238 .all-wallets { 6239 flex-flow: column; 6240 } 6241 6242 .connect.disabled, 6243 .guide.disabled { 6244 opacity: 0.3; 6245 pointer-events: none; 6246 user-select: none; 6247 } 6248 6249 wui-separator { 6250 margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); 6251 width: calc(100% + var(--wui-spacing-s) * 2); 6252 } 6253`;var rd=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const kLe=470;let Tc=class extends ut{constructor(){var e,t;super(),this.unsubscribe=[],this.connectors=Ge.state.connectors,this.authConnector=this.connectors.find(r=>r.type==="AUTH"),this.features=Ue.state.features,this.remoteFeatures=Ue.state.remoteFeatures,this.enableWallets=Ue.state.enableWallets,this.noAdapters=ue.state.noAdapters,this.walletGuide="get-started",this.checked=Gy.state.isLegalCheckboxChecked,this.isEmailEnabled=((e=this.remoteFeatures)==null?void 0:e.email)&&!ue.state.noAdapters,this.isSocialEnabled=((t=this.remoteFeatures)==null?void 0:t.socials)&&this.remoteFeatures.socials.length>0&&!ue.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(Ge.subscribeKey("connectors",r=>{this.connectors=r,this.authConnector=this.connectors.find(i=>i.type==="AUTH"),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),Ue.subscribeKey("features",r=>{this.features=r}),Ue.subscribeKey("remoteFeatures",r=>{this.remoteFeatures=r,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),Ue.subscribeKey("enableWallets",r=>this.enableWallets=r),ue.subscribeKey("noAdapters",r=>this.setEmailAndSocialEnableCheck(r,this.remoteFeatures)),Gy.subscribeKey("isLegalCheckboxChecked",r=>this.checked=r))}disconnectedCallback(){var t,r;this.unsubscribe.forEach(i=>i()),(t=this.resizeObserver)==null||t.disconnect();const e=(r=this.shadowRoot)==null?void 0:r.querySelector(".connect");e==null||e.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){var t,r;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e==null||e.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),(r=this.resizeObserver)==null||r.observe(e),this.handleConnectListScroll())}render(){var m;const{termsConditionsUrl:e,privacyPolicyUrl:t}=Ue.state,r=(m=Ue.state.features)==null?void 0:m.legalCheckbox,o=!!(e||t)&&!!r&&this.walletGuide==="get-started"&&!this.checked,a={connect:!0,disabled:o},c=Ue.state.enableWalletGuide,u=this.enableWallets,d=this.isSocialEnabled||this.authConnector,f=o?-1:void 0;return le` 6254 <wui-flex flexDirection="column"> 6255 ${this.legalCheckboxTemplate()} 6256 <wui-flex 6257 data-testid="w3m-connect-scroll-view" 6258 flexDirection="column" 6259 class=${Y_(a)} 6260 > 6261 <wui-flex 6262 class="connect-methods" 6263 flexDirection="column" 6264 gap="s" 6265 .padding=${d&&u&&c&&this.walletGuide==="get-started"?["3xs","s","0","s"]:["3xs","s","s","s"]} 6266 > 6267 ${this.renderConnectMethod(f)} 6268 </wui-flex> 6269 </wui-flex> 6270 ${this.guideTemplate(o)} 6271 <w3m-legal-footer></w3m-legal-footer> 6272 </wui-flex> 6273 `}setEmailAndSocialEnableCheck(e,t){this.isEmailEnabled=(t==null?void 0:t.email)&&!e,this.isSocialEnabled=(t==null?void 0:t.socials)&&t.socials.length>0&&!e,this.remoteFeatures=t,this.noAdapters=e}checkIfAuthEnabled(e){const t=e.filter(i=>i.type===ss.CONNECTOR_TYPE_AUTH).map(i=>i.chain);return Be.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(i=>t.includes(i))}renderConnectMethod(e){const t=Uf.getConnectOrderMethod(this.features,this.connectors);return le`${t.map((r,i)=>{switch(r){case"email":return le`${this.emailTemplate(e)} ${this.separatorTemplate(i,"email")}`;case"social":return le`${this.socialListTemplate(e)} 6274 ${this.separatorTemplate(i,"social")}`;case"wallet":return le`${this.walletListTemplate(e)} 6275 ${this.separatorTemplate(i,"wallet")}`;default:return null}})}`}checkMethodEnabled(e){switch(e){case"wallet":return this.enableWallets;case"social":return this.isSocialEnabled&&this.isAuthEnabled;case"email":return this.isEmailEnabled&&this.isAuthEnabled;default:return null}}checkIsThereNextMethod(e){const r=Uf.getConnectOrderMethod(this.features,this.connectors)[e+1];return r?this.checkMethodEnabled(r)?r:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,t){const r=this.checkIsThereNextMethod(e),i=this.walletGuide==="explore";switch(t){case"wallet":return this.enableWallets&&r&&!i?le`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;case"email":{const s=r==="social";return this.isAuthEnabled&&this.isEmailEnabled&&!s&&r?le`<wui-separator 6276 data-testid="w3m-email-login-or-separator" 6277 text="or" 6278 ></wui-separator>`:null}case"social":{const s=r==="email";return this.isAuthEnabled&&this.isSocialEnabled&&!s&&r?le`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null}default:return null}}emailTemplate(e){return!this.isEmailEnabled||!this.isAuthEnabled?null:le`<w3m-email-login-widget 6279 walletGuide=${this.walletGuide} 6280 tabIdx=${Nt(e)} 6281 ></w3m-email-login-widget>`}socialListTemplate(e){return!this.isSocialEnabled||!this.isAuthEnabled?null:le`<w3m-social-login-widget 6282 walletGuide=${this.walletGuide} 6283 tabIdx=${Nt(e)} 6284 ></w3m-social-login-widget>`}walletListTemplate(e){var a,c;const t=this.enableWallets,r=((a=this.features)==null?void 0:a.emailShowWallets)===!1,i=(c=this.features)==null?void 0:c.collapseWallets,s=r||i;return!t||(tt.isTelegram()&&(tt.isSafari()||tt.isIos())&&nt.connectWalletConnect().catch(u=>({})),this.walletGuide==="explore")?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&s?le`<wui-list-button 6285 data-testid="w3m-collapse-wallets-button" 6286 tabIdx=${Nt(e)} 6287 @click=${this.onContinueWalletClick.bind(this)} 6288 text="Continue with a wallet" 6289 ></wui-list-button>`:le`<w3m-wallet-login-list tabIdx=${Nt(e)}></w3m-wallet-login-list>`}guideTemplate(e=!1){if(!Ue.state.enableWalletGuide)return null;const r={guide:!0,disabled:e},i=e?-1:void 0;return!this.authConnector&&!this.isSocialEnabled?null:le` 6290 ${this.walletGuide==="explore"&&!ue.state.noAdapters?le`<wui-separator data-testid="wui-separator" id="explore" text="or"></wui-separator>`:null} 6291 <w3m-wallet-guide 6292 class=${Y_(r)} 6293 tabIdx=${Nt(i)} 6294 walletGuide=${this.walletGuide} 6295 ></w3m-wallet-guide> 6296 `}legalCheckboxTemplate(){return this.walletGuide==="explore"?null:le`<w3m-legal-checkbox data-testid="w3m-legal-checkbox"></w3m-legal-checkbox>`}handleConnectListScroll(){var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector(".connect");
6296if(!e)return;e.scrollHeight>kLe?(e.style.setProperty("--connect-mask-image",`linear-gradient( 6297 to bottom, 6298 rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px, 6299 rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px, 6300 black 40px, 6301 black calc(100% - 40px), 6302 rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px), 6303 rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100% 6304 )`),e.style.setProperty("--connect-scroll--top-opacity",dN.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",dN.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString())):(e.style.setProperty("--connect-mask-image","none"),e.style.setProperty("--connect-scroll--top-opacity","0"),e.style.setProperty("--connect-scroll--bottom-opacity","0"))}onContinueWalletClick(){it.push("ConnectWallets")}};Tc.styles=MLe;rd([qe()],Tc.prototype,"connectors",void 0);rd([qe()],Tc.prototype,"authConnector",void 0);rd([qe()],Tc.prototype,"features",void 0);rd([qe()],Tc.prototype,"remoteFeatures",void 0);rd([qe()],Tc.prototype,"enableWallets",void 0);rd([qe()],Tc.prototype,"noAdapters",void 0);rd([be()],Tc.prototype,"walletGuide",void 0);rd([qe()],Tc.prototype,"checked",void 0);rd([qe()],Tc.prototype,"isEmailEnabled",void 0);rd([qe()],Tc.prototype,"isSocialEnabled",void 0);rd([qe()],Tc.prototype,"isAuthEnabled",void 0);Tc=rd([ot("w3m-connect-view")],Tc);const OLe=Mt` 6305 :host { 6306 display: block; 6307 width: var(--wui-box-size-md); 6308 height: var(--wui-box-size-md); 6309 } 6310 6311 svg { 6312 width: var(--wui-box-size-md); 6313 height: var(--wui-box-size-md); 6314 } 6315 6316 rect { 6317 fill: none; 6318 stroke: var(--wui-color-accent-100); 6319 stroke-width: 4px; 6320 stroke-linecap: round; 6321 animation: dash 1s linear infinite; 6322 } 6323 6324 @keyframes dash { 6325 to { 6326 stroke-dashoffset: 0px; 6327 } 6328 } 6329`;var _se=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let t8=class extends ut{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const e=this.radius>50?50:this.radius,r=36-e,i=116+r,s=245+r,o=360+r*1.75;return le` 6330 <svg viewBox="0 0 110 110" width="110" height="110"> 6331 <rect 6332 x="2" 6333 y="2" 6334 width="106" 6335 height="106" 6336 rx=${e} 6337 stroke-dasharray="${i} ${s}" 6338 stroke-dashoffset=${o} 6339 /> 6340 </svg> 6341 `}};t8.styles=[Dn,OLe];_se([be({type:Number})],t8.prototype,"radius",void 0);t8=_se([ot("wui-loading-thumbnail")],t8);const PLe=Mt` 6342 button { 6343 border: none; 6344 border-radius: var(--wui-border-radius-3xl); 6345 } 6346 6347 button[data-variant='main'] { 6348 background-color: var(--wui-color-accent-100); 6349 color: var(--wui-color-inverse-100); 6350 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 6351 } 6352 6353 button[data-variant='accent'] { 6354 background-color: var(--wui-color-accent-glass-010); 6355 color: var(--wui-color-accent-100); 6356 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 6357 } 6358 6359 button[data-variant='gray'] { 6360 background-color: transparent; 6361 color: var(--wui-color-fg-200); 6362 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 6363 } 6364 6365 button[data-variant='shade'] { 6366 background-color: transparent; 6367 color: var(--wui-color-accent-100); 6368 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 6369 } 6370 6371 button[data-size='sm'] { 6372 height: 32px; 6373 padding: 0 var(--wui-spacing-s); 6374 } 6375 6376 button[data-size='md'] { 6377 height: 40px; 6378 padding: 0 var(--wui-spacing-l); 6379 } 6380 6381 button[data-size='sm'] > wui-image { 6382 width: 16px; 6383 height: 16px; 6384 } 6385 6386 button[data-size='md'] > wui-image { 6387 width: 24px; 6388 height: 24px; 6389 } 6390 6391 button[data-size='sm'] > wui-icon { 6392 width: 12px; 6393 height: 12px; 6394 } 6395 6396 button[data-size='md'] > wui-icon { 6397 width: 14px; 6398 height: 14px; 6399 } 6400 6401 wui-image { 6402 border-radius: var(--wui-border-radius-3xl); 6403 overflow: hidden; 6404 } 6405 6406 button.disabled > wui-icon, 6407 button.disabled > wui-image { 6408 filter: grayscale(1); 6409 } 6410 6411 button[data-variant='main'] > wui-image { 6412 box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); 6413 } 6414 6415 button[data-variant='shade'] > wui-image, 6416 button[data-variant='gray'] > wui-image { 6417 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); 6418 } 6419 6420 @media (hover: hover) and (pointer: fine) { 6421 button[data-variant='main']:focus-visible { 6422 background-color: var(--wui-color-accent-090); 6423 } 6424 6425 button[data-variant='main']:hover:enabled { 6426 background-color: var(--wui-color-accent-090); 6427 } 6428 6429 button[data-variant='main']:active:enabled { 6430 background-color: var(--wui-color-accent-080); 6431 } 6432 6433 button[data-variant='accent']:hover:enabled { 6434 background-color: var(--wui-color-accent-glass-015); 6435 } 6436 6437 button[data-variant='accent']:active:enabled { 6438 background-color: var(--wui-color-accent-glass-020); 6439 } 6440 6441 button[data-variant='shade']:focus-visible, 6442 button[data-variant='gray']:focus-visible, 6443 button[data-variant='shade']:hover, 6444 button[data-variant='gray']:hover { 6445 background-color: var(--wui-color-gray-glass-002); 6446 } 6447 6448 button[data-variant='gray']:active, 6449 button[data-variant='shade']:active { 6450 background-color: var(--wui-color-gray-glass-005); 6451 } 6452 } 6453 6454 button.disabled { 6455 color: var(--wui-color-gray-glass-020); 6456 background-color: var(--wui-color-gray-glass-002); 6457 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); 6458 pointer-events: none; 6459 } 6460`;var lb=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let yg=class extends ut{constructor(){super(...arguments),this.variant="accent",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.size="md",this.text=""}render(){const e=this.size==="sm"?"small-600":"paragraph-600";return le` 6461 <button 6462 class=${this.disabled?"disabled":""} 6463 data-variant=${this.variant} 6464 data-size=${this.size} 6465 > 6466 ${this.imageSrc?le`<wui-image src=${this.imageSrc}></wui-image>`:null} 6467 <wui-text variant=${e} color="inherit"> ${this.text} </wui-text> 6468 <wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon> 6469 </button> 6470 `}};yg.styles=[Dn,Jr,PLe];lb([be()],yg.prototype,"variant",void 0);lb([be()],yg.prototype,"imageSrc",void 0);lb([be({type:Boolean})],yg.prototype,"disabled",void 0);lb([be()],yg.prototype,"icon",void 0);lb([be()],yg.prototype,"size",void 0);lb([be()],yg.prototype,"text",void 0);yg=lb([ot("wui-chip-button")],yg);const DLe=Mt` 6471 wui-flex { 6472 width: 100%; 6473 background-color: var(--wui-color-gray-glass-002); 6474 border-radius: var(--wui-border-radius-xs); 6475 } 6476`;var UR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Px=class extends ut{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return le` 6477 <wui-flex 6478 justifyContent="space-between" 6479 alignItems="center" 6480 .padding=${["1xs","2l","1xs","2l"]} 6481 > 6482 <wui-text variant="paragraph-500" color="fg-200">${this.label}</wui-text> 6483 <wui-chip-button size="sm" variant="shade" text=${this.buttonLabel} icon="chevronRight"> 6484 </wui-chip-button>
6484 6485 </wui-flex> 6486 `}};Px.styles=[Dn,Jr,DLe];UR([be({type:Boolean})],Px.prototype,"disabled",void 0);UR([be()],Px.prototype,"label",void 0);UR([be()],Px.prototype,"buttonLabel",void 0);Px=UR([ot("wui-cta-button")],Px);const BLe=Mt` 6487 :host { 6488 display: block; 6489 padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl); 6490 } 6491`;var Cse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let n8=class extends ut{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:t,play_store:r,chrome_store:i,homepage:s}=this.wallet,o=tt.isMobile(),a=tt.isIos(),c=tt.isAndroid(),u=[t,r,s,i].filter(Boolean).length>1,d=zi.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return u&&!o?le` 6492 <wui-cta-button 6493 label=${`Don't have ${d}?`} 6494 buttonLabel="Get" 6495 @click=${()=>it.push("Downloads",{wallet:this.wallet})} 6496 ></wui-cta-button> 6497 `:!u&&s?le` 6498 <wui-cta-button 6499 label=${`Don't have ${d}?`} 6500 buttonLabel="Get" 6501 @click=${this.onHomePage.bind(this)} 6502 ></wui-cta-button> 6503 `:t&&a?le` 6504 <wui-cta-button 6505 label=${`Don't have ${d}?`} 6506 buttonLabel="Get" 6507 @click=${this.onAppStore.bind(this)} 6508 ></wui-cta-button> 6509 `:r&&c?le` 6510 <wui-cta-button 6511 label=${`Don't have ${d}?`} 6512 buttonLabel="Get" 6513 @click=${this.onPlayStore.bind(this)} 6514 ></wui-cta-button> 6515 `:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&tt.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&tt.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&tt.openHref(this.wallet.homepage,"_blank")}};n8.styles=[BLe];Cse([be({type:Object})],n8.prototype,"wallet",void 0);n8=Cse([ot("w3m-mobile-download-links")],n8);const LLe=Mt` 6516 @keyframes shake { 6517 0% { 6518 transform: translateX(0); 6519 } 6520 25% { 6521 transform: translateX(3px); 6522 } 6523 50% { 6524 transform: translateX(-3px); 6525 } 6526 75% { 6527 transform: translateX(3px); 6528 } 6529 100% { 6530 transform: translateX(0); 6531 } 6532 } 6533 6534 wui-flex:first-child:not(:only-child) { 6535 position: relative; 6536 } 6537 6538 wui-loading-thumbnail { 6539 position: absolute; 6540 } 6541 6542 wui-icon-box { 6543 position: absolute; 6544 right: calc(var(--wui-spacing-3xs) * -1); 6545 bottom: calc(var(--wui-spacing-3xs) * -1); 6546 opacity: 0; 6547 transform: scale(0.5); 6548 transition-property: opacity, transform; 6549 transition-duration: var(--wui-duration-lg); 6550 transition-timing-function: var(--wui-ease-out-power-2); 6551 will-change: opacity, transform; 6552 } 6553 6554 wui-text[align='center'] { 6555 width: 100%; 6556 padding: 0px var(--wui-spacing-l); 6557 } 6558 6559 [data-error='true'] wui-icon-box { 6560 opacity: 1; 6561 transform: scale(1); 6562 } 6563 6564 [data-error='true'] > wui-flex:first-child { 6565 animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; 6566 } 6567 6568 [data-retry='false'] wui-link { 6569 display: none; 6570 } 6571 6572 [data-retry='true'] wui-link { 6573 display: block; 6574 opacity: 1; 6575 } 6576`;var bh=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};class Lo extends ut{constructor(){var e,t,r,i,s;super(),this.wallet=(e=it.state.data)==null?void 0:e.wallet,this.connector=(t=it.state.data)==null?void 0:t.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=Hr.getWalletImage(this.wallet)??Hr.getConnectorImage(this.connector),this.name=((r=this.wallet)==null?void 0:r.name)??((i=this.connector)==null?void 0:i.name)??"Wallet",this.isRetrying=!1,this.uri=nt.state.wcUri,this.error=nt.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(nt.subscribeKey("wcUri",o=>{var a;this.uri=o,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(a=this.onConnect)==null||a.call(this))}),nt.subscribeKey("wcError",o=>this.error=o)),(tt.isTelegram()||tt.isSafari())&&tt.isIos()&&nt.state.wcUri&&((s=this.onConnect)==null||s.call(this))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}
6576disconnectedCallback(){this.unsubscribe.forEach(e=>e()),nt.setWcError(!1),clearTimeout(this.timeout)}render(){var r;(r=this.onRender)==null||r.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let t="";return this.label?t=this.label:(t=`Continue in ${this.name}`,this.error&&(t="Connection declined")),le` 6577 <wui-flex 6578 data-error=${Nt(this.error)} 6579 data-retry=${this.showRetry} 6580 flexDirection="column" 6581 alignItems="center" 6582 .padding=${["3xl","xl","xl","xl"]} 6583 gap="xl" 6584 > 6585 <wui-flex justifyContent="center" alignItems="center"> 6586 <wui-wallet-image size="lg" imageSrc=${Nt(this.imageSrc)}></wui-wallet-image> 6587 6588 ${this.error?null:this.loaderTemplate()} 6589 6590 <wui-icon-box 6591 backgroundColor="error-100" 6592 background="opaque" 6593 iconColor="error-100" 6594 icon="close" 6595 size="sm" 6596 border 6597 borderColor="wui-color-bg-125" 6598 ></wui-icon-box> 6599 </wui-flex> 6600 6601 <wui-flex flexDirection="column" alignItems="center" gap="xs"> 6602 <wui-text 6603 align="center" 6604 variant="paragraph-500" 6605 color=${this.error?"error-100":"fg-100"} 6606 > 6607 ${t} 6608 </wui-text> 6609 <wui-text align="center" variant="small-500" color="fg-200">${e}</wui-text> 6610 </wui-flex> 6611 6612 ${this.secondaryBtnLabel?le` 6613 <wui-button 6614 variant="accent" 6615 size="md" 6616 ?disabled=${this.isRetrying||this.isLoading} 6617 @click=${this.onTryAgain.bind(this)} 6618 data-testid="w3m-connecting-widget-secondary-button" 6619 > 6620 <wui-icon color="inherit" slot="iconLeft" name=${this.secondaryBtnIcon}></wui-icon> 6621 ${this.secondaryBtnLabel} 6622 </wui-button> 6623 `:null} 6624 </wui-flex> 6625 6626 ${this.isWalletConnect?le` 6627 <wui-flex .padding=${["0","xl","xl","xl"]} justifyContent="center"> 6628 <wui-link @click=${this.onCopyUri} color="fg-200" data-testid="wui-link-copy"> 6629 <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon> 6630 Copy link 6631 </wui-link> 6632 </wui-flex> 6633 `:null} 6634 6635 <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links> 6636 `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");t==null||t.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,t;nt.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(t=this.onConnect)==null||t.call(this)}loaderTemplate(){const e=na.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return le`<wui-loading-thumbnail radius=${t*9}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(tt.copyToClopboard(this.uri),Ir.showSuccess("Link copied"))}catch{Ir.showError("Failed to copy")}}}Lo.styles=LLe;bh([qe()],Lo.prototype,"isRetrying",void 0);bh([qe()],Lo.prototype,"uri",void 0);bh([qe()],Lo.prototype,"error",void 0);bh([qe()],Lo.prototype,"ready",void 0);bh([qe()],Lo.prototype,"showRetry",void 0);bh([qe()],Lo.prototype,"label",void 0);bh([qe()],Lo.prototype,"secondaryBtnLabel",void 0);bh([qe()],Lo.prototype,"secondaryLabel",void 0);bh([qe()],Lo.prototype,"isLoading",void 0);bh([be({type:Boolean})],Lo.prototype,"isMobile",void 0);bh([be()],Lo.prototype,"onRetry",void 0);var $Le=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let LB=class extends Lo{constructor(){var t,r,i,s;if(super(),this.externalViewUnsubscribe=[],this.connectionsByNamespace=nt.getConnections((t=this.connector)==null?void 0:t.chain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.remoteFeatures=Ue.state.remoteFeatures,this.currentActiveConnectorId=Ge.state.activeConnectorIds[(r=this.connector)==null?void 0:r.chain],!this.connector)throw new Error("w3m-connecting-view: No connector provided");const e=(i=this.connector)==null?void 0:i.chain;this.isAlreadyConnected(this.connector)&&(this.secondaryBtnLabel=void 0,this.label=`This account is already linked, change your account in ${this.connector.name}`,this.secondaryLabel=`To link a new account, open ${this.connector.name} and switch to the account you want to link`),xn.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser",dis
6636playIndex:(s=this.wallet)==null?void 0:s.display_index}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(Ge.subscribeKey("activeConnectorIds",o=>{var u;const a=o[e],c=(u=this.remoteFeatures)==null?void 0:u.multiWallet;a!==this.currentActiveConnectorId&&(this.hasMultipleConnections&&c?(it.replace("ProfileWallets"),Ir.showSuccess("New Wallet Added")):Yn.close())}),nt.subscribeKey("connections",this.onConnectionsChange.bind(this)))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){var e;try{if(this.error=!1,this.connector){if(this.isAlreadyConnected(this.connector))return;(this.connector.id!==Be.CONNECTOR_ID.COINBASE_SDK||!this.error)&&(await nt.connectExternal(this.connector,this.connector.chain),xn.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown",caipNetworkId:(e=ue.getActiveCaipNetwork())==null?void 0:e.caipNetworkId}}))}}catch(t){xn.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(t==null?void 0:t.message)??"Unknown"}}),this.error=!0}}onConnectionsChange(e){var t,r;if((t=this.connector)!=null&&t.chain&&e.get(this.connector.chain)&&this.isAlreadyConnected(this.connector)){const i=e.get(this.connector.chain)??[],s=(r=this.remoteFeatures)==null?void 0:r.multiWallet;if(i.length===0)it.replace("Connect");else{const o=ju.getConnectionsByConnectorId(this.connectionsByNamespace,this.connector.id).flatMap(c=>c.accounts),a=ju.getConnectionsByConnectorId(i,this.connector.id).flatMap(c=>c.accounts);a.length===0?this.hasMultipleConnections&&s?(it.replace("ProfileWallets"),Ir.showSuccess("Wallet deleted")):Yn.close():!o.every(u=>a.some(d=>xi.isLowerCaseMatch(u.address,d.address)))&&s&&it.replace("ProfileWallets")}}}isAlreadyConnected(e){return!!e&&this.connectionsByNamespace.some(t=>xi.isLowerCaseMatch(t.connectorId,e.id))}};LB=$Le([ot("w3m-connecting-external-view")],LB);const ULe=Mt` 6637 wui-flex, 6638 wui-list-wallet { 6639 width: 100%; 6640 } 6641`;var Tse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let lC=class extends ut{constructor(){super(),this.unsubscribe=[],this.activeConnector=Ge.state.activeConnector,this.unsubscribe.push(Ge.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return le` 6642 <wui-flex 6643 flexDirection="column" 6644 alignItems="center" 6645 .padding=${["m","xl","xl","xl"]} 6646 gap="xl" 6647 > 6648 <wui-flex justifyContent="center" alignItems="center"> 6649 <wui-wallet-image 6650 size="lg" 6651 imageSrc=${Nt(Hr.getConnectorImage(this.activeConnector))} 6652 ></wui-wallet-image> 6653 </wui-flex> 6654 <wui-flex 6655 flexDirection="column" 6656 alignItems="center" 6657 gap="xs" 6658 .padding=${["0","s","0","s"]} 6659 > 6660 <wui-text variant="paragraph-500" color="fg-100"> 6661 Select Chain for ${(e=this.activeConnector)==null?void 0:e.name} 6662 </wui-text> 6663 <wui-text align="center" variant="small-500" color="fg-200" 6664 >Select which chain to connect to your multi chain wallet</wui-text 6665 > 6666 </wui-flex> 6667 <wui-flex 6668 flexGrow="1" 6669 flexDirection="column" 6670 alignItems="center" 6671 gap="xs" 6672 .padding=${["xs","0","xs","0"]} 6673 > 6674 ${this.networksTemplate()} 6675 </wui-flex> 6676 </wui-flex> 6677 `}networksTemplate(){var e,t;return(t=(e=this.activeConnector)==null?void 0:e.connectors)==null?void 0:t.map(r=>r.name?le` 6678 <wui-list-wallet 6679 imageSrc=${Nt(Hr.getChainImage(r.chain))} 6680 name=${Be.CHAIN_NAME_MAP[r.chain]} 6681 @click=${()=>this.onConnector(r)} 6682 data-testid="wui-list-chain-${r.chain}" 6683 ></wui-list-wallet> 6684 `:null)}onConnector(e){var r,i;const t=(i=(r=this.activeConnector)==null?void 0:r.connectors)==null?void 0:i.find(s=>s.chain===e.chain);if(!t){Ir.showError("Failed to find connector");return}
6684t.id==="walletConnect"?tt.isMobile()?it.push("AllWallets"):it.push("ConnectingWalletConnect"):it.push("ConnectingExternal",{connector:t})}};lC.styles=ULe;Tse([qe()],lC.prototype,"activeConnector",void 0);lC=Tse([ot("w3m-connecting-multi-chain-view")],lC);var rj=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let r8=class extends ut{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return le` 6685 <wui-flex justifyContent="center" .padding=${["0","0","l","0"]}> 6686 <wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs> 6687 </wui-flex> 6688 `}generateTabs(){const e=this.platforms.map(t=>t==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:t==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:t==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:t==="web"?{label:"Webapp",icon:"browser",platform:"web"}:t==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:t})=>t),e}onTabChange(e){var r;const t=this.platformTabs[e];t&&((r=this.onSelectPlatfrom)==null||r.call(this,t))}};rj([be({type:Array})],r8.prototype,"platforms",void 0);rj([be()],r8.prototype,"onSelectPlatfrom",void 0);r8=rj([ot("w3m-connecting-header")],r8);var jLe=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let jY=class extends Lo{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),xn.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}async onConnectProxy(){var e,t;try{this.error=!1;const{connectors:r}=Ge.state,i=r.find(s=>{var o,a,c;return s.type==="ANNOUNCED"&&((o=s.info)==null?void 0:o.rdns)===((a=this.wallet)==null?void 0:a.rdns)||s.type==="INJECTED"||s.name===((c=this.wallet)==null?void 0:c.name)});if(i)await nt.connectExternal(i,i.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");Yn.close(),xn.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((e=this.wallet)==null?void 0:e.name)||"Unknown",caipNetworkId:(t=ue.getActiveCaipNetwork())==null?void 0:t.caipNetworkId}})}catch(r){xn.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(r==null?void 0:r.message)??"Unknown"}}),this.error=!0}}};jY=jLe([ot("w3m-connecting-wc-browser")],jY);var zLe=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let zY=class extends Lo{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),xn.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:t,name:r}=this.wallet,{redirect:i,href:s}=tt.formatNativeUrl(t,this.uri);nt.setWcLinking({name:r,href:s}),nt.setRecentWallet(this.wallet),tt.openHref(i,"_blank")}catch{this.error=!0}}};zY=zLe([ot("w3m-connecting-wc-desktop")],zY);var mE=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let R1=class extends Lo{constructor(){var e;if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=Ue.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{var t;if((t=this.wallet)!=null&&t.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:r,link_mode:i,name:s}=this.wallet,{redirect:o,redirectUniversalLink:a,href:c}=tt.formatNativeUrl(r,this.uri,i);this.redirectDeeplink=o,this.redirectUniversalLink=a,this.target=tt.isIframe()?"_top":"_self",nt.setWcLinking({name:s,href:c}),nt.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?tt.openHref(this.redirectUniversalLink,this.target):tt.openHref(this.redirectDeeplink,this.target)}catch(r){xn.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:r instanceof Error?r.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=sr.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(nt.subscribeKey("wcUri",()=>{this.onHandleURI()})),xn.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){var e;this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onTryAgain(){var e;nt.setWcError(!1),(e=this.onConnect)==null||e.call(this)}};mE([qe()],R1.prototype,"redirectDeeplink",void 0);mE([qe()],R1.prototype,"redirectUniversalLink",void 0);mE([qe()],R1.prototype,"target",void 0);mE([qe()],R1.prototype,"preferUniversalLinks",void 0);mE([qe()],R1.prototype,"isLoading",void 0);R1=mE([ot("w3m-connecting-wc-mobile")],R1);var h2={},r9,FY;function FLe(){return FY||(FY=1,r9=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),r9}var i9={},jm={},WY;function ub(){if(WY)return jm;WY=1;let n;const e=[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 jm.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},jm.getSymbolTotalCodewords=function(r){return e[r]},jm.getBCHDigit=function(t){let r=0;for(;t!==0;)r++,t>>>=1;return r},jm.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');n=r},jm.isKanjiModeEnabled=function(){return typeof n<"u"},jm.toSJIS=function(r){return n(r)},jm}var s9={},HY;function ij(){return HY||(HY=1,function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+t)}}n.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},n.from=function(r,i){if(n.isValid(r))return r;try{return e(r)}catch{return i}}}(s9)),s9}var o9,VY;function WLe(){if(VY)return o9;VY=1;function n(){this.buffer=[],this.length=0}return n.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},o9=n,o9}var a9,qY;function HLe(){if(qY)return a9;qY=1;function n(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return n.prototype.set=function(e,t,r,i){const s=e*this.size+t;this.data[s]=r,i&&(this.reservedBit[s]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},a9=n,a9}var c9={},KY;function VLe(){return KY||(KY=1,function(n){const e=ub().getSymbolSize;n.getRowColCoords=function(r){if(r===1)return[];const i=Math.floor(r/7)+2,s=e(r),o=s===145?26:Math.ceil((s-13)/(2*i-2))*2,a=[s-7];for(let c=1;c<i-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},n.getPositions=function(r){const i=[],s=n.getRowColCoords(r),o=s.length;for(let a=0;a<o;a++)for(let c=0;c<o;
vendor: 5,723 bytes, line 6688
6688c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||i.push([s[a],s[c]]);return i}}(c9)),c9}var l9={},YY;function qLe(){if(YY)return l9;YY=1;const n=ub().getSymbolSize,e=7;return l9.getPositions=function(r){const i=n(r);return[[0,0],[i-e,0],[0,i-e]]},l9}var u9={},GY;function KLe(){return GY||(GY=1,function(n){n.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};n.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},n.from=function(i){return n.isValid(i)?parseInt(i,10):void 0},n.getPenaltyN1=function(i){const s=i.size;let o=0,a=0,c=0,u=null,d=null;for(let f=0;f<s;f++){a=c=0,u=d=null;for(let m=0;m<s;m++){let w=i.get(f,m);w===u?a++:(a>=5&&(o+=e.N1+(a-5)),u=w,a=1),w=i.get(m,f),w===d?c++:(c>=5&&(o+=e.N1+(c-5)),d=w,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},n.getPenaltyN2=function(i){const s=i.size;let o=0;for(let a=0;a<s-1;a++)for(let c=0;c<s-1;c++){const u=i.get(a,c)+i.get(a,c+1)+i.get(a+1,c)+i.get(a+1,c+1);(u===4||u===0)&&o++}return o*e.N2},n.getPenaltyN3=function(i){const s=i.size;let o=0,a=0,c=0;for(let u=0;u<s;u++){a=c=0;for(let d=0;d<s;d++)a=a<<1&2047|i.get(u,d),d>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|i.get(d,u),d>=10&&(c===1488||c===93)&&o++}return o*e.N3},n.getPenaltyN4=function(i){let s=0;const o=i.data.length;for(let c=0;c<o;c++)s+=i.data[c];return Math.abs(Math.ceil(s*100/o/5)-10)*e.N4};function t(r,i,s){switch(r){case n.Patterns.PATTERN000:return(i+s)%2===0;case n.Patterns.PATTERN001:return i%2===0;case n.Patterns.PATTERN010:return s%3===0;case n.Patterns.PATTERN011:return(i+s)%3===0;case n.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(s/3))%2===0;case n.Patterns.PATTERN101:return i*s%2+i*s%3===0;case n.Patterns.PATTERN110:return(i*s%2+i*s%3)%2===0;case n.Patterns.PATTERN111:return(i*s%3+(i+s)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}n.applyMask=function(i,s){const o=s.size;for(let a=0;a<o;a++)for(let c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,t(i,c,a))},n.getBestMask=function(i,s){const o=Object.keys(n.Patterns).length;let a=0,c=1/0;for(let u=0;u<o;u++){s(u),n.applyMask(u,i);const d=n.getPenaltyN1(i)+n.getPenaltyN2(i)+n.getPenaltyN3(i)+n.getPenaltyN4(i);n.applyMask(u,i),d<c&&(c=d,a=u)}return a}}(u9)),u9}var UI={},ZY;function Ise(){if(ZY)return UI;ZY=1;const n=ij(),e=[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],t=[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 UI.getBlocksCount=function(i,s){switch(s){case n.L:return e[(i-1)*4+0];case n.M:return e[(i-1)*4+1];case n.Q:return e[(i-1)*4+2];case n.H:return e[(i-1)*4+3];default:return}},UI.getTotalCodewordsCount=function(i,s){switch(s){case n.L:return t[(i-1)*4+0];case n.M:return t[(i-1)*4+1];case n.Q:return t[(i-1)*4+2];case n.H:return t[(i-1)*4+3];default:return}},UI}var d9={},WA={},QY;function YLe(){if(QY)return WA;QY=1;const n=new Uint8Array(512),e=new Uint8Array(256);return function(){let r=1;for(let i=0;i<255;i++)n[i]=r,e[r]=i,r<<=1,r&256&&(r^=285);for(let i=255;i<512;i++)n[i]=n[i-255]}(),WA.log=function(r){if(r<1)throw new Error("log("+r+")");return e[r]},WA.exp=function(r){return n[r]},WA.mul=function(r,i){return r===0||i===0?0:n[e[r]+e[i]]},WA}var XY;function GLe(){return XY||(XY=1,function(n){const e=YLe();n.mul=function(r,i){const s=new Uint8Array(r.length+i.length-1);for(let o=0;o<r.length;o++)for(let a=0;a<i.length;a++)s[o+a]^=e.mul(r[o],i[a]);return s},n.mod=function(r,i){let s=new Uint8Array(r);for(;s.length-i.length>=0;){const o=s[0];for(let c=0;c<i.length;c++)s[c]^=e.mul(i[c],o);let a=0;for(;a<s.length&&s[a]===0;)a++;s=s.slice(a)}return s},n.generateECPolynomial=function(r){let i=new Uint8Array([1]);for(let s=0;s<r;s++)i=n.mul(i,new Uint8Array([1,e.exp(s)]));return i}}(d9)),d9}var h9,JY;function ZLe(){if(JY)return h9;JY=1;const n=GLe();function e(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(r){this.degree=r,this.genPoly=n.generateECPolynomial(this.degree)},e.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(r.length+this.degree);i.set(r);const s=n.mod(i,this.genPoly),o=this.degree-s.length;if(o>0){const a=new Uint8Array(this.degree);return a.set(s,o),a}return s},h9=e,h9}var f9={},p9={},g9={},eG;function Nse(){return eG||(eG=1,g9.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),g9}var cf={},tG;function Rse(){if(tG)return cf;tG=1;const n="[0-9]+",e="[A-Z $%*+\\-./:]+";let t="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";t=t.replace(/u/g,"\\u");
vendor: 8,786 bytes, lines 6688-6691
6688const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+t+`)(?:.|[\r 6689]))+`;cf.KANJI=new RegExp(t,"g"),cf.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),cf.BYTE=new RegExp(r,"g"),cf.NUMERIC=new RegExp(n,"g"),cf.ALPHANUMERIC=new RegExp(e,"g");const i=new RegExp("^"+t+"$"),s=new RegExp("^"+n+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return cf.testKanji=function(c){return i.test(c)},cf.testNumeric=function(c){return s.test(c)},cf.testAlphanumeric=function(c){return o.test(c)},cf}var nG;function db(){return nG||(nG=1,function(n){const e=Nse(),t=Rse();n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},n.getBestModeForData=function(s){return t.testNumeric(s)?n.NUMERIC:t.testAlphanumeric(s)?n.ALPHANUMERIC:t.testKanji(s)?n.KANJI:n.BYTE},n.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},n.isValid=function(s){return s&&s.bit&&s.ccBits};function r(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+i)}}n.from=function(s,o){if(n.isValid(s))return s;try{return r(s)}catch{return o}}}(p9)),p9}var rG;function QLe(){return rG||(rG=1,function(n){const e=ub(),t=Ise(),r=ij(),i=db(),s=Nse(),o=7973,a=e.getBCHDigit(o);function c(m,w,y){for(let b=1;b<=40;b++)if(w<=n.getCapacity(b,y,m))return b}function u(m,w){return i.getCharCountIndicator(m,w)+4}function d(m,w){let y=0;return m.forEach(function(b){const E=u(b.mode,w);y+=E+b.getBitsLength()}),y}function f(m,w){for(let y=1;y<=40;y++)if(d(m,y)<=n.getCapacity(y,w,i.MIXED))return y}n.from=function(w,y){return s.isValid(w)?parseInt(w,10):y},n.getCapacity=function(w,y,b){if(!s.isValid(w))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=i.BYTE);const E=e.getSymbolTotalCodewords(w),T=t.getTotalCodewordsCount(w,y),N=(E-T)*8;if(b===i.MIXED)return N;const I=N-u(b,w);switch(b){case i.NUMERIC:return Math.floor(I/10*3);case i.ALPHANUMERIC:return Math.floor(I/11*2);case i.KANJI:return Math.floor(I/13);case i.BYTE:default:return Math.floor(I/8)}},n.getBestVersionForData=function(w,y){let b;const E=r.from(y,r.M);if(Array.isArray(w)){if(w.length>1)return f(w,E);if(w.length===0)return 1;b=w[0]}else b=w;return c(b.mode,b.getLength(),E)},n.getEncodedBits=function(w){if(!s.isValid(w)||w<7)throw new Error("Invalid QR Code version");let y=w<<12;for(;e.getBCHDigit(y)-a>=0;)y^=o<<e.getBCHDigit(y)-a;return w<<12|y}}(f9)),f9}var m9={},iG;function XLe(){if(iG)return m9;iG=1;const n=ub(),e=1335,t=21522,r=n.getBCHDigit(e);return m9.getEncodedBits=function(s,o){const a=s.bit<<3|o;let c=a<<10;for(;n.getBCHDigit(c)-r>=0;)c^=e<<n.getBCHDigit(c)-r;return(a<<10|c)^t},m9}var w9={},y9,sG;function JLe(){if(sG)return y9;sG=1;const n=db();function e(t){this.mode=n.NUMERIC,this.data=t.toString()}return e.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(r){let i,s,o;for(i=0;i+3<=this.data.length;i+=3)s=this.data.substr(i,3),o=parseInt(s,10),r.put(o,10);const a=this.data.length-i;a>0&&(s=this.data.substr(i),o=parseInt(s,10),r.put(o,a*3+1))},y9=e,y9}var b9,oG;function e$e(){if(oG)return b9;oG=1;const n=db(),e=["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 t(r){this.mode=n.ALPHANUMERIC,this.data=r}return t.getBitsLength=function(i){return 11*Math.floor(i/2)+6*(i%2)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(i){let s;for(s=0;s+2<=this.data.length;s+=2){let o=e.indexOf(this.data[s])*45;o+=e.indexOf(this.data[s+1]),i.put(o,11)}this.data.length%2&&i.put(e.indexOf(this.data[s]),6)},b9=t,b9}var v9,aG;function t$e(){return aG||(aG=1,v9=function(e){for(var t=[],r=e.length,i=0;i<r;i++){var s=e.charCodeAt(i);if(s>=55296&&s<=56319&&r>i+1){var o=e.charCodeAt(i+1);o>=56320&&o<=57343&&(s=(s-55296)*1024+o-56320+65536,i+=1)}if(s<128){t.push(s);continue}if(s<2048){t.push(s>>6|192),t.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128);continue}if(s>=65536&&s<=1114111){t.push(s>>18|240),t.push(s>>12&63|128),t.push(s>>6&63|128),t.push(s&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer}),v9}var x9,cG;function n$e(){if(cG)return x9;cG=1;const n=t$e(),e=db();function t(r){this.mode=e.BYTE,typeof r=="string"&&(r=n(r)),this.data=new Uint8Array(r)}return t.getBitsLength=function(i){return i*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){for(let i=0,s=this.data.length;i<s;i++)r.put(this.data[i],8)},x9=t,x9}var E9,lG;function r$e(){if(lG)return E9;lG=1;const n=db(),e=ub();function t(r){this.mode=n.KANJI,this.data=r}return t.getBitsLength=function(i){return i*13},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){let i;for(i=0;i<this.data.length;i++){let s=e.toSJIS(this.data[i]);if(s>=33088&&s<=40956)s-=33088;else if(s>=57408&&s<=60351)s-=49472;else throw new Error("Invalid SJIS character: "+this.data[i]+` 6690Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),r.put(s,13)}},E9=t,E9}var uG;function i$e(){return uG||(uG=1,function(n){const e=db(),t=JLe(),r=e$e(),i=n$e(),s=r$e(),o=Rse(),a=ub(),c=Zie();function u(T){return unescape(encodeURIComponent(T)).length}function d(T,N,I){const H=[];let L;for(;(L=T.exec(I))!==null;)H.push({data:L[0],index:L.index,mode:N,length:L[0].length});return H}function f(T){const N=d(o.NUMERIC,e.NUMERIC,T),I=d(o.ALPHANUMERIC,e.ALPHANUMERIC,T);let H,L;return a.isKanjiModeEnabled()?(H=d(o.BYTE,e.BYTE,T),L=d(o.KANJI,e.KANJI,T)):(H=d(o.BYTE_KANJI,e.BYTE,T),L=[]),N.concat(I,H,L).sort(function(K,Y){return K.index-Y.index}).map(function(K){return{data:K.data,mode:K.mode,length:K.length}})}function m(T,N){switch(N){case e.NUMERIC:return t.getBitsLength(T);case e.ALPHANUMERIC:return r.getBitsLength(T);case e.KANJI:return s.getBitsLength(T);case e.BYTE:return i.getBitsLength(T)}}function w(T){return T.reduce(function(N,I){const H=N.length-1>=0?N[N.length-1]:null;return H&&H.mode===I.mode?(N[N.length-1].data+=I.data,N):(N.push(I),N)},[])}function y(T){const N=[];for(let I=0;I<T.length;I++){const H=T[I];switch(H.mode){case e.NUMERIC:N.push([H,{data:H.data,mode:e.ALPHANUMERIC,length:H.length},{data:H.data,mode:e.BYTE,length:H.length}]);break;case e.ALPHANUMERIC:N.push([H,{data:H.data,mode:e.BYTE,length:H.length}]);break;case e.KANJI:N.push([H,{data:H.data,mode:e.BYTE,length:u(H.data)}]);break;case e.BYTE:N.push([{data:H.data,mode:e.BYTE,length:u(H.data)}])}}return N}function b(T,N){const I={},H={start:{}};let L=["start"];for(let U=0;U<T.length;U++){const K=T[U],Y=[];for(let k=0;k<K.length;k++){const j=K[k],V=""+U+k;Y.push(V),I[V]={node:j,lastCount:0},H[V]={};for(let W=0;W<L.length;W++){const $=L[W];I[$]&&I[$].node.mode===j.mode?(H[$][V]=m(I[$].lastCount+j.length,j.mode)-m(I[$].lastCount,j.mode),I[$].lastCount+=j.length):(I[$]&&(I[$].lastCount=j.length),H[$][V]=m(j.length,j.mode)+4+e.getCharCountIndicator(j.mode,N))}}L=Y}for(let U=0;U<L.length;U++)H[L[U]].end=0;return{map:H,table:I}}function E(T,N){let I;const H=e.getBestModeForData(T);if(I=e.from(N,H),I!==e.BYTE&&I.bit<H.bit)throw new Error('"'+T+'" cannot be encoded with mode '+e.toString(I)+`. 6691 Suggested mode is: `+e.toString(H));switch(I===e.KANJI&&!a.isKanjiModeEnabled()&&(I=e.BYTE),I){case e.NUMERIC:return new t(T);case e.ALPHANUMERIC:return new r(T);case e.KANJI:return new s(T);case e.BYTE:return new i(T)}}n.fromArray=function(N){return N.reduce(function(I,H){return typeof H=="string"?I.push(E(H,null)):H.data&&I.push(E(H.data,H.mode)),I},[])},n.fromString=function(N,I){const H=f(N,a.isKanjiModeEnabled()),L=y(H),U=b(L,I),K=c.find_path(U.map,"start","end"),Y=[];for(let k=1;k<K.length-1;k++)Y.push(U.table[K[k]].node);return n.fromArray(w(Y))},n.rawSplit=function(N){return n.fromArray(f(N,a.isKanjiModeEnabled()))}}(w9)),w9}var dG;function s$e(){if(dG)return i9;dG=1;
vendor: 4,120 bytes, lines 6691-6694
6691const n=ub(),e=ij(),t=WLe(),r=HLe(),i=VLe(),s=qLe(),o=KLe(),a=Ise(),c=ZLe(),u=QLe(),d=XLe(),f=db(),m=i$e();function w(U,K){const Y=U.size,k=s.getPositions(K);for(let j=0;j<k.length;j++){const V=k[j][0],W=k[j][1];for(let $=-1;$<=7;$++)if(!(V+$<=-1||Y<=V+$))for(let A=-1;A<=7;A++)W+A<=-1||Y<=W+A||($>=0&&$<=6&&(A===0||A===6)||A>=0&&A<=6&&($===0||$===6)||$>=2&&$<=4&&A>=2&&A<=4?U.set(V+$,W+A,!0,!0):U.set(V+$,W+A,!1,!0))}}function y(U){const K=U.size;for(let Y=8;Y<K-8;Y++){const k=Y%2===0;U.set(Y,6,k,!0),U.set(6,Y,k,!0)}}function b(U,K){const Y=i.getPositions(K);for(let k=0;k<Y.length;k++){const j=Y[k][0],V=Y[k][1];for(let W=-2;W<=2;W++)for(let $=-2;$<=2;$++)W===-2||W===2||$===-2||$===2||W===0&&$===0?U.set(j+W,V+$,!0,!0):U.set(j+W,V+$,!1,!0)}}function E(U,K){const Y=U.size,k=u.getEncodedBits(K);let j,V,W;for(let $=0;$<18;$++)j=Math.floor($/3),V=$%3+Y-8-3,W=(k>>$&1)===1,U.set(j,V,W,!0),U.set(V,j,W,!0)}function T(U,K,Y){const k=U.size,j=d.getEncodedBits(K,Y);let V,W;for(V=0;V<15;V++)W=(j>>V&1)===1,V<6?U.set(V,8,W,!0):V<8?U.set(V+1,8,W,!0):U.set(k-15+V,8,W,!0),V<8?U.set(8,k-V-1,W,!0):V<9?U.set(8,15-V-1+1,W,!0):U.set(8,15-V-1,W,!0);U.set(k-8,8,1,!0)}function N(U,K){const Y=U.size;let k=-1,j=Y-1,V=7,W=0;for(let $=Y-1;$>0;$-=2)for($===6&&$--;;){for(let A=0;A<2;A++)if(!U.isReserved(j,$-A)){let _=!1;W<K.length&&(_=(K[W]>>>V&1)===1),U.set(j,$-A,_),V--,V===-1&&(W++,V=7)}if(j+=k,j<0||Y<=j){j-=k,k=-k;break}}}function I(U,K,Y){const k=new t;Y.forEach(function(A){k.put(A.mode.bit,4),k.put(A.getLength(),f.getCharCountIndicator(A.mode,U)),A.write(k)});const j=n.getSymbolTotalCodewords(U),V=a.getTotalCodewordsCount(U,K),W=(j-V)*8;for(k.getLengthInBits()+4<=W&&k.put(0,4);k.getLengthInBits()%8!==0;)k.putBit(0);const $=(W-k.getLengthInBits())/8;for(let A=0;A<$;A++)k.put(A%2?17:236,8);return H(k,U,K)}function H(U,K,Y){const k=n.getSymbolTotalCodewords(K),j=a.getTotalCodewordsCount(K,Y),V=k-j,W=a.getBlocksCount(K,Y),$=k%W,A=W-$,_=Math.floor(k/W),R=Math.floor(V/W),P=R+1,q=_-R,F=new c(q);let z=0;const B=new Array(W),C=new Array(W);let M=0;const Z=new Uint8Array(U.buffer);for(let xe=0;xe<W;xe++){const Se=xe<A?R:P;B[xe]=Z.slice(z,z+Se),C[xe]=F.encode(B[xe]),z+=Se,M=Math.max(M,Se)}const J=new Uint8Array(k);let ae=0,we,he;for(we=0;we<M;we++)for(he=0;he<W;he++)we<B[he].length&&(J[ae++]=B[he][we]);for(we=0;we<q;we++)for(he=0;he<W;he++)J[ae++]=C[he][we];return J}function L(U,K,Y,k){let j;if(Array.isArray(U))j=m.fromArray(U);else if(typeof U=="string"){let _=K;if(!_){const R=m.rawSplit(U);_=u.getBestVersionForData(R,Y)}j=m.fromString(U,_||40)}else throw new Error("Invalid data");const V=u.getBestVersionForData(j,Y);if(!V)throw new Error("The amount of data is too big to be stored in a QR Code");if(!K)K=V;else if(K<V)throw new Error(` 6692The chosen QR Code version cannot contain this amount of data. 6693Minimum version required to store current data is: `+V+`. 6694`);const W=I(K,Y,j),$=n.getSymbolSize(K),A=new r($);return w(A,K),y(A),b(A,K),T(A,Y,0),K>=7&&E(A,K),N(A,W),isNaN(k)&&(k=o.getBestMask(A,T.bind(null,A,Y))),o.applyMask(k,A),T(A,Y,k),{modules:A,version:K,errorCorrectionLevel:Y,maskPattern:k,segments:j}}return i9.create=function(K,Y){if(typeof K>"u"||K==="")throw new Error("No input text");let k=e.M,j,V;return typeof Y<"u"&&(k=e.from(Y.errorCorrectionLevel,e.M),j=u.from(Y.version),V=o.from(Y.maskPattern),Y.toSJISFunc&&n.setToSJISFunction(Y.toSJISFunc)),L(K,j,k,V)},i9}var A9={},S9={},hG;function Mse(){return hG||(hG=1,function(n){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let r=t.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+t);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(s){return[s,s]}))),r.length===6&&r.push("F","F");const i=parseInt(r.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+r.slice(0,6).join("")}}n.getOptions=function(r){r||(r={}),r.color||(r.color={});const i=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,s=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;
6694return{width:s,scale:s?4:o,margin:i,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},n.getScale=function(r,i){return i.width&&i.width>=r+i.margin*2?i.width/(r+i.margin*2):i.scale},n.getImageWidth=function(r,i){const s=n.getScale(r,i);return Math.floor((r+i.margin*2)*s)},n.qrToImageData=function(r,i,s){const o=i.modules.size,a=i.modules.data,c=n.getScale(o,s),u=Math.floor((o+s.margin*2)*c),d=s.margin*c,f=[s.color.light,s.color.dark];for(let m=0;m<u;m++)for(let w=0;w<u;w++){let y=(m*u+w)*4,b=s.color.light;if(m>=d&&w>=d&&m<u-d&&w<u-d){const E=Math.floor((m-d)/c),T=Math.floor((w-d)/c);b=f[a[E*o+T]?1:0]}r[y++]=b.r,r[y++]=b.g,r[y++]=b.b,r[y]=b.a}}}(S9)),S9}var fG;function o$e(){return fG||(fG=1,function(n){const e=Mse();function t(i,s,o){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}n.render=function(s,o,a){let c=a,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=r()),c=e.getOptions(c);const d=e.getImageWidth(s.modules.size,c),f=u.getContext("2d"),m=f.createImageData(d,d);return e.qrToImageData(m.data,s,c),t(f,u,d),f.putImageData(m,0,0),u},n.renderToDataURL=function(s,o,a){let c=a;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=n.render(s,o,c),d=c.type||"image/png",f=c.rendererOpts||{};return u.toDataURL(d,f.quality)}}(A9)),A9}var _9={},pG;function a$e(){if(pG)return _9;pG=1;const n=Mse();function e(i,s){const o=i.a/255,a=s+'="'+i.hex+'"';return o<1?a+" "+s+'-opacity="'+o.toFixed(2).slice(1)+'"':a}function t(i,s,o){let a=i+s;return typeof o<"u"&&(a+=" "+o),a}function r(i,s,o){let a="",c=0,u=!1,d=0;for(let f=0;f<i.length;f++){const m=Math.floor(f%s),w=Math.floor(f/s);!m&&!u&&(u=!0),i[f]?(d++,f>0&&m>0&&i[f-1]||(a+=u?t("M",m+o,.5+w+o):t("m",c,0),c=0,u=!1),m+1<s&&i[f+1]||(a+=t("h",d),d=0)):c++}return a}return _9.render=function(s,o,a){const c=n.getOptions(o),u=s.modules.size,d=s.modules.data,f=u+c.margin*2,m=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",w="<path "+e(c.color.dark,"stroke")+' d="'+r(d,u,c.margin)+'"/>',y='viewBox="0 0 '+f+" "+f+'"',E='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+y+' shape-rendering="crispEdges">'+m+w+`</svg> 6695`;return typeof a=="function"&&a(null,E),E},_9}var gG;function c$e(){if(gG)return h2;gG=1;const n=FLe(),e=s$e(),t=o$e(),r=a$e();function i(s,o,a,c,u){const d=[].slice.call(arguments,1),f=d.length,m=typeof d[f-1]=="function";if(!m&&!n())throw new Error("Callback required as last argument");if(m){if(f<2)throw new Error("Too few arguments provided");f===2?(u=a,a=o,o=c=void 0):f===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=a,a=o,o=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(a=o,o=c=void 0):f===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(w,y){try{const b=e.create(a,c);w(s(b,o,c))}catch(b){y(b)}})}try{const w=e.create(a,c);u(null,s(w,o,c))}catch(w){u(w)}}return h2.create=e.create,h2.toCanvas=i.bind(null,t.render),h2.toDataURL=i.bind(null,t.renderToDataURL),h2.toString=i.bind(null,function(s,o,a){return r.render(s,a)}),h2}var l$e=c$e();const u$e=xo(l$e),d$e=.1,mG=2.5,Lp=7;function C9(n,e,t){return n===e?!1:(n-e<0?e-n:n-e)<=t+d$e}function h$e(n,e){const t=Array.prototype.slice.call(u$e.create(n,{errorCorrectionLevel:e}).modules.data,0),r=Math.sqrt(t.length);return t.reduce((i,s,o)=>(o%r===0?i.push([s]):i[i.length-1].push(s))&&i,[])}const f$e={generate({uri:n,size:e,logoSize:t,dotColor:r="#141414"}){const i="transparent",o=[],a=h$e(n,"Q"),c=e/a.length,u=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];u.forEach(({x:b,y:E})=>{const T=(a.length-Lp)*c*b,N=(a.length-Lp)*c*E,I=.45;for(let H=0;H<u.length;H+=1){const L=c*(Lp-H*2);o.push(Wi` 6696 <rect 6697 fill=${H===2?r:i} 6698 width=${H===0?L-5:L} 6699 rx= ${H===0?(L-5)*I:L*I} 6700 ry= ${H===0?(L-5)*I:L*I} 6701 stroke=${r} 6702 stroke-width=${H===0?5:0} 6703 height=${H===0?L-5:L} 6704 x= ${H===0?N+c*H+5/2:N+c*H} 6705 y= ${H===0?T+c*H+5/2:T+c*H} 6706 /> 6707 `)}});const d=Math.floor((t+25)/c),f=a.length/2-d/2,m=a.length/2+d/2-1,w=[];a.forEach((b,E)=>{b.forEach((T,N)=>{if(a[E][N]&&!(E<Lp&&N<Lp||E>a.length-(Lp+1)&&N<Lp||E<Lp&&N>a.length-(Lp+1))&&!(E>f&&E<m&&N>f&&N<m)){const I=E*c+c/2,H=N*c+c/2;w.push([I,H])}})});const y={};
6707return w.forEach(([b,E])=>{var T;y[b]?(T=y[b])==null||T.push(E):y[b]=[E]}),Object.entries(y).map(([b,E])=>{const T=E.filter(N=>E.every(I=>!C9(N,I,c)));return[Number(b),T]}).forEach(([b,E])=>{E.forEach(T=>{o.push(Wi`<circle cx=${b} cy=${T} fill=${r} r=${c/mG} />`)})}),Object.entries(y).filter(([b,E])=>E.length>1).map(([b,E])=>{const T=E.filter(N=>E.some(I=>C9(N,I,c)));return[Number(b),T]}).map(([b,E])=>{E.sort((N,I)=>N<I?-1:1);const T=[];for(const N of E){const I=T.find(H=>H.some(L=>C9(N,L,c)));I?I.push(N):T.push([N])}return[b,T.map(N=>[N[0],N[N.length-1]])]}).forEach(([b,E])=>{E.forEach(([T,N])=>{o.push(Wi` 6708 <line 6709 x1=${b} 6710 x2=${b} 6711 y1=${T} 6712 y2=${N} 6713 stroke=${r} 6714 stroke-width=${c/(mG/2)} 6715 stroke-linecap="round" 6716 /> 6717 `)})}),o}},p$e=Mt` 6718 :host { 6719 position: relative; 6720 user-select: none; 6721 display: block; 6722 overflow: hidden; 6723 aspect-ratio: 1 / 1; 6724 width: var(--local-size); 6725 } 6726 6727 :host([data-theme='dark']) { 6728 border-radius: clamp(0px, var(--wui-border-radius-l), 40px); 6729 background-color: var(--wui-color-inverse-100); 6730 padding: var(--wui-spacing-l); 6731 } 6732 6733 :host([data-theme='light']) { 6734 box-shadow: 0 0 0 1px var(--wui-color-bg-125); 6735 background-color: var(--wui-color-bg-125); 6736 } 6737 6738 :host([data-clear='true']) > wui-icon { 6739 display: none; 6740 } 6741 6742 svg:first-child, 6743 wui-image, 6744 wui-icon { 6745 position: absolute; 6746 top: 50%; 6747 left: 50%; 6748 transform: translateY(-50%) translateX(-50%); 6749 } 6750 6751 wui-image { 6752 width: 25%; 6753 height: 25%; 6754 border-radius: var(--wui-border-radius-xs); 6755 } 6756 6757 wui-icon { 6758 width: 100%; 6759 height: 100%; 6760 color: var(--local-icon-color) !important; 6761 transform: translateY(-50%) translateX(-50%) scale(0.25); 6762 } 6763`;var Ng=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const g$e="#3396ff";let lh=class extends ut{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=` 6764 --local-size: ${this.size}px; 6765 --local-icon-color: ${this.color??g$e} 6766 `,le`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){const e=this.theme==="light"?this.size:this.size-32;return Wi` 6767 <svg height=${e} width=${e}> 6768 ${f$e.generate({uri:this.uri,size:e,logoSize:this.arenaClear?0:e/4,dotColor:this.color})} 6769 </svg> 6770 `}templateVisual(){return this.imageSrc?le`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?le`<wui-icon 6771 class="farcaster" 6772 size="inherit" 6773 color="inherit" 6774 name="farcaster" 6775 ></wui-icon>`:le`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};lh.styles=[Dn,p$e];Ng([be()],lh.prototype,"uri",void 0);Ng([be({type:Number})],lh.prototype,"size",void 0);Ng([be()],lh.prototype,"theme",void 0);Ng([be()],lh.prototype,"imageSrc",void 0);Ng([be()],lh.prototype,"alt",void 0);Ng([be()],lh.prototype,"color",void 0);Ng([be({type:Boolean})],lh.prototype,"arenaClear",void 0);Ng([be({type:Boolean})],lh.prototype,"farcaster",void 0);lh=Ng([ot("wui-qr-code")],lh);const m$e=Mt` 6776 @keyframes fadein { 6777 from { 6778 opacity: 0; 6779 } 6780 to { 6781 opacity: 1; 6782 } 6783 } 6784 6785 wui-shimmer { 6786 width: 100%; 6787 aspect-ratio: 1 / 1; 6788 border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; 6789 } 6790 6791 wui-qr-code { 6792 opacity: 0; 6793 animation-duration: 200ms; 6794 animation-timing-function: ease; 6795 animation-name: fadein; 6796 animation-fill-mode: forwards; 6797 } 6798`;var w$e=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let $B=class extends Lo{constructor(){var e,t;super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),xn.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode",dis
6798playIndex:(t=this.wallet)==null?void 0:t.display_index}})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribe)==null||e.forEach(t=>t()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),le` 6799 <wui-flex 6800 flexDirection="column" 6801 alignItems="center" 6802 .padding=${["0","xl","xl","xl"]} 6803 gap="xl" 6804 > 6805 <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer> 6806 6807 <wui-text variant="paragraph-500" color="fg-100"> 6808 Scan this QR Code with your phone 6809 </wui-text> 6810 ${this.copyTemplate()} 6811 </wui-flex> 6812 <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links> 6813 `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,t=this.wallet?this.wallet.name:void 0;return nt.setWcLinking(void 0),nt.setRecentWallet(this.wallet),le` <wui-qr-code 6814 size=${e} 6815 theme=${na.state.themeMode} 6816 uri=${this.uri} 6817 imageSrc=${Nt(Hr.getWalletImage(this.wallet))} 6818 color=${Nt(na.state.themeVariables["--w3m-qr-color"])} 6819 alt=${Nt(t)} 6820 data-testid="wui-qr-code" 6821 ></wui-qr-code>`}copyTemplate(){const e=!this.uri||!this.ready;return le`<wui-link 6822 .disabled=${e} 6823 @click=${this.onCopyUri} 6824 color="fg-200" 6825 data-testid="copy-wc2-uri" 6826 > 6827 <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon> 6828 Copy link 6829 </wui-link>`}};$B.styles=m$e;$B=w$e([ot("w3m-connecting-wc-qrcode")],$B);var y$e=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let wG=class extends ut{constructor(){var e,t;if(super(),this.wallet=(e=it.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");xn.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(t=this.wallet)==null?void 0:t.display_index}})}render(){return le` 6830 <wui-flex 6831 flexDirection="column" 6832 alignItems="center" 6833 .padding=${["3xl","xl","xl","xl"]} 6834 gap="xl" 6835 > 6836 <wui-wallet-image 6837 size="lg" 6838 imageSrc=${Nt(Hr.getWalletImage(this.wallet))} 6839 ></wui-wallet-image> 6840 6841 <wui-text variant="paragraph-500" color="fg-100">Not Detected</wui-text> 6842 </wui-flex> 6843 6844 <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links> 6845 `}};wG=y$e([ot("w3m-connecting-wc-unsupported")],wG);var kse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let UB=class extends Lo{constructor(){var e;if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=sr.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(nt.subscribeKey("wcUri",()=>{this.updateLoadingState()})),xn.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:t,name:r}=this.wallet,{redirect:i,href:s}=tt.formatUniversalUrl(t,this.uri);nt.setWcLinking({name:r,href:s}),nt.setRecentWallet(this.wallet),tt.openHref(i,"_blank")}catch{this.error=!0}}};kse([qe()],UB.prototype,"isLoading",void 0);UB=kse([ot("w3m-connecting-wc-web")],UB);var y4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let M1=class extends ut{constructor(){var e;super(),this.wallet=(e=it.state.data)==null?void 0:e.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!Ue.state.siwx,this.remoteFeatures=Ue.state.remoteFeatures,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(Ue.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}
6845disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return le` 6846 ${this.headerTemplate()} 6847 <div>${this.platformTemplate()}</div> 6848 ${this.reownBrandingTemplate()} 6849 `}reownBrandingTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.reownBranding?le`<wui-ux-by-reown></wui-ux-by-reown>`:null}async initializeConnection(e=!1){var t,r;if(!(this.platform==="browser"||Ue.state.manualWCControl&&!e))try{const{wcPairingExpiry:i,status:s}=nt.state;if(e||Ue.state.enableEmbedded||tt.isPairingExpired(i)||s==="connecting"){const o=nt.getConnections(ue.state.activeChain),a=(t=this.remoteFeatures)==null?void 0:t.multiWallet,c=o.length>0;await nt.connectWalletConnect(),this.isSiwxEnabled||(c&&a?(it.replace("ProfileWallets"),Ir.showSuccess("New Wallet Added")):Yn.close())}}catch(i){if(i instanceof Error&&i.message.includes("An error occurred when attempting to switch chain")&&!Ue.state.enableNetworkSwitch&&ue.state.activeChain){ue.setActiveCaipNetwork(yy.getUnsupportedNetwork(`${ue.state.activeChain}:${(r=ue.state.activeCaipNetwork)==null?void 0:r.id}`)),ue.showUnsupportedChainUI();return}xn.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(i==null?void 0:i.message)??"Unknown"}}),nt.setWcError(!0),Ir.showError(i.message??"Connection error"),nt.resetWcConnection(),it.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:e,desktop_link:t,webapp_link:r,injected:i,rdns:s}=this.wallet,o=i==null?void 0:i.map(({injected_id:y})=>y).filter(Boolean),a=[...s?[s]:o??[]],c=Ue.state.isUniversalProvider?!1:a.length,u=e,d=r,f=nt.checkInstalled(a),m=c&&f,w=t&&!tt.isMobile();m&&!ue.state.noAdapters&&this.platforms.push("browser"),u&&this.platforms.push(tt.isMobile()?"mobile":"qrcode"),d&&this.platforms.push("web"),w&&this.platforms.push("desktop"),!m&&c&&!ue.state.noAdapters&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return le`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return le`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return le` 6850 <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}> 6851 </w3m-connecting-wc-desktop> 6852 `;case"mobile":return le` 6853 <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}> 6854 </w3m-connecting-wc-mobile> 6855 `;case"qrcode":return le`<w3m-connecting-wc-qrcode></w3m-connecting-wc-qrcode>`;default:return le`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?le` 6856 <w3m-connecting-header 6857 .platforms=${this.platforms} 6858 .onSelectPlatfrom=${this.onSelectPlatform.bind(this)} 6859 > 6860 </w3m-connecting-header> 6861 `:null}async onSelectPlatform(e){var r;const t=(r=this.shadowRoot)==null?void 0:r.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};y4([qe()],M1.prototype,"platform",void 0);y4([qe()],M1.prototype,"platforms",void 0);y4([qe()],M1.prototype,"isSiwxEnabled",void 0);y4([qe()],M1.prototype,"remoteFeatures",void 0);M1=y4([ot("w3m-connecting-wc-view")],M1);var Ose=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let i8=class extends ut{constructor(){super(...arguments),this.isMobile=tt.isMobile()}render(){if(this.isMobile){const{featured:e,recommended:t}=Ft.state,{customWallets:r}=Ue.state,i=wt.getRecentWallets(),s=e.length||t.length||(r==null?void 0:r.length)||i.length;return le`<wui-flex 6862 flexDirection="column" 6863 gap="xs" 6864 .margin=${["3xs","s","s","s"]} 6865 > 6866 ${s?le`<w3m-connector-list></w3m-connector-list>`:null} 6867 <w3m-all-wallets-widget></w3m-all-wallets-widget> 6868 </wui-flex>`}return le`<wui-flex flexDirection="column" .padding=${["0","0","l","0"]}> 6869 <w3m-connecting-wc-view></w3m-connecting-wc-view> 6870 <wui-flex flexDirection="column" .padding=${["0","m","0","m"]}> 6871 <w3m-all-wallets-widget></w3m-all-wallets-widget> </wui-flex 6872 ></wui-flex>`}};Ose([qe()],i8.prototype,"isMobile",void 0);i8=Ose([ot("w3m-connecting-wc-basic-view")],i8);const b$e=Mt` 6873 .continue-button-container { 6874 width: 100%; 6875 } 6876`;var Pse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let uC=class extends ut{constructor(){super(...arguments),this.loading=!1}render(){return le` 6877 <wui-flex 6878 flexDirection="column" 6879 alignItems="center" 6880 gap="xxl" 6881 .padding=${["0","0","l","0"]} 6882 > 6883 ${this.onboardingTemplate()} ${this.buttonsTemplate()} 6884 <wui-link 6885 @click=${()=>{tt.openHref(Wue.URLS.FAQ,"_blank")}} 6886 > 6887 Learn more about names 6888 <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon> 6889 </wui-link> 6890 </wui-flex> 6891 `}onboardingTemplate(){return le` <wui-flex 6892 flexDirection="column" 6893 gap="xxl" 6894 alignItems="center" 6895 .padding=${["0","xxl","0","xxl"]} 6896 > 6897 <wui-flex gap="s" alignItems="center" justifyContent="center"> 6898 <wui-icon-box 6899 icon="id" 6900 size="xl" 6901 iconSize="xxl" 6902 iconColor="fg-200" 6903 backgroundColor="fg-200" 6904 ></wui-icon-box> 6905 </wui-flex> 6906 <wui-flex flexDirection="column" alignItems="center" gap="s"> 6907 <wui-text align="center" variant="medium-600" color="fg-100"> 6908 Choose your account name 6909 </wui-text> 6910 <wui-text align="center" variant="paragraph-400" color="fg-100"> 6911 Finally say goodbye to 0x addresses, name your account to make it easier to exchange 6912 assets 6913 </wui-text> 6914 </wui-flex> 6915 </wui-flex>`}buttonsTemplate(){return le`<wui-flex 6916 .padding=${["0","2l","0","2l"]} 6917 gap="s" 6918 class="continue-button-container" 6919 > 6920 <wui-button 6921 fullWidth 6922 .loading=${this.loading} 6923 size="lg" 6924 borderRadius="xs" 6925 @click=${this.handleContinue.bind(this)} 6926 >Choose name 6927 </wui-button>
6927 6928 </wui-flex>`}handleContinue(){it.push("RegisterAccountName"),xn.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:Xs(ue.state.activeChain)===fi.ACCOUNT_TYPES.SMART_ACCOUNT}})}};uC.styles=b$e;Pse([qe()],uC.prototype,"loading",void 0);uC=Pse([ot("w3m-choose-account-name-view")],uC);var v$e=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let jB=class extends ut{constructor(){var e;super(...arguments),this.wallet=(e=it.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return le` 6929 <wui-flex gap="xs" flexDirection="column" .padding=${["s","s","l","s"]}> 6930 ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} 6931 ${this.homepageTemplate()} 6932 </wui-flex> 6933 `}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?le`<wui-list-item 6934 variant="icon" 6935 icon="chromeStore" 6936 iconVariant="square" 6937 @click=${this.onChromeStore.bind(this)} 6938 chevron 6939 > 6940 <wui-text variant="paragraph-500" color="fg-100">Chrome Extension</wui-text> 6941 </wui-list-item>`:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?le`<wui-list-item 6942 variant="icon" 6943 icon="appStore" 6944 iconVariant="square" 6945 @click=${this.onAppStore.bind(this)} 6946 chevron 6947 > 6948 <wui-text variant="paragraph-500" color="fg-100">iOS App</wui-text> 6949 </wui-list-item>`:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?le`<wui-list-item 6950 variant="icon" 6951 icon="playStore" 6952 iconVariant="square" 6953 @click=${this.onPlayStore.bind(this)} 6954 chevron 6955 > 6956 <wui-text variant="paragraph-500" color="fg-100">Android App</wui-text> 6957 </wui-list-item>`:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?le` 6958 <wui-list-item 6959 variant="icon" 6960 icon="browser" 6961 iconVariant="square-blue" 6962 @click=${this.onHomePage.bind(this)} 6963 chevron 6964 > 6965 <wui-text variant="paragraph-500" color="fg-100">Website</wui-text> 6966 </wui-list-item> 6967 `:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&tt.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&tt.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&tt.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&tt.openHref(this.wallet.homepage,"_blank")}};jB=v$e([ot("w3m-downloads-view")],jB);var x$e=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const E$e="https://walletconnect.com/explorer";let zB=class extends ut{render(){return le` 6968 <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs"> 6969 ${this.recommendedWalletsTemplate()} 6970 <wui-list-wallet 6971 name="Explore all" 6972 showAllWallets 6973 walletIcon="allWallets" 6974 icon="externalLink" 6975 @click=${()=>{tt.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} 6976 ></wui-list-wallet> 6977 </wui-flex> 6978 `}recommendedWalletsTemplate(){const{recommended:e,featured:t}=Ft.state,{customWallets:r}=Ue.state;return[...t,...r??[],...e].slice(0,4).map(s=>le` 6979 <wui-list-wallet 6980 name=${s.name??"Unknown"} 6981 tagVariant="main" 6982 imageSrc=${Nt(Hr.getWalletImage(s))} 6983 @click=${()=>{tt.openHref(s.homepage??E$e,"_blank")}} 6984 ></wui-list-wallet> 6985 `)}};zB=x$e([ot("w3m-get-wallet-view")],zB);const A$e=Wi`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"> 6986 <rect width="64" height="64" fill="#F7931A"/> 6987 <g clip-path="url(#clip0_1045_17)"> 6988 <path d="M63.0394 39.7409C58.7654 56.8839 41.4024 67.3169 24.2574 63.0419C7.11937 58.7679 -3.31363 41.4039 0.962367 24.2619C5.23437 7.11686 22.5974 -3.31714 39.7374 0.956863C56.8814 5.23086 67.3134 22.5969 63.0394 39.7409Z" fill="#F7931A"/> 6989 <path d="M46.1092 27.4409C46.7462 23.1829 43.5042 20.8939 39.0712 19.3669L40.5092 13.5989L36.9982
698912.7239L35.5982 18.3399C34.6752 18.1099 33.7272 17.8929 32.7852 17.6779L34.1952 12.0249L30.6862 11.1499L29.2472 16.9159C28.4832 16.7419 27.7332 16.5699 27.0052 16.3889L27.0092 16.3709L22.1672 15.1619L21.2332 18.9119C21.2332 18.9119 23.8382 19.5089 23.7832 19.5459C25.2052 19.9009 25.4622 20.8419 25.4192 21.5879L23.7812 28.1589C23.8792 28.1839 24.0062 28.2199 24.1462 28.2759C24.0292 28.2469 23.9042 28.2149 23.7752 28.1839L21.4792 37.3889C21.3052 37.8209 20.8642 38.4689 19.8702 38.2229C19.9052 38.2739 17.3182 37.5859 17.3182 37.5859L15.5752 41.6049L20.1442 42.7439C20.9942 42.9569 21.8272 43.1799 22.6472 43.3899L21.1942 49.2239L24.7012 50.0989L26.1402 44.3269C27.0982 44.5869 28.0282 44.8269 28.9382 45.0529L27.5042 50.7979L31.0152 51.6729L32.4682 45.8499C38.4552 46.9829 42.9572 46.5259 44.8522 41.1109C46.3792 36.7509 44.7762 34.2359 41.6262 32.5959C43.9202 32.0669 45.6482 30.5579 46.1092 27.4409ZM38.0872 38.6899C37.0022 43.0499 29.6612 40.6929 27.2812 40.1019L29.2092 32.3729C31.5892 32.9669 39.2212 34.1429 38.0872 38.6899ZM39.1732 27.3779C38.1832 31.3439 32.0732 29.3289 30.0912 28.8349L31.8392 21.8249C33.8212 22.3189 40.2042 23.2409 39.1732 27.3779Z" fill="white"/> 6990 </g> 6991 <defs> 6992 <clipPath id="clip0_1045_17"> 6993 <rect width="64" height="64" fill="white"/> 6994 </clipPath> 6995 </defs> 6996</svg> 6997`,S$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 6998 <rect width="60" height="60" fill="#1DC956" rx="30" /> 6999 <circle cx="30" cy="30" r="3" fill="#fff" /> 7000 <path 7001 fill="#2BEE6C" 7002 stroke="#fff" 7003 stroke-width="2" 7004 d="m45.32 17.9-.88-.42.88.42.02-.05c.1-.2.21-.44.26-.7l-.82-.15.82.16a2 2 0 0 0-.24-1.4c-.13-.23-.32-.42-.47-.57a8.42 8.42 0 0 1-.04-.04l-.04-.04a2.9 2.9 0 0 0-.56-.47l-.51.86.5-.86a2 2 0 0 0-1.4-.24c-.26.05-.5.16-.69.26l-.05.02-15.05 7.25-.1.05c-1.14.55-1.85.89-2.46 1.37a7 7 0 0 0-1.13 1.14c-.5.6-.83 1.32-1.38 2.45l-.05.11-7.25 15.05-.02.05c-.1.2-.21.43-.26.69a2 2 0 0 0 .24 1.4l.85-.5-.85.5c.13.23.32.42.47.57l.04.04.04.04c.15.15.34.34.56.47a2 2 0 0 0 1.41.24l-.2-.98.2.98c.25-.05.5-.17.69-.26l.05-.02-.42-.87.42.87 15.05-7.25.1-.05c1.14-.55 1.85-.89 2.46-1.38a7 7 0 0 0 1.13-1.13 12.87 12.87 0 0 0 1.43-2.56l7.25-15.05Z" 7005 /> 7006 <path 7007 fill="#1DC956" 7008 d="M33.38 32.72 30.7 29.3 15.86 44.14l.2.2a1 1 0 0 0 1.14.2l15.1-7.27a3 3 0 0 0 1.08-4.55Z" 7009 /> 7010 <path 7011 fill="#86F999" 7012 d="m26.62 27.28 2.67 3.43 14.85-14.85-.2-.2a1 1 0 0 0-1.14-.2l-15.1 7.27a3 3 0 0 0-1.08 4.55Z" 7013 /> 7014 <circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)" /> 7015 <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" /> 7016</svg> `,_$e=Wi`<svg viewBox="0 0 60 60" fill="none"> 7017 <g clip-path="url(#clip0_7734_50402)"> 7018 <path 7019 d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z" 7020 fill="#EB8B47" 7021 /> 7022 <path 7023 d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z" 7024 stroke="#062B2B" 7025 stroke-opacity="0.1" 7026 /> 7027 <path 7028 d="M19 52C24.5228 52 29 47.5228 29 42C29 36.4772 24.5228 32
702819 32C13.4772 32 9 36.4772 9 42C9 47.5228 13.4772 52 19 52Z" 7029 fill="#FF974C" 7030 stroke="white" 7031 stroke-width="2" 7032 /> 7033 <path 7034 fill-rule="evenodd" 7035 clip-rule="evenodd" 7036 d="M42.8437 8.3264C42.4507 7.70891 41.5493 7.70891 41.1564 8.32641L28.978 27.4638C28.5544 28.1295 29.0326 29.0007 29.8217 29.0007H54.1783C54.9674 29.0007 55.4456 28.1295 55.022 27.4638L42.8437 8.3264Z" 7037 fill="white" 7038 /> 7039 <path 7040 fill-rule="evenodd" 7041 clip-rule="evenodd" 7042 d="M42.3348 11.6456C42.659 11.7608 42.9061 12.1492 43.4005 12.926L50.7332 24.4488C51.2952 25.332 51.5763 25.7737 51.5254 26.1382C51.4915 26.3808 51.3698 26.6026 51.1833 26.7614C50.9031 27 50.3796 27 49.3327 27H34.6673C33.6204 27 33.0969 27 32.8167 26.7614C32.6302 26.6026 32.5085 26.3808 32.4746 26.1382C32.4237 25.7737 32.7048 25.332 33.2669 24.4488L40.5995 12.926C41.0939 12.1492 41.341 11.7608 41.6652 11.6456C41.8818 11.5687 42.1182 11.5687 42.3348 11.6456ZM35.0001 26.999C38.8661 26.999 42.0001 23.865 42.0001 19.999C42.0001 23.865 45.1341 26.999 49.0001 26.999H35.0001Z" 7043 fill="#FF974C" 7044 /> 7045 <path 7046 d="M10.1061 9.35712C9.9973 9.67775 9.99867 10.0388 9.99978 10.3323C9.99989 10.3611 10 10.3893 10 10.4167V25.5833C10 25.6107 9.99989 25.6389 9.99978 25.6677C9.99867 25.9612 9.9973 26.3222 10.1061 26.6429C10.306 27.2317 10.7683 27.694 11.3571 27.8939C11.6777 28.0027 12.0388 28.0013 12.3323 28.0002C12.3611 28.0001 12.3893 28 12.4167 28H19C24.5228 28 29 23.5228 29 18C29 12.4772 24.5228 8 19 8H12.4167C12.3893 8 12.3611 7.99989 12.3323 7.99978C12.0388 7.99867 11.6778 7.9973 11.3571 8.10614C10.7683 8.306 10.306 8.76834 10.1061 9.35712Z" 7047 fill="#FF974C" 7048 stroke="white" 7049 stroke-width="2" 7050 /> 7051 <circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="white" stroke-width="2" /> 7052 <circle cx="19" cy="42" r="4" fill="#EB8B47" stroke="white" stroke-width="2" /> 7053 </g> 7054 <defs> 7055 <clipPath id="clip0_7734_50402"> 7056 <rect width="60" height="60" fill="white" /> 7057 </clipPath> 7058 </defs> 7059</svg> `,C$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 7060 <g clip-path="url(#a)"> 7061 <path 7062 fill="#1DC956" 7063 d="M0 25.01c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02.11 15.65.11 24.9.11h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.13 60 15.76 60 25v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-3.45 1.97-8.08 1.97-17.33 1.97H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 49.1 0 44.46 0 35.21v-10.2Z" 7064 /> 7065 <path 7066 fill="#2BEE6C" 7067 d="M16.1 60c-3.82-.18-6.4-.64-8.53-1.86a15 15 0 0 1-5.6-5.6C.55 50.06.16 46.97.04 41.98L4.2 40.6a4 4 0 0 0 2.48-2.39l4.65-12.4a2 2 0 0 1 2.5-1.2l2.53.84a2 2 0 0 0 2.43-1l2.96-5.94a2 2 0 0 1 3.7.32l3.78 12.58a2 2 0 0 0 3.03 1.09l3.34-2.23a2 2 0 0 0 .65-.7l5.3-9.72a2 2 0 0 1 1.42-1.01l4.14-.69a2 2 0 0 1 1.6.44l3.9 3.24a2 2 0 0 0 2.7-.12l4.62-4.63c.08 2.2.08 4.8.08 7.93v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-2.13 1.22-4.7 1.68-8.54 1.86H16.11Z" 7068 /> 7069 <path 7070 fill="#fff" 7071 d="m.07 43.03-.05-2.1 3.85-1.28a3 3 0 0 0 1.86-1.79l4.66-12.4a3 3 0 0 1 3.75-1.8l2.53.84a1 1 0 0 0 1.21-.5l2.97-5.94a3 3 0 0 1 5.56.48l3.77 12.58a1 1 0 0 0 1.51.55l3.34-2.23a1 1 0 0 0 .33-.35l5.3-9.71a3 3 0 0 1 2.14-1.53l4.13-.69a3 3 0 0 1 2.41.66l3.9 3.24a1 1 0 0 0 1.34-.06l5.28-5.28c.05.85.08 1.75.1 2.73L56 22.41a3 3 0 0 1-4.04.19l-3.9-3.25a1 1 0 0 0-.8-.21l-4.13.69a1 1 0 0 0-.72.5l-5.3 9.72a3 3 0 0 1-.97 1.05l-3.34 2.23a3 3 0 0 1-4.53-1.63l-3.78-12.58a1 1 0 0 0-1.85-.16l-2.97 5.94a3 3 0 0 1-3.63 1.5l-2.53-.84a1 1 0 0 0-1.25.6l-4.65 12.4a5 5 0 0 1-3.1 3L.07 43.02Z" 7072 /> 7073 <path 7074 fill="#fff" 7075 fill-rule="evenodd" 7076 d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" 7077 clip-rule="evenodd" 7078 /> 7079 <path fill="#fff" d="M45 .28v59.66l-2 .1V.19c.7.02 1.37.05 2 .1Z" /> 7080 <path fill="#2BEE6C" d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" /> 7081 <path 7082 stroke="#fff" 7083 stroke-opacity=".1" 7084 d="M.5 25.01c0-4.63 0-8.08.24-10.8.25-2.7.73-4.64 1.66-6.28a14.5 14.5 0 0 1 5.42-5.41C9.46 1.58 11.39 1.1 14.1.85A133 133 0 0 1 24.9.61h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.67a14.5 14.5 0 0 1 5.42 5.4c.93 1.65 1.41 3.58 1.66 6.3.24 2.71.24 6.16.24 10.79v10.2c0 4.64 0 8.08-.24 10.8-.25 2.7-.73 4.65-1.66 6.28a14.5 14.5 0 0 1-5.42 5.42c-1.63.93-3.57 1.41-6.28 1.66-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.66a14.5 14.5 0 0 1-5.42-5.42C1.47 50.66 1 48.72.74 46.01A133 133 0 0 1 .5 35.2v-10.2Z" 7085 /> 7086 </g>
7087 <defs> 7088 <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath> 7089 </defs> 7090</svg>`,T$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 7091 <g clip-path="url(#a)"> 7092 <rect width="60" height="60" fill="#C653C6" rx="30" /> 7093 <path 7094 fill="#E87DE8" 7095 d="M57.98.01v19.5a4.09 4.09 0 0 0-2.63 2.29L50.7 34.2a2 2 0 0 1-2.5 1.2l-2.53-.84a2 2 0 0 0-2.42 1l-2.97 5.94a2 2 0 0 1-3.7-.32L32.8 28.6a2 2 0 0 0-3.02-1.09l-3.35 2.23a2 2 0 0 0-.64.7l-5.3 9.72a2 2 0 0 1-1.43 1.01l-4.13.69a2 2 0 0 1-1.61-.44l-3.9-3.24a2 2 0 0 0-2.69.12L2.1 42.93.02 43V.01h57.96Z" 7096 /> 7097 <path 7098 fill="#fff" 7099 d="m61.95 16.94.05 2.1-3.85 1.28a3 3 0 0 0-1.86 1.79l-4.65 12.4a3 3 0 0 1-3.76 1.8l-2.53-.84a1 1 0 0 0-1.2.5l-2.98 5.94a3 3 0 0 1-5.55-.48l-3.78-12.58a1 1 0 0 0-1.5-.55l-3.35 2.23a1 1 0 0 0-.32.35l-5.3 9.72a3 3 0 0 1-2.14 1.52l-4.14.69a3 3 0 0 1-2.41-.66l-3.9-3.24a1 1 0 0 0-1.34.06l-5.28 5.28c-.05-.84-.08-1.75-.1-2.73l3.97-3.96a3 3 0 0 1 4.04-.19l3.89 3.25a1 1 0 0 0 .8.21l4.14-.68a1 1 0 0 0 .71-.51l5.3-9.71a3 3 0 0 1 .97-1.06l3.34-2.23a3 3 0 0 1 4.54 1.63l3.77 12.58a1 1 0 0 0 1.86.16l2.96-5.93a3 3 0 0 1 3.64-1.5l2.52.83a1 1 0 0 0 1.25-.6l4.66-12.4a5 5 0 0 1 3.1-2.99l4.43-1.48Z" 7100 /> 7101 <path 7102 fill="#fff" 7103 fill-rule="evenodd" 7104 d="M35.5 27a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z" 7105 clip-rule="evenodd" 7106 /> 7107 <path fill="#fff" d="M31 0v60h-2V0h2Z" /> 7108 <path fill="#E87DE8" d="M33.5 27a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" /> 7109 </g> 7110 <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" /> 7111 <defs> 7112 <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath> 7113 </defs> 7114</svg> `,I$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 7115 <g clip-path="url(#a)"> 7116 <rect width="60" height="60" fill="#987DE8" rx="30" /> 7117 <path 7118 fill="#fff" 7119 fill-rule="evenodd" 7120 d="m15.48 28.37 11.97-19.3a3 3 0 0 1 5.1 0l11.97 19.3a6 6 0 0 1 .9 3.14v.03a6 6 0 0 1-1.16 3.56L33.23 50.2a4 4 0 0 1-6.46 0L15.73 35.1a6 6 0 0 1-1.15-3.54v-.03a6 6 0 0 1 .9-3.16Z" 7121 clip-rule="evenodd" 7122 /> 7123 <path 7124 fill="#643CDD" 7125 d="M30.84 10.11a1 1 0 0 0-.84-.46V24.5l12.6 5.53a2 2 0 0 0-.28-1.4L30.84 10.11Z" 7126 /> 7127 <path 7128 fill="#BDADEB" 7129 d="M30 9.65a1 1 0 0 0-.85.46L17.66 28.64a2 2 0 0 0-.26 1.39L30 24.5V9.65Z" 7130 /> 7131 <path 7132 fill="#643CDD" 7133 d="M30 50.54a1 1 0 0 0 .8-.4l11.24-15.38c.3-.44-.2-1-.66-.73l-9.89 5.68a3 3 0 0 1-1.5.4v10.43Z" 7134 /> 7135 <path 7136 fill="#BDADEB" 7137 d="m17.97 34.76 11.22 15.37c.2.28.5.41.8.41V40.11a3 3 0 0 1-1.49-.4l-9.88-5.68c-.47-.27-.97.3-.65.73Z" 7138 /> 7139 <path 7140 fill="#401AB3" 7141 d="M42.6 30.03 30 24.5v13.14a3 3 0 0 0 1.5-.4l10.14-5.83a2 2 0 0 0 .95-1.38Z" 7142 /> 7143 <path 7144 fill="#7C5AE2" 7145 d="M30 37.64V24.46l-12.6 5.57a2 2 0 0 0 .97 1.39l10.13 5.82a3 3 0 0 0 1.5.4Z" 7146 /> 7147 </g> 7148 <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" /> 7149 <defs> 7150 <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath> 7151 </defs> 7152</svg> `,N$e=Wi`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"> 7153 <rect width="64" height="64" rx="30" fill="#1DC956"/> 7154 <rect x="0.5" y="0.5" width="63" height="63" rx="29.5" stroke="#141414" stroke-opacity="0.1"/> 7155 <path d="M32.4053 19.8031C35.3901 19.8031 38.0431 20.8349 40.1619 22.8247L45.9656 17.0211C42.4465 13.7416 37.8773 11.7333 32.4053 11.7333C24.4829 11.7333 17.6475 16.2841 14.3127 22.9168L21.056 28.1493C22.6589 23.359 27.136 19.8031 32.4053 19.8031Z" fill="#1DC956" stroke="white" stroke-width="2" stroke-linejoin="round"/> 7156 <path d="M32.4053 52.2667C37.8773 52.2667 42.465 50.4611 45.8182 47.3658L39.2407 42.2623C37.4351 43.4783 35.1321 44.2153 32.4053 44.2153C27.136 44.2153 22.6589 40.6594 21.056 35.8691L14.3127 41.1016C17.6475 47.7159 24.4829 52.2667 32.4053 52.2667Z" fill="#2BEE6C"/> 7157 <path d="M21.056 35.8507L19.5636 36.993L14.3127 41.0832M39.2407 42.2623L45.8182 47.3658C42.465 50.4611 37.8773 52.2667 32.4053 52.2667C24.4829 52.2667 17.6475 47.7159 14.3127 41.1016L21.056 35.8691C22.6589 40.6594 27.136 44.2153 32.4053 44.2153C35.1321 44.2153 37.4351 43.4783 39.2407 42.2623Z" stroke="white" stroke-width="2" stroke-linejoin="round"/> 7158 <path d="M51.8613 32.4606C51.8613 31.0235 51.7323 29.6417 51.4928 28.3151H32.4053V36.1638H43.3124C42.8334 38.688 41.3963 40.8252 39.2407 42.2623L45.8181 47.3658C49.6503 43.8283 51.8613 38.6327 51.8613 32.4606Z" fill="#1FAD7E" stroke="white" stroke-width="2" stroke-linejoin="round"/> 7159 <path d="M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3
7159653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" fill="#86F999"/> 7160 <path d="M21.056 35.8691L14.3127 41.1016M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" stroke="white" stroke-width="2" stroke-linejoin="round"/> 7161</svg> 7162`,R$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 7163 <rect width="60" height="60" fill="#1DC956" rx="3" /> 7164 <path 7165 fill="#1FAD7E" 7166 stroke="#fff" 7167 stroke-width="2" 7168 d="m30.49 29.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z" 7169 /> 7170 <path 7171 fill="#2BEE6C" 7172 stroke="#fff" 7173 stroke-width="2" 7174 d="m30.49 19.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z" 7175 /> 7176 <path 7177 fill="#86F999" 7178 stroke="#fff" 7179 stroke-width="2" 7180 d="m46.69 21.06-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-6.32-3.51-.18-.1c-2.33-1.3-3.72-2.06-5.22-2.33a9 9 0 0 0-3.08 0c-1.5.27-2.9 1.04-5.22 2.33l-.17.1-6.33 3.51-.05.03c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45Z" 7181 /> 7182 <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" /> 7183</svg>`,M$e=Wi`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"> 7184 <g clip-path="url(#clip0_241_31636)"> 7185 <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58318 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58318 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9269C60.4784 58.4159 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4159 2.1019 55.9269C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#794CFF"/> 7186 <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/> 7187 <path d="M40 39.4595C44.7824 36.693 48 31.5222 48 25.6C48 16.7634 40.8366 9.59998 32 9.59998C23.1634 9.59998 16 16.7634 16 25.6C16 31.5222 19.2176 36.693 24 39.4595V45.8144H40V39.4595Z" fill="#906EF7"/> 7188 <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#906EF7"/> 7189 <path d="M24 45.8144V39.4595C19.2176 36.693 16 31.5222 16 25.6C16 16.7634 23.1634 9.59998 32 9.59998C40.8366 9.59998 48 16.7634 48 25.6C48 31.5222 44.7824 36.693 40 39.4595V45.8144M24 45.8144H40M24 45.8144V49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144" stroke="white" stroke-width="2" stroke-linejoin="round"/> 7190 <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#643CDD" stroke="white" stroke-width="2" stroke-linejoin="round"/> 7191 <path d="M29.6735 26.9101V29.1109H34.0753V26.9101C34.0753 25.6945 35.0607 24.7092 36.2762 24.7092C37.4917 24.7092 38.4771 25.6945 38.4771 26.9101C38.4771 28.1256 37.4917 29.1109 36.2762 29.1109H34.0753H29.6735H27.4726C26.2571 29.1109 25.2717 28.1256 25.2717 26.9101C25.2717 25.6945 26.2571 24.7092 27.4726 24.7092C28.6881 24.7092 29.6735 25.6945 29.6735 26.9101Z" fill="#906EF7"/> 7192 <path d="M29.6735 45.3183V26.9101C29.6735 25.6945 28.6881 24.7092 27.4726 24.7092V24.7092C26.2571 24.7092 25.2717 25.6945 25.2717 26.9101V26.9101C25.2717 28.1256 26.2571 29.1109 27.4726 29.1109H36.2762C37.4917 29.1109 38.4771 28.1256 38.4771 26.9101V26.9101C38.4771 25.6945 37.4917 24.7092 36.2762 24.7092V24.7092C35.0607 24.7092 34.0753 25.6945 34.0753 26.9101V45.3183" stroke="white" stroke-width="2" stroke-linejoin="round"/> 7193 </g>
7194 <defs> 7195 <clipPath id="clip0_241_31636"> 7196 <rect width="64" height="64" fill="white"/> 7197 </clipPath> 7198 </defs> 7199</svg> 7200`,k$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 7201 <rect width="60" height="60" fill="#C653C6" rx="3" /> 7202 <path 7203 fill="#fff" 7204 d="M20.03 15.22C20 15.6 20 16.07 20 17v2.8c0 1.14 0 1.7-.2 2.12-.15.31-.3.5-.58.71-.37.28-1.06.42-2.43.7-.59.12-1.11.29-1.6.51a9 9 0 0 0-4.35 4.36C10 30 10 32.34 10 37c0 4.66 0 7 .84 8.8a9 9 0 0 0 4.36 4.36C17 51 19.34 51 24 51h12c4.66 0 7 0 8.8-.84a9 9 0 0 0 4.36-4.36C50 44 50 41.66 50 37c0-4.66 0-7-.84-8.8a9 9 0 0 0-4.36-4.36c-.48-.22-1-.39-1.6-.5-1.36-.29-2.05-.43-2.42-.7-.27-.22-.43-.4-.58-.72-.2-.42-.2-.98-.2-2.11V17c0-.93 0-1.4-.03-1.78a9 9 0 0 0-8.19-8.19C31.4 7 30.93 7 30 7s-1.4 0-1.78.03a9 9 0 0 0-8.19 8.19Z" 7205 /> 7206 <path 7207 fill="#E87DE8" 7208 d="M22 17c0-.93 0-1.4.04-1.78a7 7 0 0 1 6.18-6.18C28.6 9 29.07 9 30 9s1.4 0 1.78.04a7 7 0 0 1 6.18 6.18c.04.39.04.85.04 1.78v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.4-.08-1.78a4 4 0 0 0-3.14-3.14C31.39 12 30.93 12 30 12s-1.4 0-1.78.08a4 4 0 0 0-3.14 3.14c-.08.39-.08.85-.08 1.78v4.5a1.5 1.5 0 0 1-3 0V17Z" 7209 /> 7210 <path 7211 fill="#E87DE8" 7212 fill-rule="evenodd" 7213 d="M12 36.62c0-4.32 0-6.48.92-8.09a7 7 0 0 1 2.61-2.61C17.14 25 19.3 25 23.62 25h6.86c.46 0 .7 0 .9.02 2.73.22 4.37 2.43 4.62 4.98.27-2.7 2.11-5 5.02-5A6.98 6.98 0 0 1 48 31.98v5.4c0 4.32 0 6.48-.92 8.09a7 7 0 0 1-2.61 2.61c-1.61.92-3.77.92-8.09.92h-5.86c-.46 0-.7 0-.9-.02-2.73-.22-4.37-2.43-4.62-4.98-.26 2.58-1.94 4.82-4.71 4.99l-.7.01c-.55 0-.82 0-1.05-.02a7 7 0 0 1-6.52-6.52c-.02-.23-.02-.5-.02-1.05v-4.79Zm21.24-.27a4 4 0 1 0-6.48 0 31.28 31.28 0 0 1 1.57 2.23c.17.4.17.81.17 1.24V42.5a1.5 1.5 0 0 0 3 0V39.82c0-.43 0-.85.17-1.24.09-.2.58-.87 1.57-2.23Z" 7214 clip-rule="evenodd" 7215 /> 7216 <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" /> 7217</svg>`,O$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 7218 <g clip-path="url(#a)"> 7219 <path 7220 fill="#EB8B47" 7221 d="M0 24.9c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02 0 15.65 0 24.9 0h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.02 60 15.65 60 24.9v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6C48.98 60 44.35 60 35.1 60H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 48.98 0 44.35 0 35.1V24.9Z" 7222 /> 7223 <path 7224 stroke="#062B2B" 7225 stroke-opacity=".1" 7226 d="M.5 24.9c0-4.64 0-8.08.24-10.8.25-2.7.73-4.65 1.66-6.28A14.5 14.5 0 0 1 7.82 2.4C9.46 1.47 11.39 1 14.1.74A133 133 0 0 1 24.9.5h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.66a14.5 14.5 0 0 1 5.42 5.42c.93 1.63 1.41 3.57 1.66 6.28.24 2.72.24 6.16.24 10.8v10.2c0 4.63 0 8.08-.24 10.8-.25 2.7-.73 4.64-1.66 6.28a14.5 14.5 0 0 1-5.42 5.41c-1.63.94-3.57 1.42-6.28 1.67-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.67a14.5 14.5 0 0 1-5.42-5.4C1.47 50.53 1 48.6.74 45.88A133 133 0 0 1 .5 35.1V24.9Z" 7227 /> 7228 <path 7229 fill="#FF974C" 7230 stroke="#fff" 7231 stroke-width="2" 7232 d="M39.2 29.2a13 13 0 1 0-18.4 0l1.3 1.28a12.82 12.82 0 0 1 2.1 2.39 6 6 0 0 1 .6 1.47c.2.76.2 1.56.2 3.17v11.24c0 1.08 0 1.61.13 2.12a4 4 0 0 0 .41.98c.26.45.64.83 1.4 1.6l.3.29c.65.65.98.98 1.36 1.09.26.07.54.07.8 0 .38-.11.7-.44 1.36-1.1l3.48-3.47c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.47-.48c-.
723265-.65-.98-.98-1.09-1.36a1.5 1.5 0 0 1 0-.8c.1-.38.44-.7 1.1-1.36l.47-.48c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.48-.5c-.65-.64-.98-.97-1.08-1.35a1.5 1.5 0 0 1 0-.79c.1-.38.42-.7 1.06-1.36l5.46-5.55Z" 7233 /> 7234 <circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2" /> 7235 </g> 7236 <defs> 7237 <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath> 7238 </defs> 7239</svg> `,P$e=Wi`<svg width="40" height="42" viewBox="0 0 40 42" fill="none"> 7240<path opacity="0.7" d="M19.9526 41.9076L7.3877 34.655V26.1226L19.9526 33.3751V41.9076Z" fill="url(#paint0_linear_2113_32117)"/> 7241<path opacity="0.7" d="M19.9521 41.9076L32.5171 34.655V26.1226L19.9521 33.3751V41.9076Z" fill="url(#paint1_linear_2113_32117)"/> 7242<path opacity="0.7" d="M39.9095 7.34521V21.8562L32.5166 26.1225V11.6114L39.9095 7.34521Z" fill="url(#paint2_linear_2113_32117)"/> 7243<path d="M39.9099 7.34536L27.345 0.0927734L19.9521 4.359L32.5171 11.6116L39.9099 7.34536Z" fill="url(#paint3_linear_2113_32117)"/> 7244<path d="M0 7.34536L12.5649 0.0927734L19.9519 4.359L7.387 11.6116L0 7.34536Z" fill="#F969D3"/> 7245<path opacity="0.7" d="M0 7.34521V21.8562L7.387 26.1225V11.6114L0 7.34521Z" fill="url(#paint4_linear_2113_32117)"/> 7246<defs> 7247<linearGradient id="paint0_linear_2113_32117" x1="18.6099" y1="41.8335" x2="7.73529" y2="8.31842" gradientUnits="userSpaceOnUse"> 7248<stop stop-color="#E98ADA"/> 7249<stop offset="1" stop-color="#7E4DBD"/> 7250</linearGradient> 7251<linearGradient id="paint1_linear_2113_32117" x1="26.2346" y1="26.1226" x2="26.2346" y2="41.9076" gradientUnits="userSpaceOnUse"> 7252<stop stop-color="#719DED"/> 7253<stop offset="1" stop-color="#2545BE"/> 7254</linearGradient> 7255<linearGradient id="paint2_linear_2113_32117" x1="36.213" y1="7.34521" x2="36.213" y2="26.1225" gradientUnits="userSpaceOnUse"> 7256<stop stop-color="#93EBFF"/> 7257<stop offset="1" stop-color="#197DDB"/> 7258</linearGradient> 7259<linearGradient id="paint3_linear_2113_32117" x1="29.931" y1="0.0927734" x2="38.2156" y2="14.8448" gradientUnits="userSpaceOnUse"> 7260<stop stop-color="#F969D3"/> 7261<stop offset="1" stop-color="#4F51C0"/> 7262</linearGradient> 7263<linearGradient id="paint4_linear_2113_32117" x1="18.1251" y1="44.2539" x2="-7.06792" y2="15.2763" gradientUnits="userSpaceOnUse"> 7264<stop stop-color="#E98ADA"/> 7265<stop offset="1" stop-color="#7E4DBD"/> 7266</linearGradient> 7267</defs> 7268</svg>`,D$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 7269 <g clip-path="url(#a)"> 7270 <rect width="60" height="60" fill="#00ACE6" rx="30" /> 7271 <circle cx="64" cy="39" r="50" fill="#1AC6FF" stroke="#fff" stroke-width="2" /> 7272 <circle cx="78" cy="30" r="50" fill="#4DD2FF" stroke="#fff" stroke-width="2" /> 7273 <circle cx="72" cy="15" r="35" fill="#80DFFF" stroke="#fff" stroke-width="2" /> 7274 <circle cx="34" cy="-17" r="45" stroke="#fff" stroke-width="2" /> 7275 <circle cx="34" cy="-5" r="50" stroke="#fff" stroke-width="2" /> 7276 <circle cx="30" cy="45" r="4" fill="#4DD2FF" stroke="#fff" stroke-width="2" /> 7277 <circle cx="39.5" cy="27.5" r="4" fill="#80DFFF" stroke="#fff" stroke-width="2" /> 7278 <circle cx="16" cy="24" r="4" fill="#19C6FF" stroke="#fff" stroke-width="2" /> 7279 </g> 7280 <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" /> 7281 <defs> 7282 <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath> 7283 </defs> 7284</svg>`,B$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 7285 <g clip-path="url(#a)"> 7286 <rect width="60" height="60" fill="#C653C6" rx="3" /> 7287 <path 7288 fill="#E87DE8" 7289 stroke="#fff" 7290 stroke-width="2" 7291 d="M52.1 47.34c0-4.24-1.44-9.55-5.9-12.4a2.86 2.86 0 0 0-1.6-3.89v-.82c0-1.19-.52-2.26-1.35-3a4.74 4.74 0 0 0-2.4-6.26v-5.5a11.31 11.31 0 1 0-22.63 0v2.15a3.34 3.34 0 0 0-1.18 5.05 4.74 4.74 0 0 0-.68 6.44A5.22 5.22 0 0 0 14 35.92c-3.06 4.13-6.1 8.3-6.1 15.64 0 2.67.37 4.86.74 6.39a20.3 20.3 0 0 0 .73 2.39l.02.04v.01l.92-.39-.92.4.26.6h38.26l.3-.49-.87-.51.86.5.02-.01.03-.07a16.32 16.32 0 0 0 .57-1.05c.36-.72.85-1.74 1.33-2.96a25.51 25.51 0 0 0 1.94-9.07Z" 7292 /> 7293 <path 7294 fill="#fff" 7295 fill-rule="evenodd" 7296 d="M26.5 29.5c-3-.5-5.5-3-5.5-7v-7c0-.47 0-.7.03-.9a3 3 0 0 1 2.58-2.57c.2-.03.42-.03.89-.03 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.4 0 2.1 0 2.65.23a3 3 0 0 1 1.62 1.62c.23.55.23 1.25.23 2.65v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.5 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z" 7297 clip-rule="evenodd" 7298 /> 7299 </g> 7300 <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" /> 7301 <defs> 7302 <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="3" /></clipPath> 7303 </defs> 7304</svg> `,L$e=Wi`<svg fill="none" viewBox="0 0 60 60"> 7305 <rect width="60" height="60" fill="#794CFF" rx="3" /> 7306 <path 7307 fill="#987DE8" 7308 stroke="#fff" 7309 stroke-width="2" 7310 d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z" 7311 /> 7312 <path fill="#fff" d="M37.5 25h10v10h-10z" /> 7313 <path fill="#4019B2" d="M42.5 25h5v10h-5z" /> 7314 <path fill="#fff" d="M19.5 25h10v10h-10z" /> 7315 <path fill="#4019B2" d="M24.5 25h5v10h-5z" /> 7316 <path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z" /> 7317 <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" /> 7318</svg>
7318`,$$e=Wi`<svg width="60" height="60" viewBox="0 0 60 60" fill="none"> 7319<g clip-path="url(#clip0_13859_31161)"> 7320 <path d="M0 24.8995C0 15.6481 0 11.0223 1.97053 7.56763C3.3015 5.2342 5.23468 3.30101 7.56812 1.97004C11.0228 -0.000488281 15.6485 -0.000488281 24.9 -0.000488281H35.1C44.3514 -0.000488281 48.9772 -0.000488281 52.4319 1.97004C54.7653 3.30101 56.6985 5.2342 58.0295 7.56763C60 11.0223 60 15.6481 60 24.8995V35.0995C60 44.351 60 48.9767 58.0295 52.4314C56.6985 54.7648 54.7653 56.698 52.4319 58.029C48.9772 59.9995 44.3514 59.9995 35.1 59.9995H24.9C15.6485 59.9995 11.0228 59.9995 7.56812 58.029C5.23468 56.698 3.3015 54.7648 1.97053 52.4314C0 48.9767 0 44.351 0 35.0995V24.8995Z" fill="#EB8B47"/> 7321 <path d="M0.5 24.8995C0.5 20.2647 0.50047 16.8216 0.744315 14.1045C0.987552 11.3941 1.46987 9.45455 2.40484 7.81536C3.69145 5.55971 5.56019 3.69096 7.81585 2.40435C9.45504 1.46938 11.3946 0.987064 14.105 0.743826C16.8221 0.499981 20.2652 0.499512 24.9 0.499512H35.1C39.7348 0.499512 43.1779 0.499981 45.895 0.743826C48.6054 0.987064 50.545 1.46938 52.1841 2.40435C54.4398 3.69096 56.3086 5.55971 57.5952 7.81536C58.5301 9.45455 59.0124 11.3941 59.2557 14.1045C59.4995 16.8216 59.5 20.2647 59.5 24.8995V35.0995C59.5 39.7343 59.4995 43.1774 59.2557 45.8945C59.0124 48.6049 58.5301 50.5445 57.5952 52.1837C56.3086 54.4393 54.4398 56.3081 52.1841 57.5947C50.545 58.5296 48.6054 59.012 45.895 59.2552C43.1779 59.499 39.7348 59.4995 35.1 59.4995H24.9C20.2652 59.4995 16.8221 59.499 14.105 59.2552C11.3946 59.012 9.45504 58.5296 7.81585 57.5947C5.56019 56.3081 3.69145 54.4393 2.40484 52.1837C1.46987 50.5445 0.987552 48.6049 0.744315 45.8945C0.50047 43.1774 0.5 39.7343 0.5 35.0995V24.8995Z" stroke="#141414" stroke-opacity="0.1"/> 7322 <path d="M13 26.0335C13 21.7838 13 19.659 14.0822 18.1694C14.4318 17.6883 14.8548 17.2653 15.3359 16.9157C16.8255 15.8335 18.9503 15.8335 23.2 15.8335H36.8C41.0497 15.8335 43.1745 15.8335 44.6641 16.9157C45.1452 17.2653 45.5682 17.6883 45.9178 18.1694C47 19.659 47 21.7838 47 26.0335V33.9668C47 38.2165 47 40.3414 45.9178 41.831C45.5682 42.312 45.1452 42.7351 44.6641 43.0846C43.1745 44.1668 41.0497 44.1668 36.8 44.1668H23.2C18.9503 44.1668 16.8255 44.1668 15.3359 43.0846C14.8548 42.7351 14.4318 42.312 14.0822 41.831C13 40.3414 13 38.2165 13 33.9668V26.0335Z" fill="#FF974C" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 7323 <path d="M39.5 36.667H36.6666" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/> 7324 <path d="M45.2 23.0645H14.8C14.0501 23.0645 13.6751 23.0645 13.4122 23.2554C13.3273 23.3171 13.2527 23.3918 13.191 23.4767C13 23.7395 13 24.1145 13 24.8645V27.2645C13 28.0144 13 28.3894 13.191 28.6522C13.2527 28.7371 13.3273 28.8118 13.4122 28.8735C13.6751 29.0645 14.0501 29.0645 14.8 29.0645H45.2C45.9499 29.0645 46.3249 29.0645 46.5878 28.8735C46.6727 28.8118 46.7473 28.7371 46.809 28.6522C47 28.3894 47 28.0144 47 27.2645V24.8645C47 24.1145 47 23.7395 46.809 23.4767C46.7473 23.3918 46.6727 23.3171 46.5878 23.2554C46.3249 23.0645 45.9499 23.0645 45.2 23.0645Z" fill="white" fill-opacity="0.4" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 7325</g> 7326<defs> 7327 <clipPath id="clip0_13859_31161"> 7328 <rect width="60" height="60" fill="white"/> 7329 </clipPath> 7330</defs> 7331</svg>`,U$e=Wi`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"> 7332 <g clip-path="url(#clip0_241_31635)"> 7333 <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58317 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58317 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9268C60.4784 58.4158 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4158 2.1019 55.9268C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#EB8B47"/> 7334 <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199
7334C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/> 7335 <path d="M28.1042 49.2329L13.1024 51.2077L15.0772 36.2059L37.1015 14.1815C39.2441 12.039 40.3154 10.9677 41.5718 10.624C42.4205 10.3918 43.3159 10.3918 44.1645 10.624C45.421 10.9677 46.4922 12.039 48.6348 14.1815L50.1286 15.6753C52.2711 17.8179 53.3424 18.8891 53.6861 20.1456C53.9183 20.9942 53.9183 21.8896 53.6861 22.7383C53.3424 23.9947 52.2711 25.066 50.1286 27.2086L28.1042 49.2329Z" fill="#FF974C" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 7336 <path d="M38.5962 20.5376L22.4199 36.7139" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 7337 <path d="M43.7727 25.714L27.5964 41.8903" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 7338 <path d="M22.3703 36.7635C19.3258 39.808 16.0198 36.6395 16.2616 35.0324" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 7339 <path d="M27.5466 41.9399C24.5034 44.9831 28.155 48.7098 29.2738 48.0475" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 7340 <path d="M27.5468 41.9398C23.428 46.0586 18.2516 40.8822 22.3704 36.7634" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 7341 <path d="M15.8191 50.5214C15.4711 49.5823 14.728 48.8392 13.7889 48.4912" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 7342 <path d="M49.2862 29.5805L34.7275 15.0219" stroke="#E4E7E7" stroke-width="2" stroke-linejoin="round"/> 7343 </g> 7344 <defs> 7345 <clipPath id="clip0_241_31635"> 7346 <rect width="64" height="64" fill="white"/> 7347 </clipPath> 7348 </defs> 7349</svg> 7350`,j$e=Wi`<svg 7351 viewBox="0 0 60 60" 7352 fill="none" 7353> 7354 <g clip-path="url(#1)"> 7355 <rect width="60" height="60" rx="30" fill="#00ACE6" /> 7356 <path 7357 d="M59 73C59 89.0163 46.0163 102 30 102C13.9837 102 1 89.0163 1 73C1 56.9837 12 44 30 44C48 44 59 56.9837 59 73Z" 7358 fill="#1AC6FF" 7359 stroke="white" 7360 stroke-width="2" 7361 /> 7362 <path 7363 d="M18.6904 19.9015C19.6264 15.3286 23.3466 11.8445 27.9708 11.2096C29.3231 11.024 30.6751 11.0238 32.0289 11.2096C36.6532 11.8445 40.3733 15.3286 41.3094 19.9015C41.4868 20.7681 41.6309 21.6509 41.7492 22.5271C41.8811 23.5041 41.8811 24.4944 41.7492 25.4715C41.6309 26.3476 41.4868 27.2304 41.3094 28.097C40.3733 32.6699 36.6532 36.154 32.0289 36.7889C30.6772 36.9744 29.3216 36.9743 27.9708 36.7889C23.3466 36.154 19.6264 32.6699 18.6904 28.097C18.513 27.2304 18.3689 26.3476 18.2506 25.4715C18.1186 24.4944 18.1186 23.5041 18.2506 22.5271C18.3689 21.6509 18.513 20.7681 18.6904 19.9015Z" 7364 fill="#1AC6FF" 7365 stroke="white" 7366 stroke-width="2" 7367 /> 7368 <circle cx="24.5" cy="23.5" r="1.5" fill="white" /> 7369 <circle cx="35.5" cy="23.5" r="1.5" fill="white" /> 7370 <path 7371 d="M31 20L28 28H32" 7372 stroke="white" 7373 stroke-width="2" 7374 stroke-linecap="round" 7375 stroke-linejoin="round" 7376 /> 7377 </g> 7378 <rect x="0.5" y="0.5" width="59" height="59" rx="29.5" stroke="white" stroke-opacity="0.1" /> 7379 <defs> 7380 <clipPath id="1"> 7381 <rect width="60" height="60" rx="30" fill="white" /> 7382 </clipPath> 7383 </defs> 7384</svg> `,z$e=Wi`<svg fill="none" viewBox="0 0 80 80"> 7385 <g clip-path="url(#a)"> 7386 <path fill="url(#b)" d="M40 80a40 40 0 1 0 0-80 40 40 0 0 0 0 80Z" /> 7387 <path 7388 stroke="#fff" 7389 stroke-opacity=".1" 7390 d="M79.5 40a39.5 39.5 0 1 1-79 0 39.5 39.5 0 0 1 79 0Z" 7391 /> 7392 <path 7393 fill="#fff" 7394 d="m62.62 51.54-7.54 7.91a1.75 1.75 0 0 1-1.29.55H18.02a.9.9 0 0 1-.8-.52.84.84 0 0 1 .16-.92l7.55-7.92a1.75 1.75 0 0 1 1.28-.55h35.77a.87.87 0 0 1 .8.52.84.84 0 0 1-.16.93Zm-7.54-15.95a1.75 1.75 0 0 0-1.29-.54H18.02a.89.89 0 0 0-.8.51.84.84 0 0 0 .16.93l7.55 7.92a1.75 1.75 0 0 0 1.28.54h35.77a.89.89 0 0 0 .8-.51.84.84 0 0 0-.16-.93l-7.54-7.92ZM18.02 29.9h35.77a1.79 1.79 0 0 0 1.29-.54l7.54-7.92a.85.85 0 0 0 .16-.93.87.87 0 0 0-.8-.51H26.21a1.79 1.79 0 0 0-1.28.54l-7.55 7.92a.85.85 0 0 0-.16.93.89.89 0 0 0 .8.52Z" 7395 /> 7396 </g>
7397 <defs> 7398 <linearGradient id="b" x1="6.75" x2="80.68" y1="81.91" y2="7.37" gradientUnits="userSpaceOnUse"> 7399 <stop offset=".08" stop-color="#9945FF" /> 7400 <stop offset=".3" stop-color="#8752F3" /> 7401 <stop offset=".5" stop-color="#5497D5" /> 7402 <stop offset=".6" stop-color="#43B4CA" /> 7403 <stop offset=".72" stop-color="#28E0B9" /> 7404 <stop offset=".97" stop-color="#19FB9B" /> 7405 </linearGradient> 7406 <clipPath id="a"><path fill="#fff" d="M0 0h80v80H0z" /></clipPath> 7407 </defs> 7408</svg> `,F$e=Wi`<svg viewBox="0 0 60 60" fill="none"> 7409 <g clip-path="url(#1)"> 7410 <path 7411 d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z" 7412 fill="#794CFF" 7413 /> 7414 <path 7415 d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z" 7416 stroke="#062B2B" 7417 stroke-opacity="0.1" 7418 /> 7419 <path 7420 d="M35.1403 31.5016C35.1193 30.9637 35.388 30.4558 35.8446 30.1707C36.1207 29.9982 36.4761 29.8473 36.7921 29.7685C37.3143 29.6382 37.8664 29.7977 38.2386 30.1864C38.8507 30.8257 39.3004 31.6836 39.8033 32.408C40.2796 33.0942 41.4695 33.2512 41.9687 32.5047C42.4839 31.7341 42.9405 30.8229 43.572 30.1399C43.9375 29.7447 44.4866 29.5756 45.0111 29.6967C45.3283 29.7701 45.6863 29.9147 45.9655 30.0823C46.4269 30.3595 46.7045 30.8626 46.6928 31.4008C46.6731 32.3083 46.3764 33.2571 46.2158 34.1473C46.061 35.0048 46.9045 35.8337 47.7592 35.664C48.6464 35.4878 49.5899 35.1747 50.497 35.1391C51.0348 35.1181 51.5427 35.3868 51.8279 35.8433C52.0004 36.1195 52.1513 36.4749 52.2301 36.7908C52.3604 37.3131 52.2009 37.8651 51.8121 38.2374C51.1729 38.8495 50.3151 39.2991 49.5908 39.8019C48.9046 40.2782 48.7473 41.4683 49.4939 41.9675C50.2644 42.4827 51.1757 42.9393 51.8587 43.5708C52.2539 43.9362 52.423 44.4854 52.3018 45.0099C52.2285 45.3271 52.0839 45.6851 51.9162 45.9642C51.6391 46.4257 51.1359 46.7032 50.5978 46.6916C49.6903 46.6719 48.7417 46.3753 47.8516 46.2146C46.9939 46.0598 46.1648 46.9035 46.3346 47.7583C46.5108 48.6454 46.8239 49.5888 46.8594 50.4958C46.8805 51.0336 46.6117 51.5415 46.1552 51.8267C45.879 51.9992 45.5236 52.15 45.2077 52.2289C44.6854 52.3592 44.1334 52.1997 43.7611 51.8109C43.1491 51.1718 42.6996 50.314 42.1968 49.5897C41.7203 48.9034 40.5301 48.7463 40.0309 49.493C39.5157 50.2634 39.0592 51.1746 38.4278 51.8574C38.0623 52.2527 37.5132 52.4218 36.9887 52.3006C36.6715 52.2273 36.3135 52.0826 36.0343 51.915C35.5729 51.6379 35.2953 51.1347 35.307 50.5966C35.3267 49.6891 35.6233 48.7405 35.7839 47.8505C35.9388 46.9928 35.0951 46.1636 34.2402 46.3334C33.3531 46.5096 32.4098 46.8227 31.5028 46.8582C30.9649 46.8793 30.457 46.6105 30.1719 46.154C29.9994 45.8778 29.8485 45.5224 29.7697 45.2065C29.6394 44.6842 29.7989 44.1322 30.1877 43.7599C30.8269 43.1479 31.6847 42.6982 32.4091 42.1954C33.0954 41.7189 33.2522 40.5289 32.5056 40.0297C31.7351 39.5145 30.824 39.058 30.1411 38.4265C29.7459 38.0611 29.5768 37.5119 29.698 36.9875C29.7713 36.6702 29.9159 36.3122 30.0836 36.0331C30.3607 35.5
7420717 30.8638 35.2941 31.402 35.3058C32.3095 35.3255 33.2583 35.6221 34.1485 35.7828C35.006 35.9376 35.8349 35.094 35.6652 34.2393C35.489 33.3521 35.1759 32.4087 35.1403 31.5016Z" 7421 fill="#906EF7" 7422 stroke="white" 7423 stroke-width="2" 7424 /> 7425 <path 7426 d="M20.7706 8.22357C20.9036 7.51411 21.5231 7 22.2449 7H23.7551C24.4769 7 25.0964 7.51411 25.2294 8.22357C25.5051 9.69403 25.4829 11.6321 27.1202 12.2606C27.3092 12.3331 27.4958 12.4105 27.6798 12.4926C29.2818 13.2072 30.6374 11.8199 31.8721 10.9752C32.4678 10.5676 33.2694 10.6421 33.7798 11.1525L34.8477 12.2204C35.3581 12.7308 35.4326 13.5323 35.025 14.128C34.1802 15.3627 32.7931 16.7183 33.5077 18.3202C33.5898 18.5043 33.6672 18.6909 33.7398 18.88C34.3683 20.5171 36.3061 20.4949 37.7764 20.7706C38.4859 20.9036 39 21.5231 39 22.2449V23.7551C39 24.4769 38.4859 25.0964 37.7764 25.2294C36.3061 25.5051 34.3685 25.483 33.7401 27.1201C33.6675 27.3093 33.59 27.4961 33.5079 27.6803C32.7934 29.282 34.1803 30.6374 35.025 31.8719C35.4326 32.4677 35.3581 33.2692 34.8477 33.7796L33.7798 34.8475C33.2694 35.3579 32.4678 35.4324 31.8721 35.0248C30.6376 34.1801 29.2823 32.7934 27.6806 33.508C27.4962 33.5903 27.3093 33.6678 27.12 33.7405C25.483 34.3688 25.5051 36.3062 25.2294 37.7764C25.0964 38.4859 24.4769 39 23.7551 39H22.2449C21.5231 39 20.9036 38.4859 20.7706 37.7764C20.4949 36.3062 20.517 34.3688 18.88 33.7405C18.6908 33.6678 18.5039 33.5903 18.3196 33.5081C16.7179 32.7936 15.3625 34.1804 14.1279 35.0251C13.5322 35.4327 12.7307 35.3582 12.2203 34.8478L11.1524 33.7799C10.642 33.2695 10.5675 32.4679 10.9751 31.8722C11.8198 30.6376 13.2067 29.2822 12.4922 27.6804C12.41 27.4962 12.3325 27.3093 12.2599 27.1201C11.6315 25.483 9.69392 25.5051 8.22357 25.2294C7.51411 25.0964 7 24.4769 7 23.7551V22.2449C7 21.5231 7.51411 20.9036 8.22357 20.7706C9.69394 20.4949 11.6317 20.5171 12.2602 18.88C12.3328 18.6909 12.4103 18.5042 12.4924 18.3201C13.207 16.7181 11.8198 15.3625 10.975 14.1278C10.5674 13.5321 10.6419 12.7305 11.1523 12.2201L12.2202 11.1522C12.7306 10.6418 13.5322 10.5673 14.1279 10.9749C15.3626 11.8197 16.7184 13.2071 18.3204 12.4925C18.5044 12.4105 18.6909 12.3331 18.8799 12.2606C20.5171 11.6321 20.4949 9.69403 20.7706 8.22357Z" 7427 fill="#906EF7" 7428 stroke="white" 7429 stroke-width="2" 7430 /> 7431 <circle cx="23" cy="23" r="6" fill="#794CFF" stroke="white" stroke-width="2" /> 7432 <circle cx="41" cy="41" r="4" fill="#794CFF" stroke="white" stroke-width="2" /> 7433 </g> 7434 <defs> 7435 <clipPath id="1"> 7436 <rect width="60" height="60" fill="white" /> 7437 </clipPath> 7438 </defs> 7439</svg> `,W$e=Mt` 7440 :host { 7441 display: block; 7442 width: var(--local-size); 7443 height: var(--local-size); 7444 } 7445 7446 :host svg { 7447 width: 100%; 7448 height: 100%; 7449 } 7450`;var sj=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const H$e={browser:S$e,dao:_$e,defi:C$e,defiAlt:T$e,eth:I$e,layers:R$e,lock:k$e,login:O$e,network:D$e,nft:B$e,noun:L$e,profile:j$e,system:F$e,meld:P$e,onrampCard:$$e,google:N$e,pencil:U$e,lightbulb:M$e,solana:z$e,bitcoin:A$e};let dC=class extends ut{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=` 7451 --local-size: var(--wui-visual-size-${this.size}); 7452 `,le`${H$e[this.name]}`}};dC.styles=[Dn,W$e];sj([be()],dC.prototype,"name",void 0);sj([be()],dC.prototype,"size",void 0);dC=sj([ot("wui-visual")],dC);var Dse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let FB=class extends ut{constructor(){super(...arguments),this.data=[]}render(){return le` 7453 <wui-flex flexDirection="column" alignItems="center" gap="l"> 7454 ${this.data.map(e=>le` 7455 <wui-flex flexDirection="column" alignItems="center" gap="xl"> 7456 <wui-flex flexDirection="row" justifyContent="center" gap="1xs"> 7457 ${e.images.map(t=>le`<wui-visual name=${t}></wui-visual>`)} 7458 </wui-flex> 7459 </wui-flex> 7460 <wui-flex flexDirection="column" alignItems="center" gap="xxs"> 7461 <wui-text variant="paragraph-500" color="fg-100" align="center"> 7462 ${e.title} 7463 </wui-text> 7464 <wui-text variant="small-500" color="fg-200" align="center">${e.text}</wui-text> 7465 </wui-flex> 7466 `)} 7467 </wui-flex> 7468 `}};Dse([be({type:Array})],FB.prototype,"data",void 0);FB=Dse([ot("w3m-help-widget")],FB);var V$e=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const q$e=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let WB=class extends ut{render(){return le` 7469 <wui-flex 7470 flexDirection="column" 7471 .padding=${["xxl","xl","xl","xl"]} 7472 alignItems="center" 7473 gap="xl" 7474 > 7475 <w3m-help-widget .data=${q$e}></w3m-help-widget> 7476 <wui-button variant="main" size="md" @click=${this.onGetWallet.bind(this)}> 7477 <wui-icon color="inherit" slot="iconLeft" name="wallet"></wui-icon> 7478 Get a wallet 7479 </wui-button>
7479 7480 </wui-flex> 7481 `}onGetWallet(){xn.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),it.push("GetWallet")}};WB=V$e([ot("w3m-what-is-a-wallet-view")],WB);const K$e=Mt` 7482 wui-flex { 7483 max-height: clamp(360px, 540px, 80vh); 7484 overflow: scroll; 7485 scrollbar-width: none; 7486 transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); 7487 will-change: opacity; 7488 } 7489 wui-flex::-webkit-scrollbar { 7490 display: none; 7491 } 7492 wui-flex.disabled { 7493 opacity: 0.3; 7494 pointer-events: none; 7495 user-select: none; 7496 } 7497`;var Bse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let hC=class extends ut{constructor(){super(),this.unsubscribe=[],this.checked=Gy.state.isLegalCheckboxChecked,this.unsubscribe.push(Gy.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var c;const{termsConditionsUrl:e,privacyPolicyUrl:t}=Ue.state,r=(c=Ue.state.features)==null?void 0:c.legalCheckbox,s=!!(e||t)&&!!r,o=s&&!this.checked,a=o?-1:void 0;return le` 7498 <w3m-legal-checkbox></w3m-legal-checkbox> 7499 <wui-flex 7500 flexDirection="column" 7501 .padding=${s?["0","s","s","s"]:"s"} 7502 gap="xs" 7503 class=${Nt(o?"disabled":void 0)} 7504 > 7505 <w3m-wallet-login-list tabIdx=${Nt(a)}></w3m-wallet-login-list> 7506 </wui-flex> 7507 <w3m-legal-footer></w3m-legal-footer> 7508 `}};hC.styles=K$e;Bse([qe()],hC.prototype,"checked",void 0);hC=Bse([ot("w3m-connect-wallets-view")],hC);const Y$e=Mt` 7509 :host { 7510 display: block; 7511 width: var(--wui-box-size-lg); 7512 height: var(--wui-box-size-lg); 7513 } 7514 7515 svg { 7516 width: var(--wui-box-size-lg); 7517 height: var(--wui-box-size-lg); 7518 fill: none; 7519 stroke: transparent; 7520 stroke-linecap: round; 7521 } 7522 7523 use { 7524 stroke: var(--wui-color-accent-100); 7525 stroke-width: 2px; 7526 stroke-dasharray: 54, 118; 7527 stroke-dashoffset: 172; 7528 animation: dash 1s linear infinite; 7529 } 7530 7531 @keyframes dash { 7532 to { 7533 stroke-dashoffset: 0px; 7534 } 7535 } 7536`;var G$e=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let HB=class extends ut{render(){return le` 7537 <svg viewBox="0 0 54 59"> 7538 <path 7539 id="wui-loader-path" 7540 d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z" 7541 /> 7542 <use xlink:href="#wui-loader-path"></use> 7543 </svg> 7544 `}};HB.styles=[Dn,Y$e];HB=G$e([ot("wui-loading-hexagon")],HB);const Z$e=Wi`<svg width="86" height="96" fill="none"> 7545 <path 7546 d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z" 7547 /> 7548</svg>`,Q$e=Wi` 7549 <svg fill="none" viewBox="0 0 36 40"> 7550 <path 7551 d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.
755161 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z" 7552 /> 7553 </svg> 7554`,X$e=Mt` 7555 :host { 7556 position: relative; 7557 border-radius: inherit; 7558 display: flex; 7559 justify-content: center; 7560 align-items: center; 7561 width: var(--local-width); 7562 height: var(--local-height); 7563 } 7564 7565 :host([data-round='true']) { 7566 background: var(--wui-color-gray-glass-002); 7567 border-radius: 100%; 7568 outline: 1px solid var(--wui-color-gray-glass-005); 7569 } 7570 7571 svg { 7572 position: absolute; 7573 top: 0; 7574 left: 0; 7575 width: 100%; 7576 height: 100%; 7577 z-index: 1; 7578 fill: var(--wui-color-gray-glass-002); 7579 } 7580 7581 svg > path { 7582 stroke: var(--local-stroke); 7583 } 7584 7585 wui-image { 7586 width: 100%; 7587 height: 100%; 7588 -webkit-clip-path: var(--local-path); 7589 clip-path: var(--local-path); 7590 background: var(--wui-color-gray-glass-002); 7591 } 7592 7593 wui-icon { 7594 transform: translateY(-5%); 7595 width: var(--local-icon-size); 7596 height: var(--local-icon-size); 7597 } 7598`;var hb=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let bg=class extends ut{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:Q$e,md:wse,lg:Z$e},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=` 7599 --local-width: var(--wui-spacing-3xl); 7600 --local-height: var(--wui-spacing-3xl); 7601 --local-icon-size: var(--wui-spacing-l); 7602 `):this.style.cssText=` 7603 7604 --local-path: var(--wui-path-network-${this.size}); 7605 --local-width: var(--wui-width-network-${this.size}); 7606 --local-height: var(--wui-height-network-${this.size}); 7607 --local-icon-size: var(--wui-icon-size-network-${this.size}); 7608 `,le`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?le`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:le`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};bg.styles=[Dn,X$e];hb([be()],bg.prototype,"size",void 0);hb([be()],bg.prototype,"name",void 0);hb([be({type:Object})],bg.prototype,"networkImagesBySize",void 0);hb([be()],bg.prototype,"imageSrc",void 0);hb([be({type:Boolean})],bg.prototype,"selected",void 0);hb([be({type:Boolean})],bg.prototype,"round",void 0);bg=hb([ot("wui-network-image")],bg);const J$e=Mt` 7609 @keyframes shake { 7610 0% { 7611 transform: translateX(0); 7612 } 7613 25% { 7614 transform: translateX(3px); 7615 } 7616 50% { 7617 transform: translateX(-3px); 7618 } 7619 75% { 7620 transform: translateX(3px); 7621 } 7622 100% { 7623 transform: translateX(0); 7624 } 7625 } 7626 7627 wui-flex:first-child:not(:only-child) { 7628 position: relative; 7629 } 7630 7631 wui-loading-hexagon { 7632 position: absolute; 7633 } 7634 7635 wui-icon-box { 7636 position: absolute; 7637 right: 4px; 7638 bottom: 0; 7639 opacity: 0; 7640 transform: scale(0.5); 7641 z-index: 1; 7642 } 7643 7644 wui-button { 7645 display: none; 7646 } 7647 7648 [data-error='true'] wui-icon-box { 7649 opacity: 1; 7650 transform: scale(1); 7651 } 7652 7653 [data-error='true'] > wui-flex:first-child { 7654 animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; 7655 } 7656 7657 wui-button[data-retry='true'] { 7658 display: block; 7659 opacity: 1; 7660 } 7661`;var oj=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Dx=class extends ut{constructor(){var e;super(),this.network=(e=it.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}
7661render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),t=this.getSubLabel();return le` 7662 <wui-flex 7663 data-error=${this.error} 7664 flexDirection="column" 7665 alignItems="center" 7666 .padding=${["3xl","xl","3xl","xl"]} 7667 gap="xl" 7668 > 7669 <wui-flex justifyContent="center" alignItems="center"> 7670 <wui-network-image 7671 size="lg" 7672 imageSrc=${Nt(Hr.getNetworkImage(this.network))} 7673 ></wui-network-image> 7674 7675 ${this.error?null:le`<wui-loading-hexagon></wui-loading-hexagon>`} 7676 7677 <wui-icon-box 7678 backgroundColor="error-100" 7679 background="opaque" 7680 iconColor="error-100" 7681 icon="close" 7682 size="sm" 7683 ?border=${!0} 7684 borderColor="wui-color-bg-125" 7685 ></wui-icon-box> 7686 </wui-flex> 7687 7688 <wui-flex flexDirection="column" alignItems="center" gap="xs"> 7689 <wui-text align="center" variant="paragraph-500" color="fg-100">${e}</wui-text> 7690 <wui-text align="center" variant="small-500" color="fg-200">${t}</wui-text> 7691 </wui-flex> 7692 7693 <wui-button 7694 data-retry=${this.showRetry} 7695 variant="accent" 7696 size="md" 7697 .disabled=${!this.error} 7698 @click=${this.onSwitchNetwork.bind(this)} 7699 > 7700 <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon> 7701 Try again 7702 </wui-button> 7703 </wui-flex> 7704 `}getSubLabel(){const e=Ge.getConnectorId(ue.state.activeChain);return Ge.getAuthConnector()&&e===Be.CONNECTOR_ID.AUTH?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var r;const e=Ge.getConnectorId(ue.state.activeChain);return Ge.getAuthConnector()&&e===Be.CONNECTOR_ID.AUTH?`Switching to ${((r=this.network)==null?void 0:r.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");t==null||t.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){var e;try{this.error=!1,ue.state.activeChain!==((e=this.network)==null?void 0:e.chainNamespace)&&ue.setIsSwitchingNamespace(!0),this.network&&await ue.switchActiveNetwork(this.network)}catch{this.error=!0}}};Dx.styles=J$e;oj([qe()],Dx.prototype,"showRetry",void 0);oj([qe()],Dx.prototype,"error",void 0);Dx=oj([ot("w3m-network-switch-view")],Dx);const eUe=Mt` 7705 button { 7706 column-gap: var(--wui-spacing-s); 7707 padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); 7708 width: 100%; 7709 transition: all var(--wui-ease-out-power-1) var(--wui-duration-md); 7710 border-radius: var(--wui-border-radius-xs); 7711 color: var(--wui-color-fg-100); 7712 } 7713 7714 button > wui-text:nth-child(2) { 7715 display: flex; 7716 flex: 1; 7717 } 7718 7719 button[data-transparent='true'] { 7720 pointer-events: none; 7721 background-color: transparent; 7722 } 7723 7724 button:hover { 7725 background-color: var(--wui-color-gray-glass-002); 7726 } 7727 7728 button:active { 7729 background-color: var(--wui-color-gray-glass-005); 7730 } 7731 7732 wui-image { 7733 width: var(--wui-spacing-3xl); 7734 height: var(--wui-spacing-3xl); 7735 border-radius: 100%; 7736 } 7737 7738 button:disabled { 7739 background-color: var(--wui-color-gray-glass-002); 7740 opacity: 0.5; 7741 cursor: not-allowed; 7742 } 7743 7744 button:disabled > wui-tag { 7745 background-color: var(--wui-color-gray-glass-010); 7746 color: var(--wui-color-fg-300); 7747 } 7748`;var wE=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let E0=class extends ut{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.selected=!1,this.transparent=!1}render(){return le` 7749 <button data-transparent=${this.transparent} ?disabled=${this.disabled}> 7750 <wui-flex gap="s" alignItems="center"> 7751 ${this.templateNetworkImage()} 7752 <wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text></wui-flex 7753 > 7754 ${this.checkmarkTemplate()} 7755 </button> 7756 `}checkmarkTemplate(){return this.selected?le`<wui-icon size="sm" color="accent-100" name="checkmarkBold"></wui-icon>`:null}templateNetworkImage(){return this.imageSrc?le`<wui-image size="sm" src=${this.imageSrc} name=${this.name}></wui-image>`:this.imageSrc?null:le`<wui-network-image 7757 ?round=${!0} 7758 size="md" 7759 name=${this.name} 7760 ></wui-network-image>`}};E0.styles=[Dn,Jr,eUe];wE([be()],E0.prototype,"imageSrc",void 0);wE([be()],E0.prototype,"name",void 0);wE([be({type:Boolean})],E0.prototype,"disabled",void 0);wE([be({type:Boolean})],E0.prototype,"selected",void 0);wE([be({type:Boolean})],E0.prototype,"transparent",void 0);E0=wE([ot("wui-list-network")],E0);const tUe=Mt` 7761 .container { 7762 max-height: 360px; 7763 overflow: auto; 7764 } 7765 7766 .container::-webkit-scrollbar {
7767 display: none; 7768 } 7769`;var b4=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let A0=class extends ut{constructor(){super(),this.unsubscribe=[],this.network=ue.state.activeCaipNetwork,this.requestedCaipNetworks=ue.getCaipNetworks(),this.search="",this.onDebouncedSearch=tt.debounce(e=>{this.search=e},100),this.unsubscribe.push(bo.subscribeNetworkImages(()=>this.requestUpdate()),ue.subscribeKey("activeCaipNetwork",e=>this.network=e),ue.subscribe(()=>{this.requestedCaipNetworks=ue.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return le` 7770 ${this.templateSearchInput()} 7771 <wui-flex 7772 class="container" 7773 .padding=${["0","s","s","s"]} 7774 flexDirection="column" 7775 gap="xs" 7776 > 7777 ${this.networksTemplate()} 7778 </wui-flex> 7779 7780 <wui-separator></wui-separator> 7781 7782 <wui-flex padding="s" flexDirection="column" gap="m" alignItems="center"> 7783 <wui-text variant="small-400" color="fg-300" align="center"> 7784 Your connected wallet may not support some of the networks available for this dApp 7785 </wui-text> 7786 <wui-link @click=${this.onNetworkHelp.bind(this)}> 7787 <wui-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wui-icon> 7788 What is a network 7789 </wui-link> 7790 </wui-flex> 7791 `}templateSearchInput(){return le` 7792 <wui-flex gap="xs" .padding=${["0","s","s","s"]}> 7793 <wui-input-text 7794 @inputChange=${this.onInputChange.bind(this)} 7795 class="network-search-input" 7796 size="md" 7797 placeholder="Search network" 7798 icon="search" 7799 ></wui-input-text> 7800 </wui-flex> 7801 `}onInputChange(e){this.onDebouncedSearch(e.detail)}onNetworkHelp(){xn.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),it.push("WhatIsANetwork")}networksTemplate(){var r;const e=ue.getAllApprovedCaipNetworkIds(),t=tt.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=t==null?void 0:t.filter(i=>{var s;return(s=i==null?void 0:i.name)==null?void 0:s.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=t,(r=this.filteredNetworks)==null?void 0:r.map(i=>{var s;return le` 7802 <wui-list-network 7803 .selected=${((s=this.network)==null?void 0:s.id)===i.id} 7804 imageSrc=${Nt(Hr.getNetworkImage(i))} 7805 type="network" 7806 name=${i.name??i.id} 7807 @click=${()=>this.onSwitchNetwork(i)} 7808 .disabled=${this.getNetworkDisabled(i)} 7809 data-testid=${`w3m-network-switch-${i.name??i.id}`} 7810 ></wui-list-network> 7811 `})}getNetworkDisabled(e){const t=e.chainNamespace,r=_t.getCaipAddress(t),i=ue.getAllApprovedCaipNetworkIds(),s=ue.getNetworkProp("supportsAllNetworks",t)!==!1,o=Ge.getConnectorId(t),a=Ge.getAuthConnector(),c=o===Be.CONNECTOR_ID.AUTH&&a;return!r||s||c?!1:!(i!=null&&i.includes(e.caipNetworkId))}onSwitchNetwork(e){uJ.onSwitchNetwork({network:e})}};A0.styles=tUe;b4([qe()],A0.prototype,"network",void 0);b4([qe()],A0.prototype,"requestedCaipNetworks",void 0);b4([qe()],A0.prototype,"filteredNetworks",void 0);b4([qe()],A0.prototype,"search",void 0);A0=b4([ot("w3m-networks-view")],A0);const nUe=Mt` 7812 @keyframes shake { 7813 0% { 7814 transform: translateX(0); 7815 } 7816 25% { 7817 transform: translateX(3px); 7818 } 7819 50% { 7820 transform: translateX(-3px); 7821 } 7822 75% { 7823 transform: translateX(3px); 7824 } 7825 100% { 7826 transform: translateX(0); 7827 } 7828 } 7829 7830 wui-flex:first-child:not(:only-child) { 7831 position: relative; 7832 } 7833 7834 wui-loading-thumbnail { 7835 position: absolute; 7836 } 7837 7838 wui-visual { 7839 width: var(--wui-wallet-image-size-lg); 7840 height: var(--wui-wallet-image-size-lg); 7841 border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); 7842 position: relative; 7843 overflow: hidden; 7844 } 7845
7846 wui-visual::after { 7847 content: ''; 7848 display: block; 7849 width: 100%; 7850 height: 100%; 7851 position: absolute; 7852 inset: 0; 7853 border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); 7854 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 7855 } 7856 7857 wui-icon-box { 7858 position: absolute; 7859 right: calc(var(--wui-spacing-3xs) * -1); 7860 bottom: calc(var(--wui-spacing-3xs) * -1); 7861 opacity: 0; 7862 transform: scale(0.5); 7863 transition: 7864 opacity var(--wui-ease-out-power-2) var(--wui-duration-lg), 7865 transform var(--wui-ease-out-power-2) var(--wui-duration-lg); 7866 will-change: opacity, transform; 7867 } 7868 7869 wui-text[align='center'] { 7870 width: 100%; 7871 padding: 0px var(--wui-spacing-l); 7872 } 7873 7874 [data-error='true'] wui-icon-box { 7875 opacity: 1; 7876 transform: scale(1); 7877 } 7878 7879 [data-error='true'] > wui-flex:first-child { 7880 animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; 7881 } 7882 7883 [data-retry='false'] wui-link { 7884 display: none; 7885 } 7886 7887 [data-retry='true'] wui-link { 7888 display: block; 7889 opacity: 1; 7890 } 7891 7892 wui-link { 7893 padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); 7894 } 7895 7896 .capitalize { 7897 text-transform: capitalize; 7898 } 7899`;var Lse=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const rUe={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0};let fC=class extends ut{constructor(){var e,t;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=it.state.data)==null?void 0:e.switchToChain,this.caipNetwork=(t=it.state.data)==null?void 0:t.network,this.activeChain=ue.state.activeChain}firstUpdated(){this.unsubscribe.push(ue.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?Be.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const t=Be.CHAIN_NAME_MAP[this.switchToChain];return le` 7900 <wui-flex 7901 flexDirection="column" 7902 alignItems="center" 7903 .padding=${["3xl","xl","xl","xl"]} 7904 gap="xl" 7905 > 7906 <wui-flex justifyContent="center" flexDirection="column" alignItems="center" gap="xl"> 7907 <wui-visual name=${Nt(rUe[this.switchToChain])}></wui-visual> 7908 <wui-text 7909 data-testid=${`w3m-switch-active-chain-to-${t}`} 7910 variant="paragraph-500" 7911 color="fg-100" 7912 align="center" 7913 >Switch to <span class="capitalize">${t}</span></wui-text 7914 > 7915 <wui-text variant="small-400" color="fg-200" align="center"> 7916 Connected wallet doesn't support connecting to ${e} chain. You 7917 need to connect with a different wallet. 7918 </wui-text> 7919 <wui-button 7920 data-testid="w3m-switch-active-chain-button" 7921 size="md" 7922 @click=${this.switchActiveChain.bind(this)} 7923 >Switch</wui-button 7924 > 7925 </wui-flex> 7926 </wui-flex> 7927 `}async switchActiveChain(){this.switchToChain&&(ue.setIsSwitchingNamespace(!0),Ge.setFilterByNamespace(this.switchToChain),this.caipNetwork?await ue.switchActiveNetwork(this.caipNetwork):ue.setActiveNamespace(this.switchToChain),it.reset("Connect"))}};fC.styles=nUe;Lse([be()],fC.prototype,"activeChain",void 0);fC=Lse([ot("w3m-switch-active-chain-view")],fC);var iUe=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};const sUe=[{images:["network","layers","system"],title:"The systemâs nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let VB=class extends ut{render(){return le` 7928 <wui-flex 7929 flexDirection="column" 7930 .padding=${["xxl","xl","xl","xl"]} 7931 alignItems="center" 7932 gap="xl" 7933 > 7934 <w3m-help-widget .data=${sUe}></w3m-help-widget> 7935 <wui-button 7936 variant="main" 7937 size="md" 7938 @click=${()=>{tt.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} 7939 > 7940 Learn more 7941 <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon> 7942 </wui-button>
7942 7943 </wui-flex> 7944 `}};VB=iUe([ot("w3m-what-is-a-network-view")],VB);const oUe=Mt` 7945 :host > wui-flex { 7946 max-height: clamp(360px, 540px, 80vh); 7947 overflow: scroll; 7948 scrollbar-width: none; 7949 } 7950 7951 :host > wui-flex::-webkit-scrollbar { 7952 display: none; 7953 } 7954`;var aj=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Bx=class extends ut{constructor(){var e;super(),this.swapUnsupportedChain=(e=it.state.data)==null?void 0:e.swapUnsupportedChain,this.unsubscribe=[],this.disconnecting=!1,this.remoteFeatures=Ue.state.remoteFeatures,this.unsubscribe.push(bo.subscribeNetworkImages(()=>this.requestUpdate()),Ue.subscribeKey("remoteFeatures",t=>{this.remoteFeatures=t}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return le` 7955 <wui-flex class="container" flexDirection="column" gap="0"> 7956 <wui-flex 7957 class="container" 7958 flexDirection="column" 7959 .padding=${["m","xl","xs","xl"]} 7960 alignItems="center" 7961 gap="xl" 7962 > 7963 ${this.descriptionTemplate()} 7964 </wui-flex> 7965 7966 <wui-flex flexDirection="column" padding="s" gap="xs"> 7967 ${this.networksTemplate()} 7968 </wui-flex> 7969 7970 <wui-separator text="or"></wui-separator> 7971 <wui-flex flexDirection="column" padding="s" gap="xs"> 7972 <wui-list-item 7973 variant="icon" 7974 iconVariant="overlay" 7975 icon="disconnect" 7976 ?chevron=${!1} 7977 .loading=${this.disconnecting} 7978 @click=${this.onDisconnect.bind(this)} 7979 data-testid="disconnect-button" 7980 > 7981 <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text> 7982 </wui-list-item> 7983 </wui-flex> 7984 </wui-flex> 7985 `}descriptionTemplate(){return this.swapUnsupportedChain?le` 7986 <wui-text variant="small-400" color="fg-200" align="center"> 7987 The swap feature doesnât support your current network. Switch to an available option to 7988 continue. 7989 </wui-text> 7990 `:le` 7991 <wui-text variant="small-400" color="fg-200" align="center"> 7992 This app doesnât support your current network. Switch to an available option to continue. 7993 </wui-text> 7994 `}networksTemplate(){const e=ue.getAllRequestedCaipNetworks(),t=ue.getAllApprovedCaipNetworkIds(),r=tt.sortRequestedNetworks(t,e);return(this.swapUnsupportedChain?r.filter(s=>sr.SWAP_SUPPORTED_NETWORKS.includes(s.caipNetworkId)):r).map(s=>le` 7995 <wui-list-network 7996 imageSrc=${Nt(Hr.getNetworkImage(s))} 7997 name=${s.name??"Unknown"} 7998 @click=${()=>this.onSwitchNetwork(s)} 7999 > 8000 </wui-list-network> 8001 `)}async onDisconnect(){var e;try{this.disconnecting=!0;const t=ue.state.activeChain,i=nt.getConnections(t).length>0,s=t&&Ge.state.activeConnectorIds[t],o=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await nt.disconnect(o?{id:s,namespace:t}:{}),i&&o&&(it.push("ProfileWallets"),Ir.showSuccess("Wallet deleted"))}catch{xn.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Ir.showError("Failed to disconnect")}finally{this.disconnecting=!1}}async onSwitchNetwork(e){const t=_t.state.caipAddress,r=ue.getAllApprovedCaipNetworkIds(),i=ue.getNetworkProp("supportsAllNetworks",e.chainNamespace),s=it.state.data;t?r!=null&&r.includes(e.caipNetworkId)?await ue.switchActiveNetwork(e):i?it.push("SwitchNetwork",{...s,network:e}):it.push("SwitchNetwork",{...s,network:e}):t||(ue.setActiveCaipNetwork(e),it.push("Connect"))}};Bx.styles=oUe;aj([qe()],Bx.prototype,"disconnecting",void 0);aj([qe()],Bx.prototype,"remoteFeatures",void 0);Bx=aj([ot("w3m-unsupported-chain-view")],Bx);const aUe=Mt` 8002 wui-flex { 8003 width: 100%; 8004 background-color: var(--wui-color-gray-glass-005); 8005 border-radius: var(--wui-border-radius-s); 8006 padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) 8007 var(--wui-spacing-1xs); 8008 } 8009`;var cj=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let pC=class extends ut{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return le` 8010 <wui-flex gap="1xs" alignItems="center"> 8011 <wui-icon-box 8012 size="sm" 8013 iconcolor="fg-200" 8014 backgroundcolor="fg-200" 8015 icon=${this.icon} 8016 background="transparent" 8017 ></wui-icon-box> 8018 <wui-text variant="small-400" color="fg-200">${this.text}</wui-text> 8019 </wui-flex> 8020 `}};pC.styles=[Dn,Jr,aUe];cj([be()],pC.prototype,"icon",void 0);cj([be()],pC.prototype,"text",void 0);pC=cj([ot("wui-banner")],pC);const cUe=Mt` 8021 :host > wui-flex { 8022 max-height: clamp(360px, 540px, 80vh); 8023 overflow: scroll; 8024 scrollbar-width: none; 8025 } 8026 8027 :host > wui-flex::-webkit-scrollbar {
8028 display: none; 8029 } 8030`;var lUe=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let s8=class extends ut{constructor(){super(),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return le` <wui-flex 8031 flexDirection="column" 8032 .padding=${["xs","s","m","s"]} 8033 gap="xs" 8034 > 8035 <wui-banner 8036 icon="warningCircle" 8037 text="You can only receive assets on these networks" 8038 ></wui-banner> 8039 ${this.networkTemplate()} 8040 </wui-flex>`}networkTemplate(){const e=ue.getAllRequestedCaipNetworks(),t=ue.getAllApprovedCaipNetworkIds(),r=ue.state.activeCaipNetwork,i=ue.checkIfSmartAccountEnabled();let s=tt.sortRequestedNetworks(t,e);if(i&&Xs(r==null?void 0:r.chainNamespace)===fi.ACCOUNT_TYPES.SMART_ACCOUNT){if(!r)return null;s=[r]}return s.filter(a=>a.chainNamespace===(r==null?void 0:r.chainNamespace)).map(a=>le` 8041 <wui-list-network 8042 imageSrc=${Nt(Hr.getNetworkImage(a))} 8043 name=${a.name??"Unknown"} 8044 ?transparent=${!0} 8045 > 8046 </wui-list-network> 8047 `)}};s8.styles=cUe;s8=lUe([ot("w3m-wallet-compatible-networks-view")],s8);const uUe=Mt` 8048 :host { 8049 display: flex; 8050 justify-content: center; 8051 align-items: center; 8052 width: var(--wui-icon-box-size-xl); 8053 height: var(--wui-icon-box-size-xl); 8054 box-shadow: 0 0 0 8px var(--wui-thumbnail-border); 8055 border-radius: var(--local-border-radius); 8056 overflow: hidden; 8057 } 8058 8059 wui-icon { 8060 width: 32px; 8061 height: 32px; 8062 } 8063`;var jR=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let Lx=class extends ut{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"}; background-color: var(--wui-color-modal-bg);`,le`${this.templateVisual()}`}templateVisual(){return this.imageSrc?le`<wui-image src=${this.imageSrc} alt=${this.alt??""}></wui-image>`:le`<wui-icon 8064 data-parent-size="md" 8065 size="inherit" 8066 color="inherit" 8067 name="walletPlaceholder" 8068 ></wui-icon>`}};Lx.styles=[Dn,uUe];jR([be()],Lx.prototype,"imageSrc",void 0);jR([be()],Lx.prototype,"alt",void 0);jR([be({type:Boolean})],Lx.prototype,"borderRadiusFull",void 0);Lx=jR([ot("wui-visual-thumbnail")],Lx);const dUe=Mt` 8069 :host { 8070 display: flex; 8071 justify-content: center; 8072 gap: var(--wui-spacing-2xl); 8073 } 8074 8075 wui-visual-thumbnail:nth-child(1) { 8076 z-index: 1; 8077 } 8078`;var hUe=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let qB=class extends ut{constructor(){var e,t;super(...arguments),this.dappImageUrl=(e=Ue.state.metadata)==null?void 0:e.icons,this.walletImageUrl=(t=_t.state.connectedWalletInfo)==null?void 0:t.icon}firstUpdated(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelectorAll("wui-visual-thumbnail");e!=null&&e[0]&&this.createAnimation(e[0],"translate(18px)"),e!=null&&e[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){var e;return le` 8079 <wui-visual-thumbnail 8080 ?borderRadiusFull=${!0} 8081 .imageSrc=${(e=this.dappImageUrl)==null?void 0:e[0]} 8082 ></wui-visual-thumbnail> 8083 <wui-visual-thumbnail .imageSrc=${this.walletImageUrl}></wui-visual-thumbnail> 8084 `}createAnimation(e,t){e.animate([{transform:"translateX(0px)"},{transform:t}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};qB.styles=dUe;qB=hUe([ot("w3m-siwx-sign-message-thumbnails")],qB);var lj=function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};let gC=class extends ut{constructor(){var e;super(...arguments),this.dappName=(e=Ue.state.metadata)==null?void 0:e.name,this.isCancelling=!1,this.isSigning=!1}render(){return le` 8085 <wui-flex justifyContent="center" .padding=${["2xl","0","xxl","0"]}> 8086 <w3m-siwx-sign-message-thumbnails></w3m-siwx-sign-message-thumbnails> 8087 </wui-flex> 8088 <wui-flex 8089 .padding=${["0","4xl","l","4xl"]} 8090 gap="s" 8091 justifyContent="space-between" 8092 > 8093 <wui-text variant="paragraph-500" align="center" color="fg-100" 8094 >${this.dappName??"Dapp"} needs to connect to your wallet</wui-text 8095 > 8096 </wui-flex> 8097 <wui-flex 8098 .padding=${["0","3xl","l","3xl"]} 8099 gap="s" 8100 justifyContent="space-between" 8101 > 8102 <wui-text variant="small-400" align="center" color="fg-200" 8103 >Sign this message to prove you own this wallet and proceed. Canceling will disconnect 8104 you.</wui-text 8105 > 8106 </wui-flex> 8107 <wui-flex .padding=${["l","xl","xl","xl"]}
8107 gap="s" justifyContent="space-between"> 8108 <wui-button 8109 size="lg" 8110 borderRadius="xs" 8111 fullWidth 8112 variant="neutral" 8113 ?loading=${this.isCancelling} 8114 @click=${this.onCancel.bind(this)} 8115 data-testid="w3m-connecting-siwe-cancel" 8116 > 8117 ${this.isCancelling?"Cancelling...":"Cancel"} 8118 </wui-button> 8119 <wui-button 8120 size="lg" 8121 borderRadius="xs" 8122 fullWidth 8123 variant="main" 8124 @click=${this.onSign.bind(this)} 8125 ?loading=${this.isSigning} 8126 data-testid="w3m-connecting-siwe-sign" 8127 > 8128 ${this.isSigning?"Signing...":"Sign"} 8129 </wui-button> 8130 </wui-flex> 8131 `}async onSign(){this.isSigning=!0;try{await al.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){Ir.showError({message:"Something went wrong. We need to verify your account again."}),it.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await al.cancelSignMessage().finally(()=>this.isCancelling=!1)}};lj([qe()],gC.prototype,"isCancelling",void 0);lj([qe()],gC.prototype,"isSigning",void 0);gC=lj([ot("w3m-siwx-sign-message-view")],gC);const fUe=Object.freeze(Object.defineProperty({__proto__:null,get AppKitAccountButton(){return LN},get AppKitButton(){return $N},get AppKitConnectButton(){return UN},get AppKitNetworkButton(){return jN},get W3mAccountButton(){return _B},get W3mAccountSettingsView(){return Yu},get W3mAccountView(){return zN},get W3mAllWalletsView(){return tC},get W3mButton(){return CB},get W3mChooseAccountNameView(){return uC},get W3mConnectButton(){return TB},get W3mConnectView(){return Tc},get W3mConnectWalletsView(){return hC},get W3mConnectingExternalView(){return LB},get W3mConnectingMultiChainView(){return lC},get W3mConnectingWcBasicView(){return i8},get W3mConnectingWcView(){return M1},get W3mDownloadsView(){return jB},get W3mGetWalletView(){return zB},get W3mNetworkButton(){return IB},get W3mNetworkSwitchView(){return Dx},get W3mNetworksView(){return A0},get W3mProfileWalletsView(){return da},get W3mRouter(){return Tx},get W3mSIWXSignMessageView(){return gC},get W3mSwitchActiveChainView(){return fC},get W3mUnsupportedChainView(){return Bx},get W3mWalletCompatibleNetworksView(){return s8},get W3mWhatIsANetworkView(){return VB},get W3mWhatIsAWalletView(){return WB}},Symbol.toStringTag,{value:"Module"}));_R({tagName:"appkit-button",elementClass:$N,react:Qn});_R({tagName:"appkit-network-button",elementClass:jN,react:Qn});_R({tagName:"appkit-connect-button",elementClass:UN,react:Qn});_R({tagName:"appkit-account-button",elementClass:LN,react:Qn});function pUe(){var m,w,y,b,E,T;const[n,e]=X.useState(null),[t,r]=X.useState(null),[i,s]=X.useState(null),[o,a]=X.useState([]),[c,u]=X.useState(!1);X.useEffect(()=>{var L;const N=async U=>{var K;u(!0),console.log("Connect event data:",U);try{if((K=U.namespaces)!=null&&K.solana){const Y=U.namespaces.solana.accounts[0].address;e(Y);const k=U.provider||U.namespaces.solana.provider,j=d(k);s(j),j&&!o.includes(j)&&a(V=>[...V,j]);try{const V=new mR("https://solana-mainnet.g.alchemy.com/v2/EOwdJCIiGmdlRugnRg_o3yMnqjz3nqBS"),W=new bt(Y),$=await V.getBalance(W);r($/1e9)}catch(V){console.error("Error fetching balance:",V),r(null)}}}finally{u(!1)}},I=()=>{e(null),r(null),s(null)},H=async()=>{var U;if((U=window.solflare)!=null&&U.isSolflare&&!n){console.log("Solflare detected via window.solflare, attempting manual connect");try{await window.solflare.connect();const K=window.solflare.publicKey.toString();e(K),s("solflare"),a(Y=>Y.includes("solflare")?Y:[...Y,"solflare"])}catch(K){console.error("Solflare manual connect failed:",K)}}};if(Du&&typeof Du.on=="function"){Du.on("connect",N),Du.on("disconnect",I);const U=(L=Du.getCaipAddress())==null?void 0:L.split(":")[2];return U&&N({namespaces:{solana:{accounts:[{address:U}]}}}),H(),()=>{typeof Du.off=="function"&&(Du.off("connect",N),Du.off("disconnect",I))}}else console.warn("appKit is not properly initialized")},[o]);const d=N=>{var H,L;if(!N)return"unknown";const I=Object.keys(rf);for(const U of I)if((H=N==null?void 0:N.name)!=null&&H.toLowerCase().includes(U.toLowerCase())||(L=N==null?void 0:N.url)!=null&&L.includes(U.toLowerCase()))return U;return"unknown"},f=async()=>{var N;try{u(!0),await Du.open({view:"Connect",namespace:"solana"})}
8131catch(I){if(console.error("Connect failed:",I),(N=window.solflare)!=null&&N.isSolflare){console.log("Retrying with Solflare manual connect");try{await window.solflare.connect();const H=window.solflare.publicKey.toString();e(H),s("solflare")}catch(H){console.error("Solflare retry failed:",H)}}}finally{u(!1)}};return S.jsxs("div",{className:"reown-connector-container",children:[S.jsxs("div",{className:"reown-button-container",children:[S.jsx("div",{className:"reown-button-glow"}),S.jsx("div",{className:"reown-button-wrapper",children:Du?S.jsx("div",{className:"reown-button-inner",children:S.jsx("button",{className:"reown-appkit-button",onClick:f,disabled:c,children:c?S.jsxs("div",{className:"reown-loading-state",children:[S.jsx("div",{className:"reown-spinner"}),"Connecting..."]}):n?S.jsxs("div",{className:"reown-connected-state",children:[S.jsx("div",{className:"reown-wallet-icon-container",children:i?S.jsx("img",{src:((m=rf[i])==null?void 0:m.icon)||"/logos/reown-logo.png",alt:((w=rf[i])==null?void 0:w.name)||"Wallet",className:"reown-wallet-icon"}):S.jsx("img",{src:"/logos/reown-logo.png",alt:"Reown",className:"reown-wallet-icon"})}),S.jsx("span",{children:"Connected"}),S.jsx("svg",{className:"reown-connected-icon",viewBox:"0 0 20 20",fill:"currentColor",children:S.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})]}):S.jsxs("div",{className:"reown-disconnected-state",children:[S.jsx("img",{src:"/logos/reown-logo.png",alt:"Reown",className:"reown-connect-logo"}),S.jsx("span",{children:"Connect with Reown"})]})})}):S.jsx("button",{className:"reown-disabled-button",disabled:!0,children:"Wallet Connect Not Available"})})]}),n&&S.jsxs("div",{className:"reown-status-card",children:[S.jsxs("div",{className:"reown-status-row",children:[S.jsx("h3",{className:"reown-status-label",children:"Connected Wallet"}),S.jsxs("div",{className:"reown-wallet-info",children:[i&&((y=rf[i])==null?void 0:y.icon)&&S.jsx("img",{src:(b=rf[i])==null?void 0:b.icon,alt:(E=rf[i])==null?void 0:E.name,className:"reown-wallet-icon-sm"}),S.jsx("span",{className:"reown-status-value",children:((T=rf[i])==null?void 0:T.name)||i||"Unknown"})]})]}),S.jsxs("div",{className:"reown-status-row",children:[S.jsx("h3",{className:"reown-status-label",children:"Address"}),S.jsx("span",{className:"reown-address-value",children:`${n.slice(0,6)}...${n.slice(-4)}`})]}),t!==null&&S.jsxs("div",{className:"reown-status-row",children:[S.jsx("h3",{className:"reown-status-label",children:"Balance"}),S.jsxs("span",{className:"reown-status-value",children:[t.toFixed(4)," SOL"]})]})]}),o.length>0&&S.jsxs("div",{className:"reown-wallets-card",children:[S.jsx("h3",{className:"reown-wallets-title",children:"Detected Wallets"}),S.jsx("div",{className:"reown-wallets-list",children:o.map(N=>{var I,H,L;return S.jsxs("div",{className:"reown-wallet-item",children:[S.jsx("img",{src:(I=rf[N])==null?void 0:I.icon,alt:(H=rf[N])==null?void 0:H.name,className:"reown-wallet-icon"}),S.jsx("span",{className:"reown-wallet-name",children:((L=rf[N])==null?void 0:L.name)||N})]},N)})})]})]})}let gUe={data:""},mUe=n=>typeof window=="object"?((n?n.querySelector("#_goober"):window._goober)||Object.assign((n||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:n||gUe,wUe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,yUe=/\/\*[^]*?\*\/| +/g,yG=/\n+/g,Xm=(n,e)=>{let t="",r="",i="";for(let s in n){let o=n[s];s[0]=="@"?s[1]=="i"?t=s+" "+o+";":r+=s[1]=="f"?Xm(o,s):s+"{"+Xm(o,s[1]=="k"?"":e)+"}":typeof o=="object"?r+=Xm(o,e?e.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Xm.p?Xm.p(s,o):s+":"+o+";")}return t+(e&&i?e+"{"+i+"}":i)+r},$p={},$se=n=>{if(typeof n=="object"){let e="";for(let t in n)e+=t+$se(n[t]);return e}return n},bUe=(n,e,t,r,i)=>{let s=$se(n),o=$p[s]||($p[s]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(s));if(!$p[o]){let c=s!==n?n:(u=>{let d,f,m=[{}];for(;d=wUe.exec(u.replace(yUe,""));)d[4]?m.shift():d[3]?(f=d[3].replace(yG," ").trim(),m.unshift(m[0][f]=m[0][f]||{})):m[0][d[1]]=d[2].replace(yG," ").trim();return m[0]})(n);$p[o]=Xm(i?{["@keyframes "+o]:c}:c,t?"":"."+o)}let a=t&&$p.g?$p.g:null;return t&&($p.g=$p[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)})($p[o],e,r,a),o},vUe=(n,e,t)=>n.reduce((r,i,s)=>{let o=e[s];if(o&&o.call){let a=o(t),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=c?"."+c:a&&typeof a=="object"?a.props?"":Xm(a,""):a===!1?"":a}return r+i+(o??"")},"");function zR(n){let e=this||{},t=n.call?n(e.p):n;
8131return bUe(t.unshift?t.raw?vUe(t,[].slice.call(arguments,1),e.p):t.reduce((r,i)=>Object.assign(r,i&&i.call?i(e.p):i),{}):t,mUe(e.target),e.g,e.o,e.k)}let Use,KB,YB;zR.bind({g:1});let vg=zR.bind({k:1});function xUe(n,e,t,r){Xm.p=e,Use=n,KB=t,YB=r}function B0(n,e){let t=this||{};return function(){let r=arguments;function i(s,o){let a=Object.assign({},s),c=a.className||i.className;t.p=Object.assign({theme:KB&&KB()},a),t.o=/ *go\d+/.test(c),a.className=zR.apply(t,r)+(c?" "+c:"");let u=n;return n[0]&&(u=a.as||n,delete a.as),YB&&u[0]&&YB(a),Use(u,a)}return i}}var EUe=n=>typeof n=="function",o8=(n,e)=>EUe(n)?n(e):n,AUe=(()=>{let n=0;return()=>(++n).toString()})(),jse=(()=>{let n;return()=>{if(n===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");n=!e||e.matches}return n}})(),SUe=20,zse=(n,e)=>{switch(e.type){case 0:return{...n,toasts:[e.toast,...n.toasts].slice(0,SUe)};case 1:return{...n,toasts:n.toasts.map(s=>s.id===e.toast.id?{...s,...e.toast}:s)};case 2:let{toast:t}=e;return zse(n,{type:n.toasts.find(s=>s.id===t.id)?1:0,toast:t});case 3:let{toastId:r}=e;return{...n,toasts:n.toasts.map(s=>
8131s.id===r||r===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(s=>s.id!==e.toastId)};case 5:return{...n,pausedAt:e.time};case 6:let i=e.time-(n.pausedAt||0);return{...n,pausedAt:void 0,toasts:n.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},R6=[],zy={toasts:[],pausedAt:void 0},fb=n=>{zy=zse(zy,n),R6.forEach(e=>{e(zy)})},_Ue={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},CUe=(n={})=>{let[e,t]=X.useState(zy),r=X.useRef(zy);X.useEffect(()=>(r.current!==zy&&t(zy),R6.push(t),()=>{let s=R6.indexOf(t);s>-1&&R6.splice(s,1)}),[]);let i=e.toasts.map(s=>{var o,a,c;return{...n,...n[s.type],...s,removeDelay:s.removeDelay||((o=n[s.type])==null?void 0:o.removeDelay)||(n==null?void 0:n.removeDelay),duration:s.duration||((a=n[s.type])==null?void 0:a.duration)||(n==null?void 0:n.duration)||_Ue[s.type],style:{...n.style,...(c=n[s.type])==null?void 0:c.style,...s.style}}});return{...e,toasts:i}},TUe=(n,e="blank",t)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:e,ariaProps:{role:"status","aria-live":"polite"},message:n,pauseDuration:0,...t,id:(t==null?void 0:t.id)||AUe()}),v4=n=>(e,t)=>{let r=TUe(e,n,t);return fb({type:2,toast:r}),r.id},Va=(n,e)=>v4("blank")(n,e);Va.error=v4("error");Va.success=v4("success");Va.loading=v4("loading");Va.custom=v4("custom");Va.dismiss=n=>{fb({type:3,toastId:n})};Va.remove=n=>fb({type:4,toastId:n});Va.promise=(n,e,t)=>{let r=Va.loading(e.loading,{...t,...t==null?void 0:t.loading});return typeof n=="function"&&(n=n()),n.then(i=>{let s=e.success?o8(e.success,i):void 0;return s?Va.success(s,{id:r,...t,...t==null?void 0:t.success}):Va.dismiss(r),i}).catch(i=>{let s=e.error?o8(e.error,i):void 0;s?Va.error(s,{id:r,...t,...t==null?void 0:t.error}):Va.dismiss(r)}),n};var IUe=(n,e)=>{fb({type:1,toast:{id:n,height:e}})},NUe=()=>{fb({type:5,time:Date.now()})},LS=new Map,RUe=1e3,MUe=(n,e=RUe)=>{if(LS.has(n))return;let t=setTimeout(()=>{LS.delete(n),fb({type:4,toastId:n})},e);LS.set(n,t)},kUe=n=>{let{toasts:e,pausedAt:t}=CUe(n);X.useEffect(()=>{if(t)return;let s=Date.now(),o=e.map(a=>{if(a.duration===1/0)return;let c=(a.duration||0)+a.pauseDuration-(s-a.createdAt);if(c<0){a.visible&&Va.dismiss(a.id);return}return setTimeout(()=>Va.dismiss(a.id),c)});return()=>{o.forEach(a=>a&&clearTimeout(a))}},[e,t]);let r=X.useCallback(()=>{t&&fb({type:6,time:Date.now()})},[t]),i=X.useCallback((s,o)=>{let{reverseOrder:a=!1,gutter:c=8,defaultPosition:u}=o||{},d=e.filter(w=>(w.position||u)===(s.position||u)&&w.height),f=d.findIndex(w=>w.id===s.id),m=d.filter((w,y)=>y<f&&w.visible).length;return d.filter(w=>w.visible).slice(...a?[m+1]:[0,m]).reduce((w,y)=>w+(y.height||0)+c,0)},[e]);return X.useEffect(()=>{e.forEach(s=>{if(s.dismissed)MUe(s.id,s.removeDelay);else{let o=LS.get(s.id);o&&(clearTimeout(o),LS.delete(s.id))}})},[e]),{toasts:e,handlers:{updateHeight:IUe,startPause:NUe,endPause:r,calculateOffset:i}}},OUe=vg` 8132from { 8133 transform: scale(0) rotate(45deg); 8134 opacity: 0; 8135} 8136to { 8137 transform: scale(1) rotate(45deg); 8138 opacity: 1; 8139}`,PUe=vg` 8140from { 8141 transform: scale(0); 8142 opacity: 0; 8143} 8144to { 8145 transform: scale(1); 8146 opacity: 1; 8147}`,DUe=vg` 8148from { 8149 transform: scale(0) rotate(90deg); 8150 opacity: 0; 8151} 8152to { 8153 transform: scale(1) rotate(90deg); 8154 opacity: 1; 8155}`,BUe=B0("div")` 8156 width: 20px; 8157 opacity: 0; 8158 height: 20px; 8159 border-radius: 10px; 8160 background: ${n=>n.primary||"#ff4b4b"}; 8161 position: relative; 8162 transform: rotate(45deg); 8163 8164 animation: ${OUe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 8165 forwards; 8166 animation-delay: 100ms; 8167 8168 &:after, 8169 &:before { 8170 content: ''; 8171 animation: ${PUe} 0.15s ease-out forwards; 8172 animation-delay: 150ms; 8173 position: absolute; 8174 border-radius: 3px; 8175 opacity: 0; 8176 background: ${n=>n.secondary||"#fff"}; 8177 bottom: 9px; 8178 left: 4px; 8179 height: 2px; 8180 width: 12px; 8181 } 8182 8183 &:before { 8184 animation: ${DUe} 0.15s ease-out forwards; 8185 animation-delay: 180ms; 8186 transform: rotate(90deg); 8187 } 8188`,LUe=vg` 8189 from { 8190 transform: rotate(0deg); 8191 } 8192 to { 8193 transform: rotate(360deg); 8194 } 8195`,$Ue=B0("div")` 8196 width: 12px; 8197 height: 12px; 8198 box-sizing: border-box; 8199 border: 2px solid; 8200 border-radius: 100%; 8201 border-color: ${n=>n.secondary||"#e0e0e0"}; 8202 border-right-color: ${n=>n.primary||"#616161"}; 8203 animation: ${LUe} 1s linear infinite; 8204`,UUe=vg` 8205from { 8206 transform: scale(0) rotate(45deg); 8207 opacity: 0; 8208} 8209to { 8210 transform: scale(1) rotate(45deg); 8211 opacity: 1; 8212}`,jUe=vg` 82130% { 8214 height: 0; 8215 width: 0; 8216 opacity: 0; 8217} 821840% { 8219 height: 0; 8220 width: 6px; 8221 opacity: 1; 8222} 8223100% { 8224 opacity: 1; 8225 height: 10px; 8226}`,zUe=B0("div")`
8227 width: 20px; 8228 opacity: 0; 8229 height: 20px; 8230 border-radius: 10px; 8231 background: ${n=>n.primary||"#61d345"}; 8232 position: relative; 8233 transform: rotate(45deg); 8234 8235 animation: ${UUe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 8236 forwards; 8237 animation-delay: 100ms; 8238 &:after { 8239 content: ''; 8240 box-sizing: border-box; 8241 animation: ${jUe} 0.2s ease-out forwards; 8242 opacity: 0; 8243 animation-delay: 200ms; 8244 position: absolute; 8245 border-right: 2px solid; 8246 border-bottom: 2px solid; 8247 border-color: ${n=>n.secondary||"#fff"}; 8248 bottom: 6px; 8249 left: 6px; 8250 height: 10px; 8251 width: 6px; 8252 } 8253`,FUe=B0("div")` 8254 position: absolute; 8255`,WUe=B0("div")` 8256 position: relative; 8257 display: flex; 8258 justify-content: center; 8259 align-items: center; 8260 min-width: 20px; 8261 min-height: 20px; 8262`,HUe=vg` 8263from { 8264 transform: scale(0.6); 8265 opacity: 0.4; 8266} 8267to { 8268 transform: scale(1); 8269 opacity: 1; 8270}`,VUe=B0("div")` 8271 position: relative; 8272 transform: scale(0.6); 8273 opacity: 0.4; 8274 min-width: 20px; 8275 animation: ${HUe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) 8276 forwards; 8277`,qUe=({toast:n})=>{let{icon:e,type:t,iconTheme:r}=n;return e!==void 0?typeof e=="string"?X.createElement(VUe,null,e):e:t==="blank"?null:X.createElement(WUe,null,X.createElement($Ue,{...r}),t!=="loading"&&X.createElement(FUe,null,t==="error"?X.createElement(BUe,{...r}):X.createElement(zUe,{...r})))},KUe=n=>` 82780% {transform: translate3d(0,${n*-200}%,0) scale(.6); opacity:.5;} 8279100% {transform: translate3d(0,0,0) scale(1); opacity:1;} 8280`,YUe=n=>` 82810% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 8282100% {transform: translate3d(0,${n*-150}%,-1px) scale(.6); opacity:0;} 8283`,GUe="0%{opacity:0;} 100%{opacity:1;}",ZUe="0%{opacity:1;} 100%{opacity:0;}",QUe=B0("div")` 8284 display: flex; 8285 align-items: center; 8286 background: #fff; 8287 color: #363636; 8288 line-height: 1.3; 8289 will-change: transform; 8290 box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); 8291 max-width: 350px; 8292 pointer-events: auto; 8293 padding: 8px 10px; 8294 border-radius: 8px; 8295`,XUe=B0("div")` 8296 display: flex; 8297 justify-content: center; 8298 margin: 4px 10px; 8299 color: inherit; 8300 flex: 1 1 auto; 8301 white-space: pre-line; 8302`,JUe=(n,e)=>{let t=n.includes("top")?1:-1,[r,i]=jse()?[GUe,ZUe]:[KUe(t),YUe(t)];return{animation:e?`${vg(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${vg(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},eje=X.memo(({toast:n,position:e,style:t,children:r})=>{let i=n.height?JUe(n.position||e||"top-center",n.visible):{opacity:0},s=X.createElement(qUe,{toast:n}),o=X.createElement(XUe,{...n.ariaProps},o8(n.message,n));return X.createElement(QUe,{className:n.className,style:{...i,...t,...n.style}},typeof r=="function"?r({icon:s,message:o}):X.createElement(X.Fragment,null,s,o))});xUe(X.createElement);var tje=({id:n,className:e,style:t,onHeightUpdate:r,children:i})=>{let s=X.useCallback(o=>{if(o){let a=()=>{let c=o.getBoundingClientRect().height;r(n,c)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[n,r]);return X.createElement("div",{ref:s,className:e,style:t},i)},nje=(n,e)=>{let t=n.includes("top"),r=t?{top:0}:{bottom:0},i=n.includes("center")?{justifyContent:"center"}:n.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:jse()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(t?1:-1)}px)`,...r,...i}},rje=zR` 8303 z-index: 9999; 8304 > * { 8305 pointer-events: auto; 8306 } 8307`,jI=16,ije=({reverseOrder:n,position:e="top-center",toastOptions:t,gutter:r,children:i,containerStyle:s,containerClassName:o})=>{let{toasts:a,handlers:c}=kUe(t);return X.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:jI,left:jI,right:jI,bottom:jI,pointerEvents:"none",...s},className:o,onMouseEnter:c.startPause,onMouseLeave:c.endPause},a.map(u=>{let d=u.position||e,f=c.calculateOffset(u,{reverseOrder:n,gutter:r,defaultPosition:e}),m=nje(d,f);return X.createElement(tje,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?rje:"",style:m},u.type==="custom"?o8(u.message,u):i?i(u):X.createElement(eje,{toast:u,position:d}))}))},co=Va;const Fse=({isOpen:n,onClose:e})=>{const[t,r]=X.useState(null),{select:i,connect:s,connected:o,wallet:a,disconnect:c}=$U(),[u,d]=X.useState(!1),[f,m]=X.useState(!1),[w,y]=X.useState(!1),[b,E]=X.useState(!1),[T,N]=X.useState(!1),[I,H]=X.useState(!1),[L,U]=X.useState(!1),[K,Y]=X.useState(!1),[k,j]=X.useState(!1),[V,W]=X.useState(!1),{get:$}=SU(),_=$().filter(bie),{open:R,disconnect:P}=FL(),{isConnected:q,address:F}=FU(),z=X.useMemo(()=>[new CU,new TU,new IU,new sse,new ose,new P7e,new NU,new xie,new vie],[]),B=X.useMemo(()=>z.filter(he=>he&&he.name&&he.name!=="Phantom"&&he.name!=="Reown"),[z]),C=["Phantom","Backpack","Solflare","Trust","Coinbase Wallet"],M=[...B].sort((he,xe)=>{const Se=C.includes(he.name),Re=C.includes(xe.name);return Se===Re?0:Se?-1:1}),Z=X.useMemo(()=>{const he=navigator.userAgent.toLowerCase(),xe=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(he),Se="ontouchstart"in window||navigator.maxTouchPoints>0,Re=window.innerWidth<=768,et=/macintosh/i.test(he)&&Se,Me=/android/i.test(he)&&!/mobile/i.test(he);return xe||et||Me||Se&&Re},[]);X.useEffect(()=>{const he=()=>{var Se,Re,et,Me,Fe,ht,Dt,At;m(!!((Re=(Se=window.phantom)==null?void 0:Se.solana)!=null&&Re.isPhantom)),y(!!((et=window.solflare)!=null&&et.isSolflare)),E(!!((Me=window.backpack)!=null&&Me.isBackpack)),N(!!((Fe=window.glow)!=null&&Fe.isGlow)),U(!!((ht=window.trustWallet)!=null&&ht.isTrust)||!!window.trustwallet),Y(!!window.coin98),j(!!((Dt=window.coinbaseWalletExtension)!=null&&Dt.isCoinbaseWallet)),W(!!window.bitgetWallet),H(!!window.magicEdenSolana||!!window.magicEden||!!((At=window.solana)!=null&&At.isMagicEden))};he();const xe=setInterval(he,1e3);return()=>clearInterval(xe)},[_]),X.useEffect(()=>{(o||q)&&e()},[o,q,e]);const J=async(he,xe)=>{if(xe==="Reown")try{d(!0),localStorage.removeItem("reown-session"),localStorage.removeItem("walletName"),o&&(await c().catch(console.error),await new Promise(Se=>setTimeout(Se,300))),q&&(await P().catch(console.error),await new Promise(Se=>setTimeout(Se,300))),R({view:"Connect",namespace:"solana"}),localStorage.setItem("walletName","Reown");return}catch(Se){console.error("Reown connection error:",Se)}finally{d(!1)}if(!he){console.error("No wallet selected");return}try{d(!0),o&&(await c().catch(console.error),await new Promise(Se=>setTimeout(Se,300))),q&&(await P().catch(console.error),await new Promise(Se=>setTimeout(Se,300))),i(he.name),await s(),localStorage.setItem("walletName",he.name)}catch(Se){console.error("Connection error:",Se),Se.message.includes("Wallet
8307NotSelectedError")?co.error("Please install the wallet extension first."):Se.message.includes("The extension has not been set up")&&(co.error("Please set up your Glow wallet before connecting."),window.open("https://glow.app/","_blank"))}finally{d(!1)}},ae=async he=>{try{if(he==="Reown")R({view:"Connect",namespace:"solana"});else{const xe={Phantom:"https://phantom.app/ul/browse/https://yupfun.com",Solflare:"solflare://browse/https://yupfun.com",Backpack:"https://backpack.app/",Trust:"trust://browser_enable?url=https://yupfun.com","Coinbase Wallet":"coinbase://",Glow:"glow://","Magic Eden":"magiceden://"};xe[he]?window.open(xe[he],"_blank"):R({view:"Connect",namespace:"solana"})}localStorage.setItem("walletName",he)}catch(xe){console.error(`Mobile connection failed for ${he}:`,xe),co.error("Failed to connect. Please try another method.")}},we=async(he,xe)=>{if(he==="Phantom"){co("Whitelist approval for this wallet is in progress. Please check back later.");return}if(Z)await ae(he);else if({Phantom:f,Solflare:w,Backpack:b,Glow:T,"Magic Eden":I,Trust:L,Coin98:K,"Coinbase Wallet":k,Bitget:V,Reown:!0}[he])if(he==="Reown")await J(null,"Reown");else{const Re=z.find(et=>(et==null?void 0:et.name)===he);Re&&await J(Re,he)}else{const Re={Phantom:"https://phantom.app/",Solflare:"https://solflare.com/",Backpack:"https://backpack.app/",Glow:"https://glow.app/","Magic Eden":"https://wallet.magiceden.io/download",Trust:"https://trustwallet.com/download",Coin98:"https://coin98.com/wallet","Coinbase Wallet":"https://coinbase.com/wallet",Bitget:"https://web3.bitget.com/en/wallet-download"};he in Re&&window.open(Re[he],"_blank")}};return n?S.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:S.jsxs("div",{className:"bg-[#1A1C24] p-6 rounded-lg w-full max-w-md mx-4 md:mx-auto text-white",children:[S.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Connect a Wallet"}),Z?S.jsx("div",{className:"mt-4",children:S.jsx("div",{className:"flex items-center p-4 rounded-lg bg-[#2C2F36] hover:bg-[#363A45] cursor-pointer",onClick:()=>we("Reown"),children:S.jsxs("div",{className:"flex items-center gap-3 w-full",children:[S.jsx("div",{className:"w-8 h-8 rounded-lg bg-white flex items-center justify-center",children:S.jsx("img",{src:"/logos/reown-logo.png",alt:"Reown Logo",className:"w-5 h-5",onError:he=>{he.target.onerror=null,he.target.src="/logos/default-logo.png"}})}),S.jsx("div",{className:"flex-1",children:S.jsx("p",{className:"font-medium",children:"Reown"})}),S.jsx("div",{children:S.jsx("svg",{className:"w-4 h-4 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})})]})})}):S.jsxs(S.Fragment,{children:[!f&&!1,S.jsx("div",{className:"grid grid-cols-2 gap-4 mt-4 max-h-[300px] overflow-y-auto",children:M.map(he=>{const xe=(he==null?void 0:he.name)||"Unknown Wallet",Se={Phantom:f,Solflare:w,Backpack:b,Glow:T,"Magic Eden":I,Trust:L,Coin98:K,"Coinbase Wallet":k,Bitget:V}[xe]||!1;return S.jsx("div",{className:"flex items-center p-4 rounded-lg bg-[#2C2F36] hover:bg-[#363A45] cursor-pointer",onClick:()=>we(xe),children:S.jsxs("div",{className:"flex items-center gap-3 w-full",children:[S.jsx("div",{className:"w-8 h-8 rounded-lg bg-white flex items-center justify-center",children:S.jsx("img",{src:`/logos/${xe.toLowerCase().replace(/\s+/g,"-")}-logo.png`,alt:`${xe} Logo`,className:"w-5 h-5",onError:Re=>{Re.target.onerror=null,Re.target.src="/logos/default-logo.png"}})}),S.jsx("div",{className:"flex-1",children:S.jsx("p",{className:"font-medium",children:xe})}),S.jsx("div",{children:Se?S.jsx("svg",{className:"w-4 h-4 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):S.jsx("svg",{className:"w-4 h-4 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})},xe)})})]}),S.jsx(pUe,{}),S.jsxs("footer",{className:"text-sm text-gray-400 mt-6 text-center",children:["By connecting a wallet, you agree to our"," ",S.jsx("a",{href:"/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"text-[#7EBAFF] hover:underline",children:"Terms of Service"})," ","and"," ",S.jsx("a",{href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-[#7EBAFF] hover:underline",children:"Privacy Policy"})]}),S.jsx("button",{className:"mt-4 w-full bg-[#7EBAFF] hover:bg-[#6
8307BA8FF] text-[#1A1C24] font-medium py-3 rounded-xl transition-colors",onClick:e,children:"Close"})]})}):null},Wse=typeof document<"u"?Qn.useLayoutEffect:()=>{};var T9;const sje=(T9=Qn.useInsertionEffect)!==null&&T9!==void 0?T9:Wse;function oje(n){const e=X.useRef(null);return sje(()=>{e.current=n},[n]),X.useCallback((...t)=>{const r=e.current;return r==null?void 0:r(...t)},[])}const L0=n=>{var e;return(e=n==null?void 0:n.ownerDocument)!==null&&e!==void 0?e:document},Fy=n=>n&&"window"in n&&n.window===n?n:L0(n).defaultView||window;function aje(n){return n!==null&&typeof n=="object"&&"nodeType"in n&&typeof n.nodeType=="number"}function cje(n){return aje(n)&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in n}let lje=!1;function uj(){return lje}function Hse(n,e){if(!uj())return e&&n?n.contains(e):!1;if(!n||!e)return!1;let t=e;for(;t!==null;){if(t===n)return!0;t.tagName==="SLOT"&&t.assignedSlot?t=t.assignedSlot.parentNode:cje(t)?t=t.host:t=t.parentNode}return!1}const GB=(n=document)=>{var e;if(!uj())return n.activeElement;let t=n.activeElement;for(;t&&"shadowRoot"in t&&(!((e=t.shadowRoot)===null||e===void 0)&&e.activeElement);)t=t.shadowRoot.activeElement;return t};function Vse(n){return uj()&&n.target.shadowRoot&&n.composedPath?n.composedPath()[0]:n.target}function uje(n){var e;if(typeof window>"u"||window.navigator==null)return!1;let t=(e=window.navigator.userAgentData)===null||e===void 0?void 0:e.brands;return Array.isArray(t)&&t.some(r=>n.test(r.brand))||n.test(window.navigator.userAgent)}function dje(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function qse(n){let e=null;return()=>(e==null&&(e=n()),e)}const hje=qse(function(){return dje(/^Mac/i)}),fje=qse(function(){return uje(/Android/i)});function Kse(){let n=X.useRef(new Map),e=X.useCallback((i,s,o,a)=>{let c=a!=null&&a.once?(...u)=>{n.current.delete(o),o(...u)}:o;n.current.set(o,{type:s,eventTarget:i,fn:c,options:a}),i.addEventListener(s,c,a)},[]),t=X.useCallback((i,s,o,a)=>{var c;let u=((c=n.current.get(o))===null||c===void 0?void 0:c.fn)||o;i.removeEventListener(s,u,a),n.current.delete(o)},[]),r=X.useCallback(()=>{n.current.forEach((i,s)=>{t(i.eventTarget,i.type,s,i.options)})},[t]);return X.useEffect(()=>r,[r]),{addGlobalListener:e,removeGlobalListener:t,removeAllGlobalListeners:r}}function pje(n){return n.mozInputSource===0&&n.isTrusted?!0:fje()&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}function Yse(n){let e=n;return e.nativeEvent=n,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function gje(n,e){Object.defineProperty(n,"target",{value:e}),Object.defineProperty(n,"currentTarget",{value:e})}function Gse(n){let e=X.useRef({isFocused:!1,observer:null});Wse(()=>{const r=e.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let t=oje(r=>{n==null||n(r)});return X.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){e.current.isFocused=!0;let i=r.target,s=o=>{if(e.current.isFocused=!1,i.disabled){let a=Yse(o);t(a)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",s,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){var o;(o=e.current.observer)===null||o===void 0||o.disconnect();let a=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),e.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[t])}let mje=!1,x4=null,ZB=new Set,$S=new Map,k1=!1,QB=!1;const wje={Tab:!0,Escape:!0};function dj(n,e){for(let t of ZB)t(n,e)}function yje(n){return!(n.metaKey||!hje()&&n.altKey||n.ctrlKey||n.key==="Control"||n.key==="Shift"||n.key==="Meta")}function a8(n){k1=!0,yje(n)&&(x4="keyboard",dj("keyboard",n))}function ex(n){x4="pointer",(n.type==="mousedown"||n.type==="pointerdown")&&(k1=!0,dj("pointer",n))}function Zse(n){pje(n)&&(k1=!0,x4="virtual")}function Qse(n){n.target===window||n.target===document||mje||!n.isTrusted||(!k1&&!QB&&(x4="virtual",dj("virtual",n)),k1=!1,QB=!1)}function Xse(){k1=!1,QB=!0}function XB(n){if(typeof window>"u"||typeof document>"u"||$S.get(Fy(n)))return;const e=Fy(n),t=L0(n);
vendor: 24,518 bytes, lines 8307-8318
8307let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){k1=!0,r.apply(this,arguments)},t.addEventListener("keydown",a8,!0),t.addEventListener("keyup",a8,!0),t.addEventListener("click",Zse,!0),e.addEventListener("focus",Qse,!0),e.addEventListener("blur",Xse,!1),typeof PointerEvent<"u"&&(t.addEventListener("pointerdown",ex,!0),t.addEventListener("pointermove",ex,!0),t.addEventListener("pointerup",ex,!0)),e.addEventListener("beforeunload",()=>{Jse(n)},{once:!0}),$S.set(e,{focus:r})}const Jse=(n,e)=>{const t=Fy(n),r=L0(n);e&&r.removeEventListener("DOMContentLoaded",e),$S.has(t)&&(t.HTMLElement.prototype.focus=$S.get(t).focus,r.removeEventListener("keydown",a8,!0),r.removeEventListener("keyup",a8,!0),r.removeEventListener("click",Zse,!0),t.removeEventListener("focus",Qse,!0),t.removeEventListener("blur",Xse,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",ex,!0),r.removeEventListener("pointermove",ex,!0),r.removeEventListener("pointerup",ex,!0)),$S.delete(t))};function bje(n){const e=L0(n);let t;return e.readyState!=="loading"?XB(n):(t=()=>{XB(n)},e.addEventListener("DOMContentLoaded",t)),()=>Jse(n,t)}typeof document<"u"&&bje();function eoe(){return x4!=="pointer"}const vje=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function xje(n,e,t){let r=L0(t==null?void 0:t.target);const i=typeof window<"u"?Fy(t==null?void 0:t.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Fy(t==null?void 0:t.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?Fy(t==null?void 0:t.target).HTMLElement:HTMLElement,a=typeof window<"u"?Fy(t==null?void 0:t.target).KeyboardEvent:KeyboardEvent;return n=n||r.activeElement instanceof i&&!vje.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof o&&r.activeElement.isContentEditable,!(n&&e==="keyboard"&&t instanceof a&&!wje[t.key])}function Eje(n,e,t){XB(),X.useEffect(()=>{let r=(i,s)=>{xje(!!(t!=null&&t.isTextInput),i,s)&&n(eoe())};return ZB.add(r),()=>{ZB.delete(r)}},e)}function Aje(n){let{isDisabled:e,onFocus:t,onBlur:r,onFocusChange:i}=n;const s=X.useCallback(c=>{if(c.target===c.currentTarget)return r&&r(c),i&&i(!1),!0},[r,i]),o=Gse(s),a=X.useCallback(c=>{const u=L0(c.target),d=u?GB(u):GB();c.target===c.currentTarget&&d===Vse(c.nativeEvent)&&(t&&t(c),i&&i(!0),o(c))},[i,t,o]);return{focusProps:{onFocus:!e&&(t||i||r)?a:void 0,onBlur:!e&&(r||i)?s:void 0}}}function Sje(n){let{isDisabled:e,onBlurWithin:t,onFocusWithin:r,onFocusWithinChange:i}=n,s=X.useRef({isFocusWithin:!1}),{addGlobalListener:o,removeAllGlobalListeners:a}=Kse(),c=X.useCallback(f=>{f.currentTarget.contains(f.target)&&s.current.isFocusWithin&&!f.currentTarget.contains(f.relatedTarget)&&(s.current.isFocusWithin=!1,a(),t&&t(f),i&&i(!1))},[t,i,s,a]),u=Gse(c),d=X.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const m=L0(f.target),w=GB(m);if(!s.current.isFocusWithin&&w===Vse(f.nativeEvent)){r&&r(f),i&&i(!0),s.current.isFocusWithin=!0,u(f);let y=f.currentTarget;o(m,"focus",b=>{if(s.current.isFocusWithin&&!Hse(y,b.target)){let E=new m.defaultView.FocusEvent("blur",{relatedTarget:b.target});gje(E,y);let T=Yse(E);c(T)}},{capture:!0})}},[r,i,u,o,c]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:c}}}let JB=!1,zI=0;function _je(){JB=!0,setTimeout(()=>{JB=!1},50)}function bG(n){n.pointerType==="touch"&&_je()}function Cje(){if(!(typeof document>"u"))return zI===0&&typeof PointerEvent<"u"&&document.addEventListener("pointerup",bG),zI++,()=>{zI--,!(zI>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",bG)}}function Tje(n){let{onHoverStart:e,onHoverChange:t,onHoverEnd:r,isDisabled:i}=n,[s,o]=X.useState(!1),a=X.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;X.useEffect(Cje,[]);let{addGlobalListener:c,removeAllGlobalListeners:u}=Kse(),{hoverProps:d,triggerHoverEnd:f}=X.useMemo(()=>{let m=(b,E)=>{if(a.pointerType=E,i||E==="touch"||a.isHovered||!b.currentTarget.contains(b.target))return;a.isHovered=!0;let T=b.currentTarget;a.target=T,c(L0(b.target),"pointerover",N=>{a.isHovered&&a.target&&!Hse(a.target,N.target)&&w(N,N.pointerType)},{capture:!0}),e&&e({type:"hoverstart",target:T,pointerType:E}),t&&t(!0),o(!0)},w=(b,E)=>{let T=a.target;a.pointerType="",a.target=null,!(E==="touch"||!a.isHovered||!T)&&(a.isHovered=!1,u(),r&&r({type:"hoverend",target:T,pointerType:E}),t&&t(!1),o(!1))},y={};return typeof PointerEvent<"u"&&(y.onPointerEnter=b=>{JB&&b.pointerType==="mouse"||m(b,b.pointerType)},y.onPointerLeave=b=>{!i&&b.currentTarget.contains(b.target)&&w(b,b.pointerType)}),{hoverProps:y,triggerHoverEnd:w}},[e,t,r,i,a,c,u]);return X.useEffect(()=>{i&&f({currentTarget:a.target},a.pointerType)},[i]),{hoverProps:d,isHovered:s}}function Ije(n={}){let{autoFocus:e=!1,isTextInput:t,within:r}=n,i=X.useRef({isFocused:!1,isFocusVisible:e||eoe()}),[s,o]=X.useState(!1),[a,c]=X.useState(()=>i.current.isFocused&&i.current.isFocusVisible),u=X.useCallback(()=>c(i.current.isFocused&&i.current.isFocusVisible),[]),d=X.useCallback(w=>{i.current.isFocused=w,o(w),u()},[u]);Eje(w=>{i.current.isFocusVisible=w,u()},[],{isTextInput:t});let{focusProps:f}=Aje({isDisabled:r,onFocusChange:d}),{focusWithinProps:m}=Sje({isDisabled:!r,onFocusWithinChange:d});return{isFocused:s,isFocusVisible:a,focusProps:r?m:f}}var Nje=Object.defineProperty,Rje=(n,e,t)=>e in n?Nje(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,I9=(n,e,t)=>(Rje(n,typeof e!="symbol"?e+"":e,t),t);let Mje=class{constructor(){I9(this,"current",this.detect()),I9(this,"handoffState","pending"),I9(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}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"}},Mf=new Mje;function yE(n){var e,t;return Mf.isServer?null:n?"ownerDocument"in n?n.ownerDocument:"current"in n?(t=(e=n.current)==null?void 0:e.ownerDocument)!=null?t:document:null:document}function toe(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(e=>setTimeout(()=>{throw e}))}function id(){let n=[],e={addEventListener(t,r,i,s){return t.addEventListener(r,i,s),e.add(()=>t.removeEventListener(r,i,s))},requestAnimationFrame(...t){let r=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(r))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let r=setTimeout(...t);return e.add(()=>clearTimeout(r))},microTask(...t){let r={current:!0};return toe(()=>{r.current&&t[0]()}),e.add(()=>{r.current=!1})},style(t,r,i){let s=t.style.getPropertyValue(r);return Object.assign(t.style,{[r]:i}),this.add(()=>{Object.assign(t.style,{[r]:s})})},group(t){let r=id();return t(r),this.add(()=>r.dispose())},add(t){return n.includes(t)||n.push(t),()=>{let r=n.indexOf(t);if(r>=0)for(let i of n.splice(r,1))i()}},dispose(){for(let t of n.splice(0))t()}};return e}function E4(){let[n]=X.useState(id);return X.useEffect(()=>()=>n.dispose(),[n]),n}let es=(n,e)=>{Mf.isServer?X.useEffect(n,e):X.useLayoutEffect(n,e)};function bE(n){let e=X.useRef(n);return es(()=>{e.current=n},[n]),e}let Nr=function(n){let e=bE(n);return Qn.useCallback((...t)=>e.current(...t),[e])};function kje(n){let e=n.width/2,t=n.height/2;return{top:n.clientY-t,right:n.clientX+e,bottom:n.clientY+t,left:n.clientX-e}}function Oje(n,e){return!(!n||!e||n.right<e.left||n.left>e.right||n.bottom<e.top||n.top>e.bottom)}function Pje({disabled:n=!1}={}){let e=X.useRef(null),[t,r]=X.useState(!1),i=E4(),s=Nr(()=>{e.current=null,r(!1),i.dispose()}),o=Nr(a=>{if(i.dispose(),e.current===null){e.current=a.currentTarget,r(!0);{let c=yE(a.currentTarget);i.addEventListener(c,"pointerup",s,!1),i.addEventListener(c,"pointermove",u=>{if(e.current){let d=kje(u);r(Oje(d,e.current.getBoundingClientRect()))}},!1),i.addEventListener(c,"pointercancel",s,!1)}}});return{pressed:t,pressProps:n?{}:{onPointerDown:o,onPointerUp:s,onClick:s}}}let Dje=X.createContext(void 0);function noe(){return X.useContext(Dje)}function eL(...n){return Array.from(new Set(n.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function $0(n,e,...t){if(n in e){let i=e[n];return typeof i=="function"?i(...t):i}let r=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,$0),r}var c8=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(c8||{}),n0=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(n0||{});function Al(){let n=Lje();return X.useCallback(e=>Bje({mergeRefs:n,...e}),[n])}function Bje({ourProps:n,theirProps:e,slot:t,defaultTag:r,features:i,visible:s=!0,name:o,mergeRefs:a}){a=a??$je;let c=roe(e,n);if(s)return FI(c,t,r,o,a);let u=i??0;if(u&2){let{static:d=!1,...f}=c;if(d)return FI(f,t,r,o,a)}if(u&1){let{unmount:d=!0,...f}=c;return $0(d?0:1,{0(){return null},1(){return FI({...f,hidden:!0,style:{display:"none"}},t,r,o,a)}})}return FI(c,t,r,o,a)}function FI(n,e={},t,r,i){let{as:s=t,children:o,refName:a="ref",...c}=N9(n,["unmount","static"]),u=n.ref!==void 0?{[a]:n.ref}:{},d=typeof o=="function"?o(e):o;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(e)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let f={};if(e){let m=!1,w=[];for(let[y,b]of Object.entries(e))typeof b=="boolean"&&(m=!0),b===!0&&w.push(y.replace(/([A-Z])/g,E=>`-${E.toLowerCase()}`));if(m){f["data-headlessui-state"]=w.join(" ");for(let y of w)f[`data-${y}`]=""}}if(s===X.Fragment&&(Object.keys(gy(c)).length>0||Object.keys(gy(f)).length>0))if(!X.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(gy(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(gy(c)).concat(Object.keys(gy(f))).map(m=>` - ${m}`).join(` 8308`),"","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(m=>` - ${m}`).join(` 8309`)].join(` 8310`))}else{let m=d.props,w=m==null?void 0:m.className,y=typeof w=="function"?(...T)=>eL(w(...T),c.className):eL(w,c.className),b=y?{className:y}:{},E=roe(d.props,gy(N9(c,["ref"])));for(let T in f)T in E&&delete f[T];return X.cloneElement(d,Object.assign({},E,f,u,{ref:i(Uje(d),u.ref)},b))}return X.createElement(s,Object.assign({},N9(c,["ref"]),s!==X.Fragment&&u,s!==X.Fragment&&f),d)}function Lje(){let n=X.useRef([]),e=X.useCallback(t=>{for(let r of n.current)r!=null&&(typeof r=="function"?r(t):r.current=t)},[]);return(...t)=>{if(!t.every(r=>r==null))return n.current=t,e}}function $je(...n){return n.every(e=>e==null)?void 0:e=>{for(let t of n)t!=null&&(typeof t=="function"?t(e):t.current=e)}}function roe(...n){if(n.length===0)return{};if(n.length===1)return n[0];let e={},t={};for(let r of n)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(t[i]!=null||(t[i]=[]),t[i].push(r[i])):e[i]=r[i];if(e.disabled||e["aria-disabled"])for(let r in t)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(t[r]=[i=>{var s;return(s=i==null?void 0:i.preventDefault)==null?void 0:s.call(i)}]);for(let r in t)Object.assign(e,{[r](i,...s){let o=t[r];for(let a of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...s)}}});return e}function ioe(...n){if(n.length===0)return{};if(n.length===1)return n[0];let e={},t={};for(let r of n)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(t[i]!=null||(t[i]=[]),t[i].push(r[i])):e[i]=r[i];for(let r in t)Object.assign(e,{[r](...i){let s=t[r];for(let o of s)o==null||o(...i)}});return e}function Rc(n){var e;return Object.assign(X.forwardRef(n),{displayName:(e=n.displayName)!=null?e:n.name})}function gy(n){let e=Object.assign({},n);for(let t in e)e[t]===void 0&&delete e[t];return e}function N9(n,e=[]){let t=Object.assign({},n);for(let r of e)r in t&&delete t[r];return t}function Uje(n){return Qn.version.split(".")[0]>="19"?n.props.ref:n.ref}let jje=X.createContext(void 0);function zje(){return X.useContext(jje)}function hj(n){return typeof n!="object"||n===null?!1:"nodeType"in n}function FR(n){return hj(n)&&"tagName"in n}function Rg(n){return FR(n)&&"accessKey"in n}function Wy(n){return FR(n)&&"tabIndex"in n}function Fje(n){return FR(n)&&"style"in n}function Wje(n){return Rg(n)&&n.nodeName==="IFRAME"}function soe(n){return Rg(n)&&n.nodeName==="INPUT"}function vG(n){return Rg(n)&&n.nodeName==="LABEL"}function Hje(n){return Rg(n)&&n.nodeName==="FIELDSET"}function ooe(n){return Rg(n)&&n.nodeName==="LEGEND"}function Vje(n){return FR(n)?n.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function qje(n){let e=n.parentElement,t=null;for(;e&&!Hje(e);)ooe(e)&&(t=e),e=e.parentElement;let r=(e==null?void 0:e.getAttribute("disabled"))==="";return r&&Kje(t)?!1:r}function Kje(n){if(!n)return!1;let e=n.previousElementSibling;for(;e!==null;){if(ooe(e))return!1;e=e.previousElementSibling}return!0}let aoe=Symbol();function Yje(n,e=!0){return Object.assign(n,{[aoe]:e})}function vh(...n){let e=X.useRef(n);X.useEffect(()=>{e.current=n},[n]);let t=Nr(r=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return n.every(r=>r==null||(r==null?void 0:r[aoe]))?void 0:t}let fj=X.createContext(null);fj.displayName="DescriptionContext";function coe(){let n=X.useContext(fj);if(n===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,coe),e}return n}function Gje(){let[n,e]=X.useState([]);return[n.length>0?n.join(" "):void 0,X.useMemo(()=>function(t){let r=Nr(s=>(e(o=>[...o,s]),()=>e(o=>{let a=o.slice(),c=a.indexOf(s);return c!==-1&&a.splice(c,1),a}))),i=X.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props,value:t.value}),[r,t.slot,t.name,t.props,t.value]);return Qn.createElement(fj.Provider,{value:i},t.children)},[e])]}let Zje="p";function Qje(n,e){let t=X.useId(),r=noe(),{id:i=`headlessui-description-${t}`,...s}=n,o=coe(),a=vh(e);es(()=>o.register(i),[i,o.register]);let c=r||!1,u=X.useMemo(()=>({...o.slot,disabled:c}),[o.slot,c]),d={ref:a,...o.props,id:i};return Al()({ourProps:d,theirProps:s,slot:u,defaultTag:Zje,name:o.name||"Description"})}let Xje=Rc(Qje);Object.assign(Xje,{});var ea=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(ea||{});let WR=X.createContext(null);WR.displayName="LabelContext";function pj(){let n=X.useContext(WR);if(n===null){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,pj),e}return n}function Jje(n){var e,t,r;let i=(t=(e=X.useContext(WR))==null?void 0:e.value)!=null?t:void 0;return((r=void 0)!=null?r:0)>0?[i,...n].filter(Boolean).join(" "):i}function loe({inherit:n=!1}={}){let e=Jje(),[t,r]=X.useState([]),i=n?[e,...t].filter(Boolean):t;return[i.length>0?i.join(" "):void 0,X.useMemo(()=>function(s){let o=Nr(c=>(r(u=>[...u,c]),()=>r(u=>{let d=u.slice(),f=d.indexOf(c);return f!==-1&&d.splice(f,1),d}))),a=X.useMemo(()=>({register:o,slot:s.slot,name:s.name,props:s.props,value:s.value}),[o,s.slot,s.name,s.props,s.value]);return Qn.createElement(WR.Provider,{value:a},s.children)},[r])]}let eze="label";function tze(n,e){var t;let r=X.useId(),i=pj(),s=zje(),o=noe(),{id:a=`headlessui-label-${r}`,htmlFor:c=s??((t=i.props)==null?void 0:t.htmlFor),passive:u=!1,...d}=n,f=vh(e);es(()=>i.register(a),[a,i.register]);let m=Nr(E=>{let T=E.currentTarget;if(!(E.target!==E.currentTarget&&Vje(E.target))&&(vG(T)&&E.preventDefault(),i.props&&"onClick"in i.props&&typeof i.props.onClick=="function"&&i.props.onClick(E),vG(T))){let N=document.getElementById(T.htmlFor);if(N){let I=N.getAttribute("disabled");if(I==="true"||I==="")return;let H=N.getAttribute("aria-disabled");if(H==="true"||H==="")return;(soe(N)&&(N.type==="file"||N.type==="radio"||N.type==="checkbox")||N.role==="radio"||N.role==="checkbox"||N.role==="switch")&&N.click(),N.focus({preventScroll:!0})}}}),w=o||!1,y=X.useMemo(()=>({...i.slot,disabled:w}),[i.slot,w]),b={ref:f,...i.props,id:a,htmlFor:c,onClick:m};return u&&("onClick"in b&&(delete b.htmlFor,delete b.onClick),"onClick"in d&&delete d.onClick),Al()({ourProps:b,theirProps:d,slot:y,defaultTag:c?eze:"div",name:i.name||"Label"})}let nze=Rc(tze);Object.assign(nze,{});function rze(n){if(n===null)return{width:0,height:0};let{width:e,height:t}=n.getBoundingClientRect();return{width:e,height:t}}function ize(n,e=!1){let[t,r]=X.useReducer(()=>({}),{}),i=X.useMemo(()=>rze(n),[n,t]);return es(()=>{if(!n)return;let s=new ResizeObserver(r);return s.observe(n),()=>{s.disconnect()}},[n]),e?{width:`${i.width}px`,height:`${i.height}px`}:i}let uoe=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}};var sze=Object.defineProperty,oze=(n,e,t)=>e in n?sze(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,aze=(n,e,t)=>(oze(n,e+"",t),t),doe=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Mu=(n,e,t)=>(doe(n,e,"read from private field"),t?t.call(n):e.get(n)),R9=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},xG=(n,e,t,r)=>(doe(n,e,"write to private field"),e.set(n,t),t),hf,iS,sS;let hoe=class{constructor(e){R9(this,hf,{}),R9(this,iS,new uoe(()=>new Set)),R9(this,sS,new Set),aze(this,"disposables",id()),xG(this,hf,e),Mf.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Mu(this,hf)}subscribe(e,t){if(Mf.isServer)return()=>{};let r={selector:e,callback:t,current:e(Mu(this,hf))};return Mu(this,sS).add(r),this.disposables.add(()=>{Mu(this,sS).delete(r)})}on(e,t){return Mf.isServer?()=>{}:(Mu(this,iS).get(e).add(t),this.disposables.add(()=>{Mu(this,iS).get(e).delete(t)}))}send(e){let t=this.reduce(Mu(this,hf),e);if(t!==Mu(this,hf)){xG(this,hf,t);for(let r of Mu(this,sS)){let i=r.selector(Mu(this,hf));foe(r.current,i)||(r.current=i,r.callback(i))}for(let r of Mu(this,iS).get(e.type))r(Mu(this,hf),e)}}};hf=new WeakMap,iS=new WeakMap,sS=new WeakMap;function foe(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null?!1:Array.isArray(n)&&Array.isArray(e)?n.length!==e.length?!1:M9(n[Symbol.iterator](),e[Symbol.iterator]()):n instanceof Map&&e instanceof Map||n instanceof Set&&e instanceof Set?n.size!==e.size?!1:M9(n.entries(),e.entries()):EG(n)&&EG(e)?M9(Object.entries(n)[Symbol.iterator](),Object.entries(e)[Symbol.iterator]()):!1}function M9(n,e){do{let t=n.next(),r=e.next();if(t.done&&r.done)return!0;if(t.done||r.done||!Object.is(t.value,r.value))return!1}while(!0)}function EG(n){if(Object.prototype.toString.call(n)!=="[object Object]")return!1;let e=Object.getPrototypeOf(n);return e===null||Object.getPrototypeOf(e)===null}function AG(n){let[e,t]=n(),r=id();return(...i)=>{e(...i),r.dispose(),r.microTask(t)}}var cze=Object.defineProperty,lze=(n,e,t)=>e in n?cze(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,SG=(n,e,t)=>(lze(n,typeof e!="symbol"?e+"":e,t),t),poe=(n=>(n[n.Push=0]="Push",n[n.Pop=1]="Pop",n))(poe||{});let uze={0(n,e){let t=e.id,r=n.stack,i=n.stack.indexOf(t);if(i!==-1){let s=n.stack.slice();return s.splice(i,1),s.push(t),r=s,{...n,stack:r}}return{...n,stack:[...n.stack,t]}},1(n,e){let t=e.id,r=n.stack.indexOf(t);if(r===-1)return n;let i=n.stack.slice();return i.splice(r,1),{...n,stack:i}}},dze=class goe extends hoe{constructor(){super(...arguments),SG(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),SG(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new goe({stack:[]})}reduce(e,t){return $0(t.type,uze,e,t)}};const gj=new uoe(()=>dze.new());var k9={exports:{}},O9={};/** 8311 * @license React 8312 * use-sync-external-store-with-selector.production.js 8313 * 8314 * Copyright (c) Meta Platforms, Inc. and affiliates. 8315 * 8316 * This source code is licensed under the MIT license found in the 8317 * LICENSE file in the root directory of this source tree. 8318 */var _G;function hze(){if(_G)return O9;_G=1;var n=TC();function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var t=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=n.useRef,s=n.useEffect,o=n.useMemo,a=n.useDebugValue;return O9.useSyncExternalStoreWithSelector=function(c,u,d,f,m){var w=i(null);if(w.current===null){var y={hasValue:!1,value:null};w.current=y}else y=w.current;w=o(function(){function E(L){if(!T){if(T=!0,N=L,L=f(L),m!==void 0&&y.hasValue){var U=y.value;if(m(U,L))return I=U}return I=L}if(U=I,t(N,L))return U;var K=f(L);return m!==void 0&&m(U,K)?(N=L,U):(N=L,I=K)}var T=!1,N,I,H=d===void 0?null:d;return[function(){return E(u())},H===null?void 0:function(){return E(H())}]},[u,d,f,m]);var b=r(c,w[0],w[1]);return s(function(){y.hasValue=!0,y.value=b},[b]),a(b),b},O9}var CG;function fze(){return CG||(CG=1,k9.exports=hze()),k9.exports}var pze=fze();function _f(n,e,t=foe){return pze.useSyncExternalStoreWithSelector(Nr(r=>n.subscribe(gze,r)),Nr(()=>n.state),Nr(()=>n.state),Nr(e),t)}function gze(n){return n}function moe(n,e){let t=X.useId(),r=gj.get(e),[i,s]=_f(r,X.useCallback(o=>[r.selectors.isTop(o,t),r.selectors.inStack(o,t)],[r,t]));return es(()=>{if(n)return r.actions.push(t),()=>r.actions.pop(t)},[r,n,t]),n?s?i:!0:!1}let tL=new Map,US=new Map;function TG(n){var e;let t=(e=US.get(n))!=null?e:0;return US.set(n,t+1),t!==0?()=>IG(n):(tL.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0,()=>IG(n))}function IG(n){var e;let t=(e=US.get(n))!=null?e:1;if(t===1?US.delete(n):US.set(n,t-1),t!==1)return;let r=tL.get(n);r&&(r["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",r["aria-hidden"]),n.inert=r.inert,tL.delete(n))}function mze(n,{allowed:e,disallowed:t}={}){let r=moe(n,"inert-others");es(()=>{var i,s;if(!r)return;let o=id();for(let c of(i=t==null?void 0:t())!=null?i:[])c&&o.add(TG(c));let a=(s=e==null?void 0:e())!=null?s:[];for(let c of a){if(!c)continue;let u=yE(c);if(!u)continue;let d=c.parentElement;for(;d&&d!==u.body;){for(let f of d.children)a.some(m=>f.contains(m))||o.add(TG(f));d=d.parentElement}}return o.dispose},[r,e,t])}function wze(n,e,t){let r=bE(i=>{let s=i.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&t()});X.useEffect(()=>{if(!n)return;let i=e===null?null:Rg(e)?e:e.current;if(!i)return;let s=id();if(typeof ResizeObserver<"u"){let o=new ResizeObserver(()=>r.current(i));o.observe(i),s.add(()=>o.disconnect())}if(typeof IntersectionObserver<"u"){let o=new IntersectionObserver(()=>r.current(i));o.observe(i),s.add(()=>o.disconnect())}return()=>s.dispose()},[e,r,n])}let nL=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(","),yze=["[data-autofocus]"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var rL=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n[n.AutoFocus=64]="AutoFocus",n))(rL||{}),bze=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))(bze||{}),vze=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(vze||{});function woe(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(nL)).sort((e,t)=>
8318Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}function xze(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(yze)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var mj=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))(mj||{});function wj(n,e=0){var t;return n===((t=yE(n))==null?void 0:t.body)?!1:$0(e,{0(){return n.matches(nL)},1(){let r=n;for(;r!==null;){if(r.matches(nL))return!0;r=r.parentElement}return!1}})}function yoe(n){let e=yE(n);id().nextFrame(()=>{e&&Wy(e.activeElement)&&!wj(e.activeElement,0)&&Aze(n)})}var Eze=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(Eze||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Aze(n){n==null||n.focus({preventScroll:!0})}let Sze=["textarea","input"].join(",");function _ze(n){var e,t;return(t=(e=n==null?void 0:n.matches)==null?void 0:e.call(n,Sze))!=null?t:!1}function boe(n,e=t=>t){return n.slice().sort((t,r)=>{let i=e(t),s=e(r);if(i===null||s===null)return 0;let o=i.compareDocumentPosition(s);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Cze(n,e){return Tze(woe(),e,{relativeTo:n})}function Tze(n,e,{sorted:t=!0,relativeTo:r=null,skipElements:i=[]}={}){let s=Array.isArray(n)?n.length>0?n[0].ownerDocument:document:n.ownerDocument,o=Array.isArray(n)?t?boe(n):n:e&64?xze(n):woe(n);i.length>0&&o.length>1&&(o=o.filter(w=>!i.some(y=>y!=null&&"current"in y?(y==null?void 0:y.current)===w:y===w))),r=r??s.activeElement;let a=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,o.indexOf(r))-1;if(e&4)return Math.max(0,o.indexOf(r))+1;if(e&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=e&32?{preventScroll:!0}:{},d=0,f=o.length,m;do{if(d>=f||d+f<=0)return 0;let w=c+d;if(e&16)w=(w+f)%f;else{if(w<0)return 3;if(w>=f)return 1}m=o[w],m==null||m.focus(u),d+=a}while(m!==s.activeElement);return e&6&&_ze(m)&&m.select(),2}function voe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Ize(){return/Android/gi.test(window.navigator.userAgent)}function NG(){return voe()||Ize()}function O2(n,e,t,r){let i=bE(t);X.useEffect(()=>{if(!n)return;function s(o){i.current(o)}return document.addEventListener(e,s,r),()=>document.removeEventListener(e,s,r)},[n,e,r])}function Nze(n,e,t,r){let i=bE(t);X.useEffect(()=>{if(!n)return;function s(o){i.current(o)}return window.addEventListener(e,s,r),()=>window.removeEventListener(e,s,r)},[n,e,r])}const RG=30;function Rze(n,e,t){let r=bE(t),i=X.useCallback(function(a,c){if(a.defaultPrevented)return;let u=c(a);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let d=function f(m){return typeof m=="function"?f(m()):Array.isArray(m)||m instanceof Set?m:[m]}(e);for(let f of d)if(f!==null&&(f.contains(u)||a.composed&&a.composedPath().includes(f)))return;return!wj(u,mj.Loose)&&u.tabIndex!==-1&&a.preventDefault(),r.current(a,u)},[r,e]),s=X.useRef(null);O2(n,"pointerdown",a=>{var c,u;NG()||(s.current=((u=(c=a.composedPath)==null?void 0:c.call(a))==null?void 0:u[0])||a.target)},!0),O2(n,"pointerup",a=>{if(NG()||!s.current)return;let c=s.current;return s.current=null,i(a,()=>c)},!0);let o=X.useRef({x:0,y:0});O2(n,"touchstart",a=>{o.current.x=a.touches[0].clientX,o.current.y=a.touches[0].clientY},!0),O2(n,"touchend",a=>{let c={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(c.x-o.current.x)>=RG||Math.abs(c.y-o.current.y)>=RG))return i(a,()=>Wy(a.target)?a.target:null)},!0),Nze(n,"blur",a=>i(a,()=>Wje(window.document.activeElement)?window.document.activeElement:null),!0)}function iL(...n){return X.useMemo(()=>yE(...n),[...n])}var Mze=(n=>(n[n.Ignore=0]="Ignore",n[n.Select=1]="Select",n[n.Close=2]="Close",n))(Mze||{});const WI={Ignore:{kind:0},Select:n=>({kind:1,target:n}),Close:{kind:2}},kze=200,MG=5;function Oze(n,{trigger:e,action:t,close:r,select:i}){let s=X.useRef(null),o=X.useRef(null),a=X.useRef(null);O2(n&&e!==null,"pointerdown",c=>{hj(c==null?void 0:c.target)&&e!=null&&e.contains(c.target)&&(o.current=c.x,a.current=c.y,s.current=c.timeStamp)}),O2(n&&e!==null,"pointerup",c=>{var u,d;let f=s.current;if(f===null||(s.current=null,!Wy(c.target))||Math.abs(c.x-((u=o.current)!=null?u:c.x))<MG&&Math.abs(c.y-((d=a.current)!=null?d:c.y))<MG)return;let m=t(c);switch(m.kind){case 0:return;case 1:{c.timeStamp-f>kze&&(i(m.target),r());break}case 2:{r();break}}},{capture:!0})}function Pze(n,e){return X.useMemo(()=>{var t;if(n.type)return n.type;let r=(t=n.as)!=null?t:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(e==null?void 0:e.tagName)==="BUTTON"&&!e.hasAttribute("type"))return"button"},[n.type,n.as,e])}
vendor: 8,491 bytes, lines 8318-8319
8318function Dze(n){return X.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot)}function Bze(n,e){let t=n(),r=new Set;return{getSnapshot(){return t},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...s){let o=e[i].call(t,...s);o&&(t=o,r.forEach(a=>a()))}}}function Lze(){let n;return{before({doc:e}){var t;let r=e.documentElement,i=(t=e.defaultView)!=null?t:window;n=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:e,d:t}){let r=e.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,n-i);t.style(r,"paddingRight",`${s}px`)}}}function $ze(){return voe()?{before({doc:n,d:e,meta:t}){function r(i){return t.containers.flatMap(s=>s()).some(s=>s.contains(i))}e.microTask(()=>{var i;if(window.getComputedStyle(n.documentElement).scrollBehavior!=="auto"){let a=id();a.style(n.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>a.dispose()))}let s=(i=window.scrollY)!=null?i:window.pageYOffset,o=null;e.addEventListener(n,"click",a=>{if(Wy(a.target))try{let c=a.target.closest("a");if(!c)return;let{hash:u}=new URL(c.href),d=n.querySelector(u);Wy(d)&&!r(d)&&(o=d)}catch{}},!0),e.addEventListener(n,"touchstart",a=>{if(Wy(a.target)&&Fje(a.target))if(r(a.target)){let c=a.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;e.style(c,"overscrollBehavior","contain")}else e.style(a.target,"touchAction","none")}),e.addEventListener(n,"touchmove",a=>{if(Wy(a.target)){if(soe(a.target))return;if(r(a.target)){let c=a.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),e.add(()=>{var a;let c=(a=window.scrollY)!=null?a:window.pageYOffset;s!==c&&window.scrollTo(0,s),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function Uze(){return{before({doc:n,d:e}){e.style(n.documentElement,"overflow","hidden")}}}function jze(n){let e={};for(let t of n)Object.assign(e,t(e));return e}let Hy=Bze(()=>new Map,{PUSH(n,e){var t;let r=(t=this.get(n))!=null?t:{doc:n,count:0,d:id(),meta:new Set};return r.count++,r.meta.add(e),this.set(n,r),this},POP(n,e){let t=this.get(n);return t&&(t.count--,t.meta.delete(e)),this},SCROLL_PREVENT({doc:n,d:e,meta:t}){let r={doc:n,d:e,meta:jze(t)},i=[$ze(),Lze(),Uze()];i.forEach(({before:s})=>s==null?void 0:s(r)),i.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});Hy.subscribe(()=>{let n=Hy.getSnapshot(),e=new Map;for(let[t]of n)e.set(t,t.documentElement.style.overflow);for(let t of n.values()){let r=e.get(t.doc)==="hidden",i=t.count!==0;(i&&!r||!i&&r)&&Hy.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&Hy.dispatch("TEARDOWN",t)}});function zze(n,e,t=()=>({containers:[]})){let r=Dze(Hy),i=e?r.get(e):void 0,s=i?i.count>0:!1;return es(()=>{if(!(!e||!n))return Hy.dispatch("PUSH",e,t),()=>Hy.dispatch("POP",e,t)},[n,e]),s}function Fze(n,e,t=()=>[document.body]){let r=moe(n,"scroll-lock");zze(r,e,i=>{var s;return{containers:[...(s=i.containers)!=null?s:[],t]}})}function kG(n){return[n.screenX,n.screenY]}function Wze(){let n=X.useRef([-1,-1]);return{wasMoved(e){let t=kG(e);return n.current[0]===t[0]&&n.current[1]===t[1]?!1:(n.current=t,!0)},update(e){n.current=kG(e)}}}function Hze(n=0){let[e,t]=X.useState(n),r=X.useCallback(c=>t(c),[e]),i=X.useCallback(c=>t(u=>u|c),[e]),s=X.useCallback(c=>(e&c)===c,[e]),o=X.useCallback(c=>t(u=>u&~c),[t]),a=X.useCallback(c=>t(u=>u^c),[t]);return{flags:e,setFlag:r,addFlag:i,hasFlag:s,removeFlag:o,toggleFlag:a}}var Vze={},OG,PG;typeof Ji<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((OG=Ji==null?void 0:Vze)==null?void 0:OG.NODE_ENV)==="test"&&typeof((PG=Element==null?void 0:Element.prototype)==null?void 0:PG.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(` 8319`)),[]});var qze=(n=>(n[n.None=0]="None",n[n.Closed=1]="Closed",n[n.Enter=2]="Enter",n[n.Leave=4]="Leave",n))(qze||{});function xoe(n){let e={};for(let t in n)n[t]===!0&&(e[`data-${t}`]="");return e}function Eoe(n,e,t,r){let[i,s]=X.useState(t),{hasFlag:o,addFlag:a,removeFlag:c}=Hze(n&&i?3:0),u=X.useRef(!1),d=X.useRef(!1),f=E4();return es(()=>{var m;if(n){if(t&&s(!0),!e){t&&a(3);return}return(m=r==null?void 0:r.start)==null||m.call(r,t),Kze(e,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(t?(a(3),c(4)):(a(4),c(2)))},run(){d.current?t?(c(3),a(4)):(c(4),a(3)):t?c(1):a(1)},done(){var w;d.current&&typeof e.getAnimations=="function"&&e.getAnimations().length>0||(u.current=!1,c(7),t||s(!1),(w=r==null?void 0:r.end)==null||w.call(r,t))}})}},[n,t,e,f]),n?[i,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[t,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Kze(n,{prepare:e,run:t,done:r,inFlight:i}){let s=id();return Gze(n,{prepare:e,inFlight:i}),s.nextFrame(()=>{t(),s.requestAnimationFrame(()=>{s.add(Yze(n,r))})}),s.dispose}function Yze(n,e){var t,r;let i=id();if(!n)return i.dispose;let s=!1;i.add(()=>{s=!0});let o=(r=(t=n.getAnimations)==null?void 0:t.call(n).filter(a=>a instanceof CSSTransition))!=null?r:[];return o.length===0?(e(),i.dispose):(Promise.allSettled(o.map(a=>a.finished)).then(()=>{s||e()}),i.dispose)}function Gze(n,{inFlight:e,prepare:t}){if(e!=null&&e.current){t();return}let r=n.style.transition;n.style.transition="none",t(),n.offsetHeight,n.style.transition=r}function Zze(n,{container:e,accept:t,walk:r}){let i=X.useRef(t),s=X.useRef(r);X.useEffect(()=>{i.current=t,s.current=r},[t,r]),es(()=>{if(!e||!n)return;let o=yE(e);if(!o)return;let a=i.current,c=s.current,u=Object.assign(f=>a(f),{acceptNode:a}),d=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)c(d.currentNode)},[e,n,i,s])}function HR(){return typeof window<"u"}function vE(n){return Aoe(n)?(n.nodeName||"").toLowerCase():"#document"}function eu(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Jf(n){var e;return(e=(Aoe(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Aoe(n){return HR()?n instanceof Node||n instanceof eu(n).Node:!1}function yc(n){return HR()?n instanceof Element||n instanceof eu(n).Element:!1}function Hf(n){return HR()?n instanceof HTMLElement||n instanceof eu(n).HTMLElement:!1}function DG(n){return!HR()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof eu(n).ShadowRoot}const Qze=new Set(["inline","contents"]);function A4(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=uh(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!Qze.has(i)}const Xze=new Set(["table","td","th"]);function Jze(n){return Xze.has(vE(n))}const eFe=[":popover-open",":modal"];function VR(n){return eFe.some(e=>{try{return n.matches(e)}catch{return!1}})}const tFe=["transform","translate","scale","rotate","perspective"],nFe=["transform","translate","scale","rotate","perspective","filter"],rFe=["paint","layout","strict","content"];function yj(n){const e=bj(),t=yc(n)?uh(n):n;return tFe.some(r=>t[r]?t[r]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||nFe.some(r=>(t.willChange||"").includes(r))||rFe.some(r=>(t.contain||"").includes(r))}function iFe(n){let e=S0(n);for(;Hf(e)&&!$x(e);){if(yj(e))return e;if(VR(e))return null;e=S0(e)}return null}function bj(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const sFe=new Set(["html","body","#document"]);function $x(n){return sFe.has(vE(n))}function uh(n){return eu(n).getComputedStyle(n)}function qR(n){return yc(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function S0(n){if(vE(n)==="html")return n;const e=n.assignedSlot||n.parentNode||DG(n)&&n.host||Jf(n);return DG(e)?e.host:e}function Soe(n){const e=S0(n);return $x(e)?n.ownerDocument?n.ownerDocument.body:n.body:Hf(e)&&A4(e)?e:Soe(e)}function mC(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=Soe(n),s=i===((r=n.ownerDocument)==null?void 0:r.body),o=eu(i);if(s){const a=sL(o);
vendor: 15,133 bytes, line 8319
8319return e.concat(o,o.visualViewport||[],A4(i)?i:[],a&&t?mC(a):[])}return e.concat(i,mC(i,[],t))}function sL(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function oFe(){const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(e=>{let{brand:t,version:r}=e;return t+"/"+r}).join(" "):navigator.userAgent}const O1=Math.min,qa=Math.max,wC=Math.round,HI=Math.floor,kf=n=>({x:n,y:n}),aFe={left:"right",right:"left",bottom:"top",top:"bottom"},cFe={start:"end",end:"start"};function BG(n,e,t){return qa(n,O1(e,t))}function xE(n,e){return typeof n=="function"?n(e):n}function _0(n){return n.split("-")[0]}function S4(n){return n.split("-")[1]}function _oe(n){return n==="x"?"y":"x"}function Coe(n){return n==="y"?"height":"width"}const lFe=new Set(["top","bottom"]);function eg(n){return lFe.has(_0(n))?"y":"x"}function Toe(n){return _oe(eg(n))}function uFe(n,e,t){t===void 0&&(t=!1);const r=S4(n),i=Toe(n),s=Coe(i);let o=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=l8(o)),[o,l8(o)]}function dFe(n){const e=l8(n);return[oL(n),e,oL(e)]}function oL(n){return n.replace(/start|end/g,e=>cFe[e])}const LG=["left","right"],$G=["right","left"],hFe=["top","bottom"],fFe=["bottom","top"];function pFe(n,e,t){switch(n){case"top":case"bottom":return t?e?$G:LG:e?LG:$G;case"left":case"right":return e?hFe:fFe;default:return[]}}function gFe(n,e,t,r){const i=S4(n);let s=pFe(_0(n),t==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(oL)))),s}function l8(n){return n.replace(/left|right|bottom|top/g,e=>aFe[e])}function mFe(n){return{top:0,right:0,bottom:0,left:0,...n}}function wFe(n){return typeof n!="number"?mFe(n):{top:n,right:n,bottom:n,left:n}}function u8(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function UG(n,e,t){let{reference:r,floating:i}=n;const s=eg(e),o=Toe(e),a=Coe(o),c=_0(e),u=s==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,m=r[a]/2-i[a]/2;let w;switch(c){case"top":w={x:d,y:r.y-i.height};break;case"bottom":w={x:d,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y:f};break;case"left":w={x:r.x-i.width,y:f};break;default:w={x:r.x,y:r.y}}switch(S4(e)){case"start":w[o]-=m*(t&&u?-1:1);break;case"end":w[o]+=m*(t&&u?-1:1);break}return w}const yFe=async(n,e,t)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=t,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:n,floating:e,strategy:i}),{x:d,y:f}=UG(u,r,c),m=r,w={},y=0;for(let b=0;b<a.length;b++){const{name:E,fn:T}=a[b],{x:N,y:I,data:H,reset:L}=await T({x:d,y:f,initialPlacement:r,placement:m,strategy:i,middlewareData:w,rects:u,platform:o,elements:{reference:n,floating:e}});d=N??d,f=I??f,w={...w,[E]:{...w[E],...H}},L&&y<=50&&(y++,typeof L=="object"&&(L.placement&&(m=L.placement),L.rects&&(u=L.rects===!0?await o.getElementRects({reference:n,floating:e,strategy:i}):L.rects),{x:d,y:f}=UG(u,m,c)),b=-1)}return{x:d,y:f,placement:m,strategy:i,middlewareData:w}};async function KR(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:c}=n,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:w=0}=xE(e,n),y=wFe(w),E=a[m?f==="floating"?"reference":"floating":f],T=u8(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(E)))==null||t?E:E.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),N=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,I=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),H=await(s.isElement==null?void 0:s.isElement(I))?await(s.getScale==null?void 0:s.getScale(I))||{x:1,y:1}:{x:1,y:1},L=u8(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:N,offsetParent:I,strategy:c}):N);return{top:(T.top-L.top+y.top)/H.y,bottom:(L.bottom-T.bottom+y.bottom)/H.y,left:(T.left-L.left+y.left)/H.x,right:(L.right-T.right+y.right)/H.x}}const bFe=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...E}=xE(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const T=_0(i),N=eg(a),I=_0(a)===a,H=await(c.isRTL==null?void 0:c.isRTL(u.floating)),L=m||(I||!b?[l8(a)]:dFe(a)),U=y!=="none";!m&&U&&L.push(...gFe(a,b,y,H));const K=[a,...L],Y=await KR(e,E),k=[];let j=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&k.push(Y[T]),f){const A=uFe(i,o,H);k.push(Y[A[0]],Y[A[1]])}if(j=[...j,{placement:i,overflows:k}],!k.every(A=>A<=0)){var V,W;const A=(((V=s.flip)==null?void 0:V.index)||0)+1,_=K[A];if(_&&(!(f==="alignment"?N!==eg(_):!1)||j.every(q=>eg(q.placement)===N?q.overflows[0]>0:!0)))return{data:{index:A,overflows:j},reset:{placement:_}};let R=(W=j.filter(P=>P.overflows[0]<=0).sort((P,q)=>P.overflows[1]-q.overflows[1])[0])==null?void 0:W.placement;if(!R)switch(w){case"bestFit":{var $;const P=($=j.filter(q=>{if(U){const F=eg(q.placement);return F===N||F==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(F=>F>0).reduce((F,z)=>F+z,0)]).sort((q,F)=>q[1]-F[1])[0])==null?void 0:$[0];P&&(R=P);break}case"initialPlacement":R=a;break}if(i!==R)return{reset:{placement:R}}}return{}}}},vFe=new Set(["left","top"]);async function xFe(n,e){const{placement:t,platform:r,elements:i}=n,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_0(t),a=S4(t),c=eg(t)==="y",u=vFe.has(o)?-1:1,d=s&&c?-1:1,f=xE(e,n);let{mainAxis:m,crossAxis:w,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof y=="number"&&(w=a==="end"?y*-1:y),c?{x:w*d,y:m*u}:{x:m*u,y:w*d}}const EFe=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await xFe(e,n);return o===((t=a.offset)==null?void 0:t.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},AFe=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:E=>{let{x:T,y:N}=E;return{x:T,y:N}}},...c}=xE(n,e),u={x:t,y:r},d=await KR(e,c),f=eg(_0(i)),m=_oe(f);let w=u[m],y=u[f];if(s){const E=m==="y"?"top":"left",T=m==="y"?"bottom":"right",N=w+d[E],I=w-d[T];w=BG(N,w,I)}if(o){const E=f==="y"?"top":"left",T=f==="y"?"bottom":"right",N=y+d[E],I=y-d[T];y=BG(N,y,I)}const b=a.fn({...e,[m]:w,[f]:y});return{...b,data:{x:b.x-t,y:b.y-r,enabled:{[m]:s,[f]:o}}}}}},SFe=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:c=()=>{},...u}=xE(n,e),d=await KR(e,u),f=_0(i),m=S4(i),w=eg(i)==="y",{width:y,height:b}=s.floating;let E,T;f==="top"||f==="bottom"?(E=f,T=m===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(T=f,E=m==="end"?"top":"bottom");const N=b-d.top-d.bottom,I=y-d.left-d.right,H=O1(b-d[E],N),L=O1(y-d[T],I),U=!e.middlewareData.shift;let K=H,Y=L;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(Y=I),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(K=N),U&&!m){const j=qa(d.left,0),V=qa(d.right,0),W=qa(d.top,0),$=qa(d.bottom,0);w?Y=y-2*(j!==0||V!==0?j+V:qa(d.left,d.right)):K=b-2*(W!==0||$!==0?W+$:qa(d.top,d.bottom))}await c({...e,availableWidth:Y,availableHeight:K});const k=await o.getDimensions(a.floating);return y!==k.width||b!==k.height?{reset:{rects:!0}}:{}}}};function Ioe(n){const e=uh(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Hf(n),s=i?n.offsetWidth:t,o=i?n.offsetHeight:r,a=wC(t)!==s||wC(r)!==o;return a&&(t=s,r=o),{width:t,height:r,$:a}}function vj(n){return yc(n)?n:n.contextElement}function tx(n){const e=vj(n);if(!Hf(e))return kf(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:s}=Ioe(e);let o=(s?wC(t.width):t.width)/r,a=(s?wC(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const _Fe=kf(0);function Noe(n){const e=eu(n);return!bj()||!e.visualViewport?_Fe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function CFe(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==eu(n)?!1:e}function P1(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),s=vj(n);let o=kf(1);e&&(r?yc(r)&&(o=tx(r)):o=tx(n));const a=CFe(s,t,r)?Noe(s):kf(0);let c=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(s){const m=eu(s),w=r&&yc(r)?eu(r):r;let y=m,b=sL(y);for(;b&&r&&w!==y;){const E=tx(b),T=b.getBoundingClientRect(),N=uh(b),I=T.left+(b.clientLeft+parseFloat(N.paddingLeft))*E.x,H=T.top+(b.clientTop+parseFloat(N.paddingTop))*E.y;c*=E.x,u*=E.y,d*=E.x,f*=E.y,c+=I,u+=H,y=eu(b),b=sL(y)}}return u8({width:d,height:f,x:c,y:u})}function xj(n,e){const t=qR(n).scrollLeft;return e?e.left+t:P1(Jf(n)).left+t}function Roe(n,e,t){t===void 0&&(t=!1);const r=n.getBoundingClientRect(),i=r.left+e.scrollLeft-(t?0:xj(n,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function TFe(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const s=i==="fixed",o=Jf(r),a=e?VR(e.floating):!1;if(r===o||a&&s)return t;let c={scrollLeft:0,scrollTop:0},u=kf(1);const d=kf(0),f=Hf(r);if((f||!f&&!s)&&((vE(r)!=="body"||A4(o))&&(c=qR(r)),Hf(r))){const w=P1(r);u=tx(r),d.x=w.x+r.clientLeft,d.y=w.y+r.clientTop}const m=o&&!f&&!s?Roe(o,c,!0):kf(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+d.x+m.x,y:t.y*u.y-c.scrollTop*u.y+d.y+m.y}}function IFe(n){return Array.from(n.getClientRects())}function NFe(n){const e=Jf(n),t=qR(n),r=n.ownerDocument.body,i=qa(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=qa(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-t.scrollLeft+xj(n);const a=-t.scrollTop;return uh(r).direction==="rtl"&&(o+=qa(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function RFe(n,e){const t=eu(n),r=Jf(n),i=t.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const u=bj();(!u||u&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}const MFe=new Set(["absolute","fixed"]);function kFe(n,e){const t=P1(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,s=Hf(n)?tx(n):kf(1),o=n.clientWidth*s.x,a=n.clientHeight*s.y,c=i*s.x,u=r*s.y;return{width:o,height:a,x:c,y:u}}function jG(n,e,t){let r;if(e==="viewport")r=RFe(n,t);else if(e==="document")r=NFe(Jf(n));else if(yc(e))r=kFe(e,t);else{const i=Noe(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return u8(r)}function Moe(n,e){const t=S0(n);return t===e||!yc(t)||$x(t)?!1:uh(t).position==="fixed"||Moe(t,e)}function OFe(n,e){const t=e.get(n);if(t)return t;let r=mC(n,[],!1).filter(a=>yc(a)&&vE(a)!=="body"),i=null;const s=uh(n).position==="fixed";let o=s?S0(n):n;for(;yc(o)&&!$x(o);){const a=uh(o),c=yj(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&MFe.has(i.position)||A4(o)&&!c&&Moe(n,o))?r=r.filter(d=>d!==o):i=a,o=S0(o)}return e.set(n,r),r}function PFe(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=[...t==="clippingAncestors"?VR(e)?[]:OFe(e,this._c):[].concat(t),r],a=o[0],c=o.reduce((u,d)=>{const f=jG(e,d,i);return u.top=qa(f.top,u.top),u.right=O1(f.right,u.right),u.bottom=O1(f.bottom,u.bottom),u.left=qa(f.left,u.left),u},jG(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function DFe(n){const{width:e,height:t}=Ioe(n);return{width:e,height:t}}function BFe(n,e,t){const r=Hf(e),i=Jf(e),s=t==="fixed",o=P1(n,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=kf(0);function u(){c.x=xj(i)}if(r||!r&&!s)if((vE(e)!=="body"||A4(i))&&(a=qR(e)),r){const w=P1(e,!0,s,e);c.x=w.x+e.clientLeft,c.y=w.y+e.clientTop}else i&&u();s&&!r&&i&&u();const d=i&&!r&&!s?Roe(i,a):kf(0),f=o.left+a.scrollLeft-c.x-d.x,m=o.top+a.scrollTop-c.y-d.y;return{x:f,y:m,width:o.width,height:o.height}}function P9(n){return uh(n).position==="static"}function zG(n,e){if(!Hf(n)||uh(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Jf(n)===t&&(t=t.ownerDocument.body),t}function koe(n,e){const t=eu(n);if(VR(n))return t;if(!Hf(n)){let i=S0(n);for(;i&&!$x(i);){if(yc(i)&&!P9(i))return i;i=S0(i)}return t}let r=zG(n,e);for(;r&&Jze(r)&&P9(r);)r=zG(r,e);return r&&$x(r)&&P9(r)&&!yj(r)?t:r||iFe(n)||t}const LFe=async function(n){const e=this.getOffsetParent||koe,t=this.getDimensions,r=await t(n.floating);return{reference:BFe(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $Fe(n){return uh(n).direction==="rtl"}const UFe={convertOffsetParentRelativeRectToViewportRelativeRect:TFe,getDocumentElement:Jf,getClippingRect:PFe,getOffsetParent:koe,getElementRects:LFe,getClientRects:IFe,getDimensions:DFe,getScale:tx,isElement:yc,isRTL:$Fe};function Ooe(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function jFe(n,e){let t=null,r;const i=Jf(n);function s(){var a;clearTimeout(r),(a=t)==null||a.disconnect(),t=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=n.getBoundingClientRect(),{left:d,top:f,width:m,height:w}=u;if(a||e(),!m||!w)return;const y=HI(f),b=HI(i.clientWidth-(d+m)),E=HI(i.clientHeight-(f+w)),T=HI(d),I={rootMargin:-y+"px "+-b+"px "+-E+"px "+-T+"px",threshold:qa(0,O1(1,c))||1};let H=!0;function L(U){const K=U[0].intersectionRatio;if(K!==c){if(!H)return o();K?o(!1,K):r=setTimeout(()=>{o(!1,1e-7)},1e3)}K===1&&!Ooe(u,n.getBoundingClientRect())&&o(),H=!1}try{t=new IntersectionObserver(L,{...I,root:i.ownerDocument})}catch{t=new IntersectionObserver(L,I)}t.observe(n)}return o(!0),s}function zFe(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=vj(n),d=i||s?[...u?mC(u):[],...mC(e)]:[];d.forEach(T=>{i&&T.addEventListener("scroll",t,{passive:!0}),s&&T.addEventListener("resize",t)});const f=u&&a?jFe(u,t):null;let m=-1,w=null;o&&(w=new ResizeObserver(T=>{let[N]=T;N&&N.target===u&&w&&(w.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var I;(I=w)==null||I.observe(e)})),t()}),u&&!c&&w.observe(u),w.observe(e));let y,b=c?P1(n):null;c&&E();function E(){const T=P1(n);b&&!Ooe(b,T)&&t(),b=T,y=requestAnimationFrame(E)}return t(),()=>{var T;d.forEach(N=>{i&&N.removeEventListener("scroll",t),s&&N.removeEventListener("resize",t)}),f==null||f(),(T=w)==null||T.disconnect(),w=null,c&&cancelAnimationFrame(y)}}const D9=KR,FFe=EFe,WFe=AFe,HFe=bFe,VFe=SFe,qFe=(n,e,t)=>{const r=new Map,i={platform:UFe,...t},s={...i.platform,_c:r};return yFe(n,e,{...i,platform:s})};var KFe=typeof document<"u",YFe=function(){},M6=KFe?X.useLayoutEffect:YFe;function d8(n,e){if(n===e)return!0;
8319if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!==0;)if(!d8(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!==0;){const s=i[r];if(!(s==="_owner"&&n.$$typeof)&&!d8(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function Poe(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function FG(n,e){const t=Poe(n);return Math.round(e*t)/t}function B9(n){const e=X.useRef(n);return M6(()=>{e.current=n}),e}function GFe(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:u}=n,[d,f]=X.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[m,w]=X.useState(r);d8(m,r)||w(r);const[y,b]=X.useState(null),[E,T]=X.useState(null),N=X.useCallback(q=>{q!==U.current&&(U.current=q,b(q))},[]),I=X.useCallback(q=>{q!==K.current&&(K.current=q,T(q))},[]),H=s||y,L=o||E,U=X.useRef(null),K=X.useRef(null),Y=X.useRef(d),k=c!=null,j=B9(c),V=B9(i),W=B9(u),$=X.useCallback(()=>{if(!U.current||!K.current)return;const q={placement:e,strategy:t,middleware:m};V.current&&(q.platform=V.current),qFe(U.current,K.current,q).then(F=>{const z={...F,isPositioned:W.current!==!1};A.current&&!d8(Y.current,z)&&(Y.current=z,y0.flushSync(()=>{f(z)}))})},[m,e,t,V,W]);M6(()=>{u===!1&&Y.current.isPositioned&&(Y.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[u]);const A=X.useRef(!1);M6(()=>(A.current=!0,()=>{A.current=!1}),[]),M6(()=>{if(H&&(U.current=H),L&&(K.current=L),H&&L){if(j.current)return j.current(H,L,$);$()}},[H,L,$,j,k]);const _=X.useMemo(()=>({reference:U,floating:K,setReference:N,setFloating:I}),[N,I]),R=X.useMemo(()=>({reference:H,floating:L}),[H,L]),P=X.useMemo(()=>{const q={position:t,left:0,top:0};if(!R.floating)return q;const F=FG(R.floating,d.x),z=FG(R.floating,d.y);return a?{...q,transform:"translate("+F+"px, "+z+"px)",...Poe(R.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:F,top:z}},[t,a,R.floating,d.x,d.y]);return X.useMemo(()=>({...d,update:$,refs:_,elements:R,floatingStyles:P}),[d,$,_,R,P])}const Doe=(n,e)=>({...FFe(n),options:[n,e]}),ZFe=(n,e)=>({...WFe(n),options:[n,e]}),QFe=(n,e)=>({...HFe(n),options:[n,e]}),XFe=(n,e)=>({...VFe(n),options:[n,e]}),Boe={...xX},JFe=Boe.useInsertionEffect,eWe=JFe||(n=>n());function Loe(n){const e=X.useRef(()=>{});return eWe(()=>{e.current=n}),X.useCallback(function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}var aL=typeof document<"u"?X.useLayoutEffect:X.useEffect;let WG=!1,tWe=0;const HG=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+tWe++;function nWe(){const[n,e]=X.useState(()=>WG?HG():void 0);return aL(()=>{n==null&&e(HG())},[]),X.useEffect(()=>{WG=!0},[]),n}const rWe=Boe.useId,iWe=rWe||nWe;function sWe(){const n=new Map;return{emit(e,t){var r;(r=n.get(e))==null||r.forEach(i=>i(t))},on(e,t){n.set(e,[...n.get(e)||[],t])},off(e,t){var r;n.set(e,((r=n.get(e))==null?void 0:r.filter(i=>i!==t))||[])}}}const oWe=X.createContext(null),aWe=X.createContext(null),cWe=()=>{var n;return((n=X.useContext(oWe))==null?void 0:n.id)||null},lWe=()=>X.useContext(aWe),uWe="data-floating-ui-focusable";function dWe(n){const{open:e=!1,onOpenChange:t,elements:r}=n,i=iWe(),s=X.useRef({}),[o]=X.useState(()=>sWe()),a=cWe()!=null,[c,u]=X.useState(r.reference),d=Loe((w,y,b)=>{s.current.openEvent=w?y:void 0,o.emit("openchange",{open:w,event:y,reason:b,nested:a}),t==null||t(w,y,b)}),f=X.useMemo(()=>({setPositionReference:u}),[]),m=X.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return X.useMemo(()=>({dataRef:s,open:e,onOpenChange:d,elements:m,events:o,floatingId:i,refs:f}),[e,d,m,o,i,f])}function hWe(n){n===void 0&&(n={});const{nodeId:e}=n,t=dWe({...n,elements:{reference:null,floating:null,...n.elements}}),r=n.rootContext||t,i=r.elements,[s,o]=X.useState(null),[a,c]=X.useState(null),d=(i==null?void 0:i.domReference)||s,f=X.useRef(null),m=lWe();aL(()=>{d&&(f.current=d)},[d]);const w=GFe({...n,elements:{...i,...a&&{reference:a}}}),y=X.useCallback(I=>{const H=yc(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c(H),w.refs.setReference(H)},[w.refs]),b=X.useCallback(I=>{(yc(I)||I===null)&&(f.current=I,o(I)),(yc(w.refs.reference.current)||w.refs.reference.current===null||I!==null&&!yc(I))&&w.refs.setReference(I)},[w.refs]),E=X.useMemo(()=>({...w.refs,setReference:b,setPositionReference:y,domReference:f}),[w.refs,b,y]),T=X.useMemo(()=>({...w.elements,domReference:d}),[w.elements,d]),N=X.useMemo(()=>({...w,...r,refs:E,elements:T,nodeId:e}),[w,E,T,e,r]);return aL(()=>{r.dataRef.current.floatingContext=N;const I=m==null?void 0:m.nodesRef.current.find(H=>H.id===e);I&&(I.context=N)}),X.useMemo(()=>({...w,context:N,refs:E,elements:T}),[w,E,T,N])}const VG="active",qG="selected";function L9(n,e,t){const r=new Map,i=t==="item";let s=n;if(i&&n){const{[VG]:o,[qG]:a,...c}=n;s=c}return{...t==="floating"&&{tabIndex:-1,[uWe]:""},...s,...e.map(o=>{const a=o?o[t]:null;return typeof a=="function"?n?a(n):null:a}).concat(n).reduce((o,a)=>
vendor: 9,294 bytes, line 8319
8319(a&&Object.entries(a).forEach(c=>{let[u,d]=c;if(!(i&&[VG,qG].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 m,w=arguments.length,y=new Array(w),b=0;b<w;b++)y[b]=arguments[b];return(m=r.get(u))==null?void 0:m.map(E=>E(...y)).find(E=>E!==void 0)}}}else o[u]=d}),o),{})}}function fWe(n){n===void 0&&(n=[]);const e=n.map(a=>a==null?void 0:a.reference),t=n.map(a=>a==null?void 0:a.floating),r=n.map(a=>a==null?void 0:a.item),i=X.useCallback(a=>L9(a,n,"reference"),e),s=X.useCallback(a=>L9(a,n,"floating"),t),o=X.useCallback(a=>L9(a,n,"item"),r);return X.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:o}),[i,s,o])}function KG(n,e){return{...n,rects:{...n.rects,floating:{...n.rects.floating,height:e}}}}const pWe=n=>({name:"inner",options:n,async fn(e){const{listRef:t,overflowRef:r,onFallbackChange:i,offset:s=0,index:o=0,minItemsVisible:a=4,referenceOverflowThreshold:c=0,scrollRef:u,...d}=xE(n,e),{rects:f,elements:{floating:m}}=e,w=t.current[o],y=(u==null?void 0:u.current)||m,b=m.clientTop||y.clientTop,E=m.clientTop!==0,T=y.clientTop!==0,N=m===y;if(!w)return{};const I={...e,...await Doe(-w.offsetTop-m.clientTop-f.reference.height/2-w.offsetHeight/2-s).fn(e)},H=await D9(KG(I,y.scrollHeight+b+m.clientTop),d),L=await D9(I,{...d,elementContext:"reference"}),U=qa(0,H.top),K=I.y+U,j=(y.scrollHeight>y.clientHeight?V=>V:wC)(qa(0,y.scrollHeight+(E&&N||T?b*2:0)-U-qa(0,H.bottom)));if(y.style.maxHeight=j+"px",y.scrollTop=U,i){const V=y.offsetHeight<w.offsetHeight*O1(a,t.current.length)-1||L.top>=-c||L.bottom>=-c;y0.flushSync(()=>i(V))}return r&&(r.current=await D9(KG({...I,y:K},y.offsetHeight+b+m.clientTop),d)),{y:K}}});function gWe(n,e){const{open:t,elements:r}=n,{enabled:i=!0,overflowRef:s,scrollRef:o,onChange:a}=e,c=Loe(a),u=X.useRef(!1),d=X.useRef(null),f=X.useRef(null);X.useEffect(()=>{if(!i)return;function w(b){if(b.ctrlKey||!y||s.current==null)return;const E=b.deltaY,T=s.current.top>=-.5,N=s.current.bottom>=-.5,I=y.scrollHeight-y.clientHeight,H=E<0?-1:1,L=E<0?"max":"min";y.scrollHeight<=y.clientHeight||(!T&&E>0||!N&&E<0?(b.preventDefault(),y0.flushSync(()=>{c(U=>U+Math[L](E,I*H))})):/firefox/i.test(oFe())&&(y.scrollTop+=E))}const y=(o==null?void 0:o.current)||r.floating;if(t&&y)return y.addEventListener("wheel",w),requestAnimationFrame(()=>{d.current=y.scrollTop,s.current!=null&&(f.current={...s.current})}),()=>{d.current=null,f.current=null,y.removeEventListener("wheel",w)}},[i,t,r.floating,s,o,c]);const m=X.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const w=(o==null?void 0:o.current)||r.floating;if(!(!s.current||!w||!u.current)){if(d.current!==null){const y=w.scrollTop-d.current;(s.current.bottom<-.5&&y<-1||s.current.top<-.5&&y>1)&&y0.flushSync(()=>c(b=>b+y))}requestAnimationFrame(()=>{d.current=w.scrollTop})}}}),[r.floating,c,s,o]);return X.useMemo(()=>i?{floating:m}:{},[i,m])}let EE=X.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});EE.displayName="FloatingContext";let Ej=X.createContext(null);Ej.displayName="PlacementContext";function mWe(n){return X.useMemo(()=>n?typeof n=="string"?{to:n}:n:null,[n])}function wWe(){return X.useContext(EE).setReference}function yWe(){return X.useContext(EE).getReferenceProps}function bWe(){let{getFloatingProps:n,slot:e}=X.useContext(EE);return X.useCallback((...t)=>Object.assign({},n(...t),{"data-anchor":e.anchor}),[n,e])}function vWe(n=null){n===!1&&(n=null),typeof n=="string"&&(n={to:n});let e=X.useContext(Ej),t=X.useMemo(()=>n,[JSON.stringify(n,(i,s)=>{var o;return(o=s==null?void 0:s.outerHTML)!=null?o:s})]);es(()=>{e==null||e(t??null)},[e,t]);let r=X.useContext(EE);return X.useMemo(()=>[r.setFloating,n?r.styles:{}],[r.setFloating,n,r.styles])}let YG=4;function xWe({children:n,enabled:e=!0}){let[t,r]=X.useState(null),[i,s]=X.useState(0),o=X.useRef(null),[a,c]=X.useState(null);EWe(a);let u=e&&t!==null&&a!==null,{to:d="bottom",gap:f=0,offset:m=0,padding:w=0,inner:y}=AWe(t,a),[b,E="center"]=d.split(" ");es(()=>{u&&s(0)},[u]);let{refs:T,floatingStyles:N,context:I}=hWe({open:u,placement:b==="selection"?E==="center"?"bottom":`bottom-${E}`:E==="center"?`${b}`:`${b}-${E}`,strategy:"absolute",transform:!1,middleware:[Doe({mainAxis:b==="selection"?0:f,crossAxis:m}),ZFe({padding:w}),b!=="selection"&&QFe({padding:w}),b==="selection"&&y?pWe({...y,padding:w,overflowRef:o,offset:i,minItemsVisible:YG,referenceOverflowThreshold:w,onFallbackChange(V){var W,$;if(!V)return;let A=I.elements.floating;if(!A)return;let _=parseFloat(getComputedStyle(A).scrollPaddingBottom)||0,R=Math.min(YG,A.childElementCount),P=0,q=0;for(let F of($=(W=I.elements.floating)==null?void 0:W.childNodes)!=null?$:[])if(Rg(F)){let z=F.offsetTop,B=z+F.clientHeight+_,C=A.scrollTop,M=C+A.clientHeight;if(z>=C&&B<=M)R--;else{q=Math.max(0,Math.min(B,M)-Math.max(z,C)),P=F.clientHeight;break}}R>=1&&s(F=>{let z=P*R-q+_;return F>=z?F:z})}}):null,XFe({padding:w,apply({availableWidth:V,availableHeight:W,elements:$}){Object.assign($.floating.style,{overflow:"auto",maxWidth:`${V}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${W}px)`})}})].filter(Boolean),whileElementsMounted:zFe}),[H=b,L=E]=I.placement.split("-");b==="selection"&&(H="selection");let U=X.useMemo(()=>({anchor:[H,L].filter(Boolean).join(" ")}),[H,L]),K=gWe(I,{overflowRef:o,onChange:s}),{getReferenceProps:Y,getFloatingProps:k}=fWe([K]),j=Nr(V=>{c(V),T.setFloating(V)});return X.createElement(Ej.Provider,{value:r},X.createElement(EE.Provider,{value:{setFloating:j,setReference:T.setReference,styles:N,getReferenceProps:Y,getFloatingProps:k,slot:U}},n))}function EWe(n){es(()=>{if(!n)return;let e=new MutationObserver(()=>{let t=window.getComputedStyle(n).maxHeight,r=parseFloat(t);if(isNaN(r))return;let i=parseInt(t);isNaN(i)||r!==i&&(n.style.maxHeight=`${Math.ceil(r)}px`)});return e.observe(n,{attributes:!0,attributeFilter:["style"]}),()=>{e.disconnect()}},[n])}function AWe(n,e){var t,r,i;let s=$9((t=n==null?void 0:n.gap)!=null?t:"var(--anchor-gap, 0)",e),o=$9((r=n==null?void 0:n.offset)!=null?r:"var(--anchor-offset, 0)",e),a=$9((i=n==null?void 0:n.padding)!=null?i:"var(--anchor-padding, 0)",e);return{...n,gap:s,offset:o,padding:a}}function $9(n,e,t=void 0){let r=E4(),i=Nr((c,u)=>{if(c==null)return[t,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!u)return[t,null];let d=GG(c,u);return[d,f=>{let m=$oe(c);{let w=m.map(y=>window.getComputedStyle(u).getPropertyValue(y));r.requestAnimationFrame(function y(){r.nextFrame(y);let b=!1;for(let[T,N]of m.entries()){let I=window.getComputedStyle(u).getPropertyValue(N);if(w[T]!==I){w[T]=I,b=!0;break}}if(!b)return;let E=GG(c,u);d!==E&&(f(E),d=E)})}return r.dispose}]}return[t,null]}),s=X.useMemo(()=>i(n,e)[0],[n,e]),[o=s,a]=X.useState();return es(()=>{let[c,u]=i(n,e);if(a(c),!!u)return u(a)},[n,e]),o}function $oe(n){let e=/var\((.*)\)/.exec(n);if(e){let t=e[1].indexOf(",");if(t===-1)return[e[1]];let r=e[1].slice(0,t).trim(),i=e[1].slice(t+1).trim();return i?[r,...$oe(i)]:[r]}return[]}function GG(n,e){let t=document.createElement("div");e.appendChild(t),t.style.setProperty("margin-top","0px","important"),t.style.setProperty("margin-top",n,"important");let r=parseFloat(window.getComputedStyle(t).marginTop)||0;return e.removeChild(t),r}let Aj=X.createContext(null);Aj.displayName="OpenClosedContext";var Kd=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(Kd||{});function Sj(){return X.useContext(Aj)}function Uoe({value:n,children:e}){return Qn.createElement(Aj.Provider,{value:n},e)}function SWe(n){throw new Error("Unexpected object: "+n)}var ho=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(ho||{});function VI(n,e){let t=e.resolveItems();if(t.length<=0)return null;let r=e.resolveActiveIndex(),i=r??-1;switch(n.focus){case 0:{for(let s=0;s<t.length;++s)if(!e.resolveDisabled(t[s],s,t))return s;return r}case 1:{i===-1&&(i=t.length);for(let s=i-1;s>=0;--s)if(!e.resolveDisabled(t[s],s,t))return s;return r}case 2:{for(let s=i+1;s<t.length;++s)if(!e.resolveDisabled(t[s],s,t))return s;return r}case 3:{for(let s=t.length-1;s>=0;--s)if(!e.resolveDisabled(t[s],s,t))return s;return r}case 4:{for(let s=0;s<t.length;++s)if(e.resolveId(t[s],s,t)===n.id)return s;return r}case 5:return null;default:SWe(n)}}var joe=(n=>(n[n.Left=0]="Left",n[n.Right=2]="Right",n))(joe||{});function zoe(n){let e=Nr(n),t=X.useRef(!1);X.useEffect(()=>(t.current=!1,()=>{t.current=!0,toe(()=>{t.current&&e()})}),[e])}function _We(){let n=typeof document>"u";return(e=>e.useSyncExternalStore)(xX)(()=>()=>{},()=>!1,()=>!n)}function _j(){let n=_We(),[e,t]=X.useState(Mf.isHandoffComplete);return e&&Mf.isHandoffComplete===!1&&t(!1),X.useEffect(()=>{e!==!0&&t(!0)},[e]),X.useEffect(()=>Mf.handoff(),[]),n?!1:e}let CWe=X.createContext(!1);function TWe(){return X.useContext(CWe)}function IWe(n){let e=TWe(),t=X.useContext(Woe),[r,i]=X.useState(()=>{var s;if(!e&&t!==null)return(s=t.current)!=null?s:null;if(Mf.isServer)return null;let o=n==null?void 0:n.getElementById("headlessui-portal-root");
vendor: 4,097 bytes, line 8319
8319if(o)return o;if(n===null)return null;let a=n.createElement("div");return a.setAttribute("id","headlessui-portal-root"),n.body.appendChild(a)});return X.useEffect(()=>{r!==null&&(n!=null&&n.body.contains(r)||n==null||n.body.appendChild(r))},[r,n]),X.useEffect(()=>{e||t!==null&&i(t.current)},[t,i,e]),r}let Foe=X.Fragment,NWe=Rc(function(n,e){let{ownerDocument:t=null,...r}=n,i=X.useRef(null),s=vh(Yje(w=>{i.current=w}),e),o=iL(i),a=t??o,c=IWe(a),[u]=X.useState(()=>{var w;return Mf.isServer?null:(w=a==null?void 0:a.createElement("div"))!=null?w:null}),d=X.useContext(OWe),f=_j();es(()=>{!c||!u||c.contains(u)||(u.setAttribute("data-headlessui-portal",""),c.appendChild(u))},[c,u]),es(()=>{if(u&&d)return d.register(u)},[d,u]),zoe(()=>{var w;!c||!u||(hj(u)&&c.contains(u)&&c.removeChild(u),c.childNodes.length<=0&&((w=c.parentElement)==null||w.removeChild(c)))});let m=Al();return f?!c||!u?null:y0.createPortal(m({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:Foe,name:"Portal"}),u):null});function RWe(n,e){let t=vh(e),{enabled:r=!0,ownerDocument:i,...s}=n,o=Al();return r?Qn.createElement(NWe,{...s,ownerDocument:i,ref:t}):o({ourProps:{ref:t},theirProps:s,slot:{},defaultTag:Foe,name:"Portal"})}let MWe=X.Fragment,Woe=X.createContext(null);function kWe(n,e){let{target:t,...r}=n,i={ref:vh(e)},s=Al();return Qn.createElement(Woe.Provider,{value:t},s({ourProps:i,theirProps:r,defaultTag:MWe,name:"Popover.Group"}))}let OWe=X.createContext(null),PWe=Rc(RWe),DWe=Rc(kWe),BWe=Object.assign(PWe,{Group:DWe});function LWe(){let n=X.useRef(!1);return es(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Hoe(n){var e;return!!(n.enter||n.enterFrom||n.enterTo||n.leave||n.leaveFrom||n.leaveTo)||((e=n.as)!=null?e:qoe)!==X.Fragment||Qn.Children.count(n.children)===1}let YR=X.createContext(null);YR.displayName="TransitionContext";var $We=(n=>(n.Visible="visible",n.Hidden="hidden",n))($We||{});function UWe(){let n=X.useContext(YR);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function jWe(){let n=X.useContext(GR);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let GR=X.createContext(null);GR.displayName="NestingContext";function ZR(n){return"children"in n?ZR(n.children):n.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Voe(n,e){let t=bE(n),r=X.useRef([]),i=LWe(),s=E4(),o=Nr((w,y=n0.Hidden)=>{let b=r.current.findIndex(({el:E})=>E===w);b!==-1&&($0(y,{[n0.Unmount](){r.current.splice(b,1)},[n0.Hidden](){r.current[b].state="hidden"}}),s.microTask(()=>{var E;!ZR(r)&&i.current&&((E=t.current)==null||E.call(t))}))}),a=Nr(w=>{let y=r.current.find(({el:b})=>b===w);return y?y.state!=="visible"&&(y.state="visible"):r.current.push({el:w,state:"visible"}),()=>o(w,n0.Unmount)}),c=X.useRef([]),u=X.useRef(Promise.resolve()),d=X.useRef({enter:[],leave:[]}),f=Nr((w,y,b)=>{c.current.splice(0),e&&(e.chains.current[y]=e.chains.current[y].filter(([E])=>E!==w)),e==null||e.chains.current[y].push([w,new Promise(E=>{c.current.push(E)})]),e==null||e.chains.current[y].push([w,new Promise(E=>{Promise.all(d.current[y].map(([T,N])=>N)).then(()=>E())})]),y==="enter"?u.current=u.current.then(()=>e==null?void 0:e.wait.current).then(()=>b(y)):b(y)}),m=Nr((w,y,b)=>{Promise.all(d.current[y].splice(0).map(([E,T])=>T)).then(()=>{var E;(E=c.current.shift())==null||E()}).then(()=>b(y))});return X.useMemo(()=>({children:r,register:a,unregister:o,onStart:f,onStop:m,wait:u,chains:d}),[a,o,r,f,m,d,u])}let qoe=X.Fragment,Koe=c8.RenderStrategy;function zWe(n,e){var t,r;let{transition:i=!0,beforeEnter:s,afterEnter:o,beforeLeave:a,afterLeave:c,enter:u,enterFrom:d,enterTo:f,entered:m,leave:w,leaveFrom:y,leaveTo:b,...E}=n,[T,N]=X.useState(null),I=X.useRef(null),H=Hoe(n),L=vh(...H?[I,e,N]:e===null?[]:[e]),U=(t=E.unmount)==null||t?n0.Unmount:n0.Hidden,{show:K,appear:Y,initial:k}=UWe(),[j,V]=X.useState(K?"visible":"hidden"),W=jWe(),{register:$,unregister:A}=W;es(()=>$(I),[$,I]),es(()=>
vendor: 2,427 bytes, line 8319
8319{if(U===n0.Hidden&&I.current){if(K&&j!=="visible"){V("visible");return}return $0(j,{hidden:()=>A(I),visible:()=>$(I)})}},[j,I,$,A,K,U]);let _=_j();es(()=>{if(H&&_&&j==="visible"&&I.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[I,j,_,H]);let R=k&&!Y,P=Y&&K&&k,q=X.useRef(!1),F=Voe(()=>{q.current||(V("hidden"),A(I))},W),z=Nr(we=>{q.current=!0;let he=we?"enter":"leave";F.onStart(I,he,xe=>{xe==="enter"?s==null||s():xe==="leave"&&(a==null||a())})}),B=Nr(we=>{let he=we?"enter":"leave";q.current=!1,F.onStop(I,he,xe=>{xe==="enter"?o==null||o():xe==="leave"&&(c==null||c())}),he==="leave"&&!ZR(F)&&(V("hidden"),A(I))});X.useEffect(()=>{H&&i||(z(K),B(K))},[K,H,i]);let C=!(!i||!H||!_||R),[,M]=Eoe(C,T,K,{start:z,end:B}),Z=gy({ref:L,className:((r=eL(E.className,P&&u,P&&d,M.enter&&u,M.enter&&M.closed&&d,M.enter&&!M.closed&&f,M.leave&&w,M.leave&&!M.closed&&y,M.leave&&M.closed&&b,!M.transition&&K&&m))==null?void 0:r.trim())||void 0,...xoe(M)}),J=0;j==="visible"&&(J|=Kd.Open),j==="hidden"&&(J|=Kd.Closed),K&&j==="hidden"&&(J|=Kd.Opening),!K&&j==="visible"&&(J|=Kd.Closing);let ae=Al();return Qn.createElement(GR.Provider,{value:F},Qn.createElement(Uoe,{value:J},ae({ourProps:Z,theirProps:E,defaultTag:qoe,features:Koe,visible:j==="visible",name:"Transition.Child"})))}function FWe(n,e){let{show:t,appear:r=!1,unmount:i=!0,...s}=n,o=X.useRef(null),a=Hoe(n),c=vh(...a?[o,e]:e===null?[]:[e]);_j();let u=Sj();if(t===void 0&&u!==null&&(t=(u&Kd.Open)===Kd.Open),t===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,f]=X.useState(t?"visible":"hidden"),m=Voe(()=>{t||f("hidden")}),[w,y]=X.useState(!0),b=X.useRef([t]);es(()=>{w!==!1&&b.current[b.current.length-1]!==t&&(b.current.push(t),y(!1))},[b,t]);let E=X.useMemo(()=>({show:t,appear:r,initial:w}),[t,r,w]);es(()=>{t?f("visible"):!ZR(m)&&o.current!==null&&f("hidden")},[t,m]);let T={unmount:i},N=Nr(()=>{var L;w&&y(!1),(L=n.beforeEnter)==null||L.call(n)}),I=Nr(()=>{var L;w&&y(!1),(L=n.beforeLeave)==null||L.call(n)}),H=Al();return Qn.createElement(GR.Provider,{value:m},Qn.createElement(YR.Provider,{value:E},H({ourProps:{...T,as:X.Fragment,children:Qn.createElement(Yoe,{ref:c,...T,...s,beforeEnter:N,beforeLeave:I})},theirProps:{},defaultTag:X.Fragment,features:Koe,visible:d==="visible",name:"Transition"})))}function WWe(n,e){let t=X.useContext(YR)!==null,r=Sj()!==null;
8319return Qn.createElement(Qn.Fragment,null,!t&&r?Qn.createElement(cL,{ref:e,...n}):Qn.createElement(Yoe,{ref:e,...n}))}let cL=Rc(FWe),Yoe=Rc(zWe),HWe=Rc(WWe),Cj=Object.assign(cL,{Child:HWe,Root:cL});function VWe(n,e){let t=X.useRef({left:0,top:0});if(es(()=>{if(!e)return;let i=e.getBoundingClientRect();i&&(t.current=i)},[n,e]),e==null||!n||e===document.activeElement)return!1;let r=e.getBoundingClientRect();return r.top!==t.current.top||r.left!==t.current.left}let ZG=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function QG(n){var e,t;let r=(e=n.innerText)!=null?e:"",i=n.cloneNode(!0);if(!Rg(i))return r;let s=!1;for(let a of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),s=!0;let o=s?(t=i.innerText)!=null?t:"":r;return ZG.test(o)&&(o=o.replace(ZG,"")),o}function qWe(n){let e=n.getAttribute("aria-label");if(typeof e=="string")return e.trim();let t=n.getAttribute("aria-labelledby");if(t){let r=t.split(" ").map(i=>{let s=document.getElementById(i);if(s){let o=s.getAttribute("aria-label");return typeof o=="string"?o.trim():QG(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return QG(n).trim()}function KWe(n){let e=X.useRef(""),t=X.useRef("");return Nr(()=>{let r=n.current;if(!r)return"";let i=r.innerText;if(e.current===i)return t.current;let s=qWe(r).trim().toLowerCase();return e.current=i,t.current=s,s})}var YWe=Object.defineProperty,GWe=(n,e,t)=>e in n?YWe(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,XG=(n,e,t)=>(GWe(n,typeof e!="symbol"?e+"":e,t),t),ia=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(ia||{}),h8=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(h8||{}),ji=(n=>(n[n.OpenMenu=0]="OpenMenu",n[n.CloseMenu=1]="CloseMenu",n[n.GoToItem=2]="GoToItem",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterItems=5]="RegisterItems",n[n.UnregisterItems=6]="UnregisterItems",n[n.SetButtonElement=7]="SetButtonElement",n[n.SetItemsElement=8]="SetItemsElement",n[n.SortItems=9]="SortItems",n))(ji||{});function JG(n,e=t=>t){let t=n.activeItemIndex!==null?n.items[n.activeItemIndex]:null,r=boe(e(n.items.slice()),s=>s.dataRef.current.domRef.current),i=t?r.indexOf(t):null;return i===-1&&(i=null),{items:r,activeItemIndex:i}}let ZWe={1(n){return n.menuState===1?n:{...n,activeItemIndex:null,pendingFocus:{focus:ho.Nothing},menuState:1}},0(n,e){return n.menuState===0?n:{...n,__demoMode:!1,pendingFocus:e.focus,menuState:0}},2:(n,e)=>{var t,r,i,s,o;if(n.menuState===1)return n;let a={...n,searchQuery:"",activationTrigger:(t=e.trigger)!=null?t:1,__demoMode:!1};if(e.focus===ho.Nothing)return{...a,activeItemIndex:null};if(e.focus===ho.Specific)return{...a,activeItemIndex:n.items.findIndex(d=>d.id===e.id)};if(e.focus===ho.Previous){let d=n.activeItemIndex;if(d!==null){let f=n.items[d].dataRef.current.domRef,m=VI(e,{resolveItems:()=>n.items,resolveActiveIndex:()=>n.activeItemIndex,resolveId:w=>w.id,resolveDisabled:w=>w.dataRef.current.disabled});if(m!==null){let w=n.items[m].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===w.current||((i=w.current)==null?void 0:i.previousElementSibling)===null)return{...a,activeItemIndex:m}}}}else if(e.focus===ho.Next){let d=n.activeItemIndex;if(d!==null){let f=n.items[d].dataRef.current.domRef,m=VI(e,{resolveItems:()=>n.items,resolveActiveIndex:()=>n.activeItemIndex,resolveId:w=>w.id,resolveDisabled:w=>w.dataRef.current.disabled});if(m!==null){let w=n.items[m].dataRef.current.domRef;if(((s=f.current)==null?void 0:s.nextElementSibling)===w.current||((o=w.current)==null?void 0:o.nextElementSibling)===null)return{...a,activeItemIndex:m}}}}let c=JG(n),u=VI(e,{resolveItems:()=>c.items,resolveActiveIndex:()=>c.activeItemIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...a,...c,activeItemIndex:u}},3:(n,e)=>{let t=n.searchQuery!==""?0:1,r=n.searchQuery+e.value.toLowerCase(),i=(n.activeItemIndex!==null?n.items.slice(n.activeItemIndex+t).concat(n.items.slice(0,n.activeItemIndex+t)):n.items).find(o=>{var a;return((a=o.dataRef.current.textValue)==null?void 0:a.startsWith(r))&&!o.dataRef.current.disabled}),s=i?n.items.indexOf(i):-1;return s===-1||s===n.activeItemIndex?{...n,searchQuery:r}:{...n,searchQuery:r,activeItemIndex:s,activationTrigger:1}},4(n){return n.searchQuery===""?n:{...n,searchQuery:"",searchActiveItemIndex:null}},5:(n,e)=>{let t=n.items.concat(e.items.map(i=>
8319i)),r=n.activeItemIndex;return n.pendingFocus.focus!==ho.Nothing&&(r=VI(n.pendingFocus,{resolveItems:()=>t,resolveActiveIndex:()=>n.activeItemIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled})),{...n,items:t,activeItemIndex:r,pendingFocus:{focus:ho.Nothing},pendingShouldSort:!0}},6:(n,e)=>{let t=n.items,r=[],i=new Set(e.items);for(let[s,o]of t.entries())if(i.has(o.id)&&(r.push(s),i.delete(o.id),i.size===0))break;if(r.length>0){t=t.slice();for(let s of r.reverse())t.splice(s,1)}return{...n,items:t,activationTrigger:1}},7:(n,e)=>n.buttonElement===e.element?n:{...n,buttonElement:e.element},8:(n,e)=>n.itemsElement===e.element?n:{...n,itemsElement:e.element},9:n=>n.pendingShouldSort?{...n,...JG(n),pendingShouldSort:!1}:n},QWe=class Goe extends hoe{constructor(e){super(e),XG(this,"actions",{registerItem:AG(()=>{let t=[],r=new Set;return[(i,s)=>{r.has(s)||(r.add(s),t.push({id:i,dataRef:s}))},()=>(r.clear(),this.send({type:5,items:t.splice(0)}))]}),unregisterItem:AG(()=>{let t=[];return[r=>t.push(r),()=>this.send({type:6,items:t.splice(0)})]})}),XG(this,"selectors",{activeDescendantId(t){var r;let i=t.activeItemIndex,s=t.items;return i===null||(r=s[i])==null?void 0:r.id},isActive(t,r){var i;let s=t.activeItemIndex,o=t.items;return s!==null?((i=o[s])==null?void 0:i.id)===r:!1},shouldScrollIntoView(t,r){return t.__demoMode||t.menuState!==0||t.activationTrigger===0?!1:this.isActive(t,r)}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let t=this.state.id,r=gj.get(null);this.disposables.add(r.on(poe.Push,i=>{!r.selectors.isTop(i,t)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>r.actions.push(t)),this.on(1,()=>r.actions.pop(t))}}static new({id:e,__demoMode:t=!1}){return new Goe({id:e,__demoMode:t,menuState:t?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:ho.Nothing}})}reduce(e,t){return $0(t.type,ZWe,e,t)}};const Zoe=X.createContext(null);function Tj(n){let e=X.useContext(Zoe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Qoe),t}return e}function Qoe({id:n,__demoMode:e=!1}){let t=X.useMemo(()=>QWe.new({id:n,__demoMode:e}),[]);return zoe(()=>t.dispose()),t}let XWe=X.Fragment;function JWe(n,e){let t=X.useId(),{__demoMode:r=!1,...i}=n,s=Qoe({id:t,__demoMode:r}),[o,a,c]=_f(s,E=>[E.menuState,E.itemsElement,E.buttonElement]),u=vh(e),d=gj.get(null),f=_f(d,X.useCallback(E=>d.selectors.isTop(E,t),[d,t]));Rze(f,[c,a],(E,T)=>{var N;s.send({type:ji.CloseMenu}),wj(T,mj.Loose)||(E.preventDefault(),(N=s.state.buttonElement)==null||N.focus())});let m=Nr(()=>{s.send({type:ji.CloseMenu})}),w=X.useMemo(()=>({open:o===ia.Open,close:m}),[o,m]),y={ref:u},b=Al();return Qn.createElement(xWe,null,Qn.createElement(Zoe.Provider,{value:s},Qn.createElement(Uoe,{value:$0(o,{[ia.Open]:Kd.Open,[ia.Closed]:Kd.Closed})},b({ourProps:y,theirProps:i,slot:w,defaultTag:XWe,name:"Menu"}))))}let eHe="button";function tHe(n,e){let t=Tj("Menu.Button"),r=X.useId(),{id:i=`headlessui-menu-button-${r}`,disabled:s=!1,autoFocus:o=!1,...a}=n,c=X.useRef(null),u=yWe(),d=vh(e,c,wWe(),Nr($=>t.send({type:ji.SetButtonElement,element:$}))),f=Nr($=>{switch($.key){case ea.Space:case ea.Enter:case ea.ArrowDown:$.preventDefault(),$.stopPropagation(),t.send({type:ji.OpenMenu,focus:{focus:ho.First}});break;case ea.ArrowUp:$.preventDefault(),$.stopPropagation(),t.send({type:ji.OpenMenu,focus:{focus:ho.Last}});break}}),m=Nr($=>{switch($.key){case ea.Space:$.preventDefault();break}}),[w,y,b]=_f(t,$=>[$.menuState,$.buttonElement,$.itemsElement]),E=w===ia.Open;Oze(E,{trigger:y,action:X.useCallback($=>{if(y!=null&&y.contains($.target))return WI.Ignore;let A=$.target.closest('[role="menuitem"]:not([data-disabled])');return Rg(A)?WI.Select(A):b!=null&&b.contains($.target)?WI.Ignore:WI.Close},[y,b]),close:X.useCallback(()=>t.send({type:ji.CloseMenu}),[]),select:X.useCallback($=>$.click(),[])});let T=Nr($=>{var A;if($.button===joe.Left){if(qje($.currentTarget))return $.preventDefault();s||(w===ia.Open?(y0.flushSync(()=>t.send({type:ji.CloseMenu})),(A=c.current)==null||A.focus({preventScroll:!0})):($.preventDefault(),t.send({type:ji.OpenMenu,focus:{focus:ho.Nothing},trigger:h8.Pointer})))}}),N=X.useRef(null),I=Nr($=>{N.current=$.pointerType,$.pointerType==="mouse"&&T($)}),H=Nr($=>{N.current!=="mouse"&&T($)}),{isFocusVisible:L,focusProps:U}
8319=Ije({autoFocus:o}),{isHovered:K,hoverProps:Y}=Tje({isDisabled:s}),{pressed:k,pressProps:j}=Pje({disabled:s}),V=X.useMemo(()=>({open:w===ia.Open,active:k||w===ia.Open,disabled:s,hover:K,focus:L,autofocus:o}),[w,K,L,k,s,o]),W=ioe(u(),{ref:d,id:i,type:Pze(n,c.current),"aria-haspopup":"menu","aria-controls":b==null?void 0:b.id,"aria-expanded":w===ia.Open,disabled:s||void 0,autoFocus:o,onKeyDown:f,onKeyUp:m,onPointerDown:I,onClick:H},U,Y,j);return Al()({ourProps:W,theirProps:a,slot:V,defaultTag:eHe,name:"Menu.Button"})}let nHe="div",rHe=c8.RenderStrategy|c8.Static;function iHe(n,e){let t=X.useId(),{id:r=`headlessui-menu-items-${t}`,anchor:i,portal:s=!1,modal:o=!0,transition:a=!1,...c}=n,u=mWe(i),d=Tj("Menu.Items"),[f,m]=vWe(u),w=bWe(),[y,b]=X.useState(null),E=vh(e,u?f:null,Nr(F=>d.send({type:ji.SetItemsElement,element:F})),b),[T,N]=_f(d,F=>[F.menuState,F.buttonElement]),I=iL(N),H=iL(y);u&&(s=!0);let L=Sj(),[U,K]=Eoe(a,y,L!==null?(L&Kd.Open)===Kd.Open:T===ia.Open);wze(U,N,()=>{d.send({type:ji.CloseMenu})});let Y=_f(d,F=>F.__demoMode),k=Y?!1:o&&T===ia.Open;Fze(k,H);let j=Y?!1:o&&T===ia.Open;mze(j,{allowed:X.useCallback(()=>[N,y],[N,y])});let V=T!==ia.Open,W=VWe(V,N)?!1:U;X.useEffect(()=>{let F=y;F&&T===ia.Open&&F!==(H==null?void 0:H.activeElement)&&F.focus({preventScroll:!0})},[T,y,H]),Zze(T===ia.Open,{container:y,accept(F){return F.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:F.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(F){F.setAttribute("role","none")}});let $=E4(),A=Nr(F=>{var z,B,C;switch($.dispose(),F.key){case ea.Space:if(d.state.searchQuery!=="")return F.preventDefault(),F.stopPropagation(),d.send({type:ji.Search,value:F.key});case ea.Enter:if(F.preventDefault(),F.stopPropagation(),d.state.activeItemIndex!==null){let{dataRef:M}=d.state.items[d.state.activeItemIndex];(B=(z=M.current)==null?void 0:z.domRef.current)==null||B.click()}d.send({type:ji.CloseMenu}),yoe(d.state.buttonElement);break;case ea.ArrowDown:return F.preventDefault(),F.stopPropagation(),d.send({type:ji.GoToItem,focus:ho.Next});case ea.ArrowUp:return F.preventDefault(),F.stopPropagation(),d.send({type:ji.GoToItem,focus:ho.Previous});case ea.Home:case ea.PageUp:return F.preventDefault(),F.stopPropagation(),d.send({type:ji.GoToItem,focus:ho.First});case ea.End:case ea.PageDown:return F.preventDefault(),F.stopPropagation(),d.send({type:ji.GoToItem,focus:ho.Last});case ea.Escape:F.preventDefault(),F.stopPropagation(),y0.flushSync(()=>d.send({type:ji.CloseMenu})),(C=d.state.buttonElement)==null||C.focus({preventScroll:!0});break;case ea.Tab:F.preventDefault(),F.stopPropagation(),y0.flushSync(()=>d.send({type:ji.CloseMenu})),Cze(d.state.buttonElement,F.shiftKey?rL.Previous:rL.Next);break;default:F.key.length===1&&(d.send({type:ji.Search,value:F.key}),$.setTimeout(()=>d.send({type:ji.ClearSearch}),350));break}}),_=Nr(F=>{switch(F.key){case ea.Space:F.preventDefault();break}}),R=X.useMemo(()=>({open:T===ia.Open}),[T]),P=ioe(u?w():{},{"aria-activedescendant":_f(d,d.selectors.activeDescendantId),"aria-labelledby":_f(d,F=>{var z;return(z=F.buttonElement)==null?void 0:z.id}),id:r,onKeyDown:A,onKeyUp:_,role:"menu",tabIndex:T===ia.Open?0:void 0,ref:E,style:{...c.style,...m,"--button-width":ize(N,!0).width},...xoe(K)}),q=Al();return Qn.createElement(BWe,{enabled:s?n.static||U:!1,ownerDocument:I},q({ourProps:P,theirProps:c,slot:R,defaultTag:nHe,features:rHe,visible:W,name:"Menu.Items"}))}let sHe=X.Fragment;function oHe(n,e){let t=X.useId(),{id:r=`headlessui-menu-item-${t}`,disabled:i=!1,...s}=n,o=Tj("Menu.Item"),a=_f(o,V=>o.selectors.isActive(V,r)),c=X.useRef(null),u=vh(e,c),d=_f(o,V=>o.selectors.shouldScrollIntoView(V,r));es(()=>{if(d)return id().requestAnimationFrame(()=>{var V,W;(W=(V=c.current)==null?void 0:V.scrollIntoView)==null||W.call(V,{block:"nearest"})})},[d,c]);let f=KWe(c),m=X.useRef({disabled:i,domRef:c,get textValue(){return f()}});es(()=>{m.current.disabled=i},[m,i]),es(()=>(o.actions.registerItem(r,m),()=>o.actions.unregisterItem(r)),[m,r]);let w=Nr(()=>{o.send({type:ji.CloseMenu})}),y=Nr(V=>{if(i)return V.preventDefault();o.send({type:ji.CloseMenu}),yoe(o.state.buttonElement)}),b=Nr(()=>{if(i)return o.send({type:ji.GoToItem,focus:ho.Nothing});o.send({type:ji.GoToItem,focus:ho.Specific,id:r})}),E=Wze(),T=Nr(V=>E.update(V)),N=Nr(V=>{E.wasMoved(V)&&(i||a||o.send({type:ji.GoToItem,focus:ho.Specific,id:r,trigger:h8.Pointer}))}),I=Nr(V=>{E.wasMoved(V)&&(i||a&&o.state.activationTrigger===h8.Pointer&&o.send({type:ji.GoToItem,focus:ho.Nothing}))}),[H,L]=loe(),[U,K]=Gje(),Y=X.useMemo(()=>({active:a,focus:a,disabled:i,close:w}),[a,i,w]),k={id:r,ref:u,role:"menuitem",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-labelledby":H,"aria-describedby":U,disabled:void 0,onClick:y,onFocus:b,onPointerEnter:T,onMouseEnter:T,onPointerMove:N,onMouseMove:N,onPointerLeave:I,onMouseLeave:I},j=Al();
8319return Qn.createElement(L,null,Qn.createElement(K,null,j({ourProps:k,theirProps:s,slot:Y,defaultTag:sHe,name:"Menu.Item"})))}let aHe="div";function cHe(n,e){let[t,r]=loe(),i=n,s={ref:e,"aria-labelledby":t,role:"group"},o=Al();return Qn.createElement(r,null,o({ourProps:s,theirProps:i,slot:{},defaultTag:aHe,name:"Menu.Section"}))}let lHe="header";function uHe(n,e){let t=X.useId(),{id:r=`headlessui-menu-heading-${t}`,...i}=n,s=pj();es(()=>s.register(r),[r,s.register]);let o={id:r,ref:e,role:"presentation",...s.props};return Al()({ourProps:o,theirProps:i,slot:{},defaultTag:lHe,name:"Menu.Heading"})}let dHe="div";function hHe(n,e){let t=n,r={ref:e,role:"separator"};return Al()({ourProps:r,theirProps:t,slot:{},defaultTag:dHe,name:"Menu.Separator"})}let fHe=Rc(JWe),pHe=Rc(tHe),gHe=Rc(iHe),mHe=Rc(oHe),wHe=Rc(cHe),yHe=Rc(uHe),bHe=Rc(hHe),Wu=Object.assign(fHe,{Button:pHe,Items:gHe,Item:mHe,Section:wHe,Heading:yHe,Separator:bHe});var Xoe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},eZ=Qn.createContext&&Qn.createContext(Xoe),vHe=["attr","size","title"];function xHe(n,e){if(n==null)return{};var t=EHe(n,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function EHe(n,e){if(n==null)return{};var t={};for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){if(e.indexOf(r)>=0)continue;t[r]=n[r]}return t}function f8(){return f8=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},f8.apply(this,arguments)}function tZ(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function p8(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tZ(Object(t),!0).forEach(function(r){AHe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):tZ(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function AHe(n,e,t){return e=SHe(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function SHe(n){var e=_He(n,"string");return typeof e=="symbol"?e:e+""}function _He(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Joe(n){return n&&n.map((e,t)=>Qn.createElement(e.tag,p8({key:t},e.attr),Joe(e.child)))}function Ss(n){return e=>Qn.createElement(CHe,f8({attr:p8({},n.attr)},e),Joe(n.child))}function CHe(n){var e=t=>{var{attr:r,size:i,title:s}=n,o=xHe(n,vHe),a=i||t.size||"1em",c;return t.className&&(c=t.className),n.className&&(c=(c?c+" ":"")+n.className),Qn.createElement("svg",f8({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,o,{className:c,style:p8(p8({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&Qn.createElement("title",null,s),n.children)};return eZ!==void 0?Qn.createElement(eZ.Consumer,null,t=>e(t)):e(Xoe)}function Ij(n){return Ss({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M72.81 429.82c-22.296-2.195-27.265-19.923-25.57-43.598 9.177 9.99 18.39 19.894 32.228 22.2-.75-7.84.293-15.77 4-23.815 5.323 7.987 14.75 16.796 29.034 26.567l10.557-28.337c9.917 15.174 21.736 29.49 48.303 41.756l11.9-35.993c7.796 8.075 15.115 16.283 33.035 21.326l24.54-36.55c22.244 9.91 42.094 7.707 58.597-11.042 13.845-17.986 27.5-36.654 38.51-64.19l-8.08-30.04c-.552-12.898 15.98-20.13 26.698-7.09l25.833 49.492c3.972 11.24 4.647 23.27-2.554 37.263l-45.075 68.697c-7.32 5.586-16.634 10.108-35.875 9.198-33.167-3.663-65.717-6.63-91.228-1.006-29.393 3.428-58.757 7.524-88.056 13.206-16.216 4.97-32.058 5.285-46.8-8.046zm49.984-77.64c-7.862 13.362-11.848 26.56-14.065 39.672-19.74-10.725-23.808-22.162-25.76-33.68-7.4 10.894-10.6 21.59-12.304 32.22-16.063-7.584-21.34-18.375-25.577-29.468l-6.842 11.908-13.075-46.97c-4.258-10.16-4.962-20.487 5.36-31.3l33.614-33.91 29.724.024c22.626-17.655 48.995-33.63 78.902-48.084l59.06-68.815c12.993-11.43 26.398-13.64 39.898-13.933l66.047-2.944c5.954 1.975 11.9 4.133 18.015 10 37.572 33.9 59.94 68.483 54.618 104.286l-29.262 40.47-10.446-25.98c-12.92-18.94-28.54-20.093-42.872-14.982-10.078 3.594-11.672 13.897-11.694 21.634l7.862 34.466c-15.49 31.28-31.434 52.496-47.797 64.39-12.758 5.65-25.994.814-39.384-7.746-8.802 15.468-17.78 27.228-26.824 37.08-13.772-6.65-23.61-17.656-31.963-30.238-5.823 18.5-9.486 34.657-12.555 50.154-23.036-15.152-38.753-33.872-42.68-58.25zm-54.668-42.93l26.39-23.344-10.042-12.215-16.517 8.127-13.58 26.978zm146.55-37.028l38.892-4.14 23.205-14.102c7.48-6.71 10.755-13.412 12.553-20.1l-17.082-42.072c-3.296-4.632-7.716-5.748-13.728-2.055l-35.95 35.325-32.36 8.266c-3.713 2.525-5.07 5.6-3.104 9.514l9.595 21.018c3.986 6.115 9.925 8.244 17.978 8.346zm198.178-11.01l11.768-16.41c1.622-16.905-.42-30.83-5.337-43.993 21.267-5.852 48.473 4.256 68.698 25.97 3.597 5.257 1.703 12.092-5.455 14.096-28.087 6.32-45.94 21.194-69.674 20.335zM372.677 131.01c23.153-7.708 46.557-9.977 70.033-10.373 4.09-.053 10.16.33 8.942 7.363-9.41 27.2-25.444 38.73-42.226 51.175-8.48-17.487-21.597-33.22-36.75-48.165zm-27.735-58.017c12.282-3.26 27.412-3.39 25.65 5.873l-26.626 34.195-65.292 2.908c21.253-20.915 38.87-35.64 66.268-42.975z"},child:[]}]})(n)}function nZ(n){return Ss({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M215.125 17.188C142.557 18.134 72.68 64.075 40.187 132.25c-56.91 119.42 7.05 260.175 122.313 314.406 53.513 25.185 114.67 31.57 172.563 19.78l9.625 21.845 152.75-34.03c-.64-13.024-1.892-29.087-3.407-45.97-3.353 6.146-8.283 11.545-14.655 15.5-19.667 12.21-45.51 6.137-57.72-13.53-12.208-19.667-6.165-45.51 13.5-57.72 6.762-4.196 14.274-6.21 21.69-6.28 12.278-.118 24.32 5.173 32.53 15-4.06-38.385-8.03-70.97-8.03-70.97-58.49 31.19-115.34 47.06-174.47 60.408v-.375c-46.538 12.515-126.428 1.26-156.5-30.22 18.292 40.602 81.708 65.04 149.313 65.844l8.343 18.938c-24.334 9.436-50.313 14.416-76.374 14.313l-14.22-1
83197.97L194.72 415.5c-13.017-2.59-25.656-6.54-37.69-11.72l-9.56-23.186-23.876 4.656c-7.174-4.967-13.972-10.416-20.375-16.28l-.564-24.126-26.344-6.5c-3.69-5.284-7.09-10.758-10.187-16.406L74.97 295l-23.657-9.47c-1.876-6.79-3.32-13.74-4.313-20.81l13.875-21.564-14.125-21.844c.057-.448.095-.894.156-1.343.87-6.424 2.175-12.74 3.844-18.94l20.188-13.25-6.594-20.686c3.268-6 6.91-11.757 10.906-17.25l25.688-5.406 3.093-24.625c5.754-4.555 11.836-8.695 18.19-12.313l22.718 6.78 9.812-20.124c9.6-2.523 19.57-3.957 29.78-4.187l20.845 15.25 20.063-9.376c50.687 16.437 88.647 65.967 80.53 121.594-2.905 19.914-12.198 38.33-25.437 52.437 3.03-20.242-10.88-43.178-35.092-55-28.472-13.902-60.35-7.162-71.188 15.03-10.836 22.194 3.466 51.443 31.938 65.345 4.653 2.272 9.396 3.995 14.125 5.188 57.96 18.97 121.378-12.46 147.593-66.063 36.94-75.536-3.372-165.134-76.125-200.22-23.733-11.444-48.587-16.803-73.186-16.968-1.153-.007-2.317-.015-3.47 0zM396.47 348.375l-1.626 37.188-60.53-10.657 62.155-26.53z"},child:[]}]})(n)}function THe(n){return Ss({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M363.783 23.545c-9.782.057-16.583 3.047-20.744 10.22-17.51 30.18-38.432 61.645-48.552 97.245 2.836.83 5.635 1.787 8.373 2.853 7.353 2.863 14.38 6.482 20.542 10.858 27.534-25.542 58.165-45.21 87.45-65.462 11.356-7.854 12.273-13.584 10.183-20.83-2.09-7.246-9.868-16.365-20.525-23.176-10.658-6.81-23.87-11.33-34.73-11.68-.68-.022-1.345-.03-1.997-.027zm-68.998.746c-10.02-.182-17.792 6.393-23.924 20.24-8.94 20.194-10.212 53.436-1.446 83.185.156-.008.31-.023.467-.03 1.99-.087 3.99-.072 6 .03 9.436-34.822 27.966-64.72 44.013-91.528-10.31-8.496-18.874-11.782-25.108-11.896zM197.5 82.5L187 97.97c14.82 10.04 29.056 19.725 39.813 31.374 3.916 4.24 7.37 8.722 10.31 13.607 3.77-4.73 8.51-8.378 13.69-10.792.407-.188.82-.355 1.228-.53-3.423-5.44-7.304-10.418-11.51-14.972C227.765 102.83 212.29 92.52 197.5 82.5zm223.77 12.27c-29.255 20.228-58.575 39.152-84.348 62.78.438.576.848 1.168 1.258 1.76 20.68-6.75 49.486-15.333 73.916-19.41 11.484-1.916 15.66-6.552 17.574-13.228 1.914-6.676.447-16.71-5.316-26.983-.924-1.647-1.96-3.29-3.083-4.92zm-223.938 47.87c-14.95.2-29.732 4.3-43.957 12.766l9.563 16.03c21.657-12.89 42.626-14.133 65.232-4.563.52-5.592 1.765-10.66 3.728-15.21.35-.806.73-1.586 1.123-2.354-11.87-4.52-23.83-6.827-35.688-6.67zm75.8 3.934c-5.578-.083-10.597.742-14.427 2.526-4.377 2.038-7.466 4.914-9.648 9.97-.884 2.047-1.572 4.54-1.985 7.494.456-.007.91-.03 1.365-.033 16.053-.084 32.587 2.77 49.313 9.19 7.714 2.96 15.062 7.453 22.047 13.184 3.217-2.445 4.99-4.72 5.773-6.535 1.21-2.798 1.095-5.184-.634-8.82-3.46-7.275-15.207-16.955-28.856-22.27-6.824-2.658-13.98-4.224-20.523-4.614-.818-.05-1.627-.08-2.424-.092zm-24.757 38.457c-22.982.075-44.722 7.386-65 19.782-32.445 19.835-60.565 53.124-80.344 90.032-19.777 36.908-31.133 77.41-31.186 110.53-.053 33.06 10.26 57.27 32.812 67.782.043.02.082.043.125.063h.032c24.872 11.51 65.616 19.337 108.407 20.092 42.79.756 87.79-5.457 121.874-20.187 21.96-9.49 34.545-28.452 40.5-54.156 5.954-25.705 4.518-57.657-2.375-89.314-6.894-31.657-19.2-63.06-34.095-87.875-14.894-24.814-32.614-42.664-48.063-48.593-14.664-5.627-28.898-8.2-42.687-8.156z"},child:[]}]})(n)}function Nj(n){return Ss({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M287.03 20c-39.133.48-79.73 15.297-117 45.938h80.47v43.188c52.76-29.75 114.592-31.588 163.938.03l-18.188 9.72 64.688 50.72-3.75-83.314-26.407 14.126C395.99 48.792 345.038 20.644 290.907 20c-1.288-.015-2.583-.016-3.875 0zm-268 64.625v212.75h212.782V84.625H19.032zm50.282 26.03H205.78v138.939h-18.718v-120.25H69.313v-18.688zm3.344 38.126l90.094 91.845-13.344 13.094-90.094-91.845 13.344-13.094zm206.656 61.75v212.782h212.75v-212.78h-212.75zm50.25 26.064h136.469V375.5h-18.686V255.28h-117.78l-.002-18.686zm3.344 38.094l90.125 91.875-13.342 13.062-90.125-91.844 13.343-13.092zm-278.53 63.656l3.75 83.312 23.312-12.47c60.927 88.637 169.99 106.485 259.625 32.814h-80.439v-43.188c-52.08 29.38-113 31.544-162.03 1.188l20.436-10.938-64.655-50.718z"},child:[]}]})(n)}function IHe(n){return Ss({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M227.4 34.7c-10.1 0-20.2.2-30.2.5l6.1 65.6-61.1-62.5c-31.3 2.5-62.5 6.6-93.8 12.5l34.2 28.4-48-.6c35.1 100.2 6.9 182.6-.3 292.1L130 476.5c10-1.3 19.9-2.4 29.6-3.3l21.5-42.2 18.6 28.8 41.5-33.5.8 43c82.9-.2 157.7 9.1 235.7 7.9-28.2-73-31.2-143.6-31.9-209.2l-33.3-19.1 32.7-33.9c-.4-21.3-1.3-42-3.6-61.9l-57.4.7 50.2-41.7c-3.8-15.5-9-30.4-16.1-44.7l-29.5-23.9C335 38 281.2 34.6 227.4 34.7zm58.7 37c10.6 24.75 21.1 49.5 31.7 74.3 7.5-10.5 14.9-21 22.4-31.5 16 27.2 32 54.3 48 81.5l-16.2 9.5-33.3-56.7-42.5 59.4-15.2-10.9 24-33.5-21.9-51.5-24.6 40.1 12 22.6-16.5 8.8-18.3-34.5-24.8 58.2-17.2-7.4 32.5-76.2 7.7-18c4.8 9.2 9.6 18.3 14.5 27.4 12.5-20.6 25.1-41.11 37.7-61.6zM91.2 128c6.72 1.6 13.4 3.4 19.2 5.3-2.1 5.9-4.1 11.8-6.2 17.6-5.79-1.6-11.72-3.4-16.9-4.7 1.39-6 2.62-12.1 3.9-18.2zm37.9 13.4c6.3 3.8 12 7.2 17 12.8L132.6 167c-4-3.7-8.6-7-12.8-9.4zm28.7 32.3
8319c2.1 7.4 2.1 15.7 1.6 22.5l-18.5-2.4c.1-5.1.3-10-1-14.5zm-21.2 35.7l17.2 7.1c-3.3 6.6-5.1 12.7-8.6 17.8l-16.3-9c2.6-5.4 5.6-10.8 7.7-15.9zm-16.5 34.1l17.7 6.1c-1.5 5.4-3 11.2-3.6 16.2l-18.6-2c1.3-7.5 2.1-14 4.5-20.3zm207.8 17.4c8.5 1 14.6 3 21.7 7.1l-9.8 16c-4.1-2.8-9.4-3.8-13.5-4.5zm-21.2 1.5c1.1 6.1 2.5 12.2 3.9 18.3-5.9 1.3-11.7 3.3-16.5 5.1l-6.8-17.4c6.7-2.4 13.5-4.7 19.4-6zm-37.9 15.9l11 15.1c-5.6 4-11.8 7.8-16.8 10.6l-8.9-16.4c5.1-2.9 10.6-6.3 14.7-9.3zM135.3 281c1.5 4.7 4.2 9.2 6.9 12.1l-13.8 12.6c-5.5-5.7-9.5-13.5-11.2-20.1zm230.3 3.3c3.5 6.4 6.8 12.7 8.7 19.1l-17.8 5.6c-2-5.4-4.3-10.8-6.8-14.8zm-127.4 10.9l6.9 17.3c-6.4 2.7-12.9 4.8-18.6 6.5l-5-18c5.9-1.6 11.3-3.8 16.7-5.8zm-83.8 6.2c5.3 1.7 10.8 3.4 15.7 4.2-1.2 6.1-2 12.3-2.8 18.5-7-1-14.5-3.3-20.5-5.7zm50 3.5l2.8 18.5c-7.2 1.3-13.4 1.6-19.8 1.9l-.4-18.7c5.9-.2 11.6-.8 17.4-1.7zm174.5 18c1 6.4 1.6 12.9 2.2 19.3l-18.7 1.5c-.4-6-.9-11.9-2-17.8zm-67.6 30.8c18.9 3.5 44.9 16.2 68.9 33.9 7.4-9.9 14.4-20.4 21.3-31.1l30.1 12.9c-4.7 12.3-15 25.6-28.6 37.2 17 16.2 30.9 34.5 37 53-13.8-18.1-31.1-31.8-50.3-42.8-23.4 15.8-52.7 25.9-79.6 20.4 22.9-4.4 40.6-16.6 55.8-32.6-16.5-7.5-33.8-13.9-51.3-20.1z"},child:[]}]})(n)}function NHe(n){return Ss({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zm-141.651-35.33c4.937-32.999-20.191-50.739-54.55-62.573l11.146-44.702-27.213-6.781-10.851 43.524c-7.154-1.783-14.502-3.464-21.803-5.13l10.929-43.81-27.198-6.781-11.153 44.686c-5.922-1.349-11.735-2.682-17.377-4.084l.031-.14-37.53-9.37-7.239 29.062s20.191 4.627 19.765 4.913c11.022 2.751 13.014 10.044 12.68 15.825l-12.696 50.925c.76.194 1.744.473 2.829.907-.907-.225-1.876-.473-2.876-.713l-17.796 71.338c-1.349 3.348-4.767 8.37-12.471 6.464.271.395-19.78-4.937-19.78-4.937l-13.51 31.147 35.414 8.827c6.588 1.651 13.045 3.379 19.4 5.006l-11.262 45.213 27.182 6.781 11.153-44.733a1038.209 1038.209 0 0 0 21.687 5.627l-11.115 44.523 27.213 6.781 11.262-45.128c46.404 8.781 81.299 5.239 95.986-36.727 11.836-33.79-.589-53.281-25.004-65.991 17.78-4.098 31.174-15.792 34.747-39.949zm-62.177 87.179c-8.41 33.79-65.308 15.523-83.755 10.943l14.944-59.899c18.446 4.603 77.6 13.717 68.811 48.956zm8.417-87.667c-7.673 30.736-55.031 15.12-70.393 11.292l13.548-54.327c15.363 3.828 64.836 10.973 56.845 43.035z"},child:[]}]})(n)}function RHe(n){return Ss({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M311.9 260.8L160 353.6 8 260.8 160 0l151.9 260.8zM160 383.4L8 290.6 160 512l152-221.4-152 92.8z"},child:[]}]})(n)}function Rj(n){return Ss({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16zM464 96H345.94c-21.38 0-32.09 25.85-16.97 40.97l32.4 32.4L288 242.75l-73.37-73.37c-12.5-12.5-32.76-12.5-45.25 0l-68.69 68.69c-6.25 6.25-6.25 16.38 0 22.63l22.62 22.62c6.25 6.25 16.38 6.25 22.63 0L192 237.25l73.37 73.37c12.5 12.5 32.76 12.5 45.25 0l96-96 32.4 32.4c15.12 15.12 40.97 4.41 40.97-16.97V112c.01-8.84-7.15-16-15.99-16z"},child:[]}]})(n)}function MHe(n){return Ss({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M298.06,224,448,277.55V496a16,16,0,0,1-16,16H368a16,16,0,0,1-16-16V384H192V496a16,16,0,0,1-16,16H112a16,16,0,0,1-16-16V282.09C58.84,268.84,32,233.66,32,192a32,32,0,0,1,64,0,32.06,32.06,0,0,0,32,32ZM544,112v32a64,64,0,0,1-64,64H448v35.58L320,197.87V48c0-14.25,17.22-21.39,27.31-11.31L374.59,64h53.63c10.91,0,23.75,7.92,28.62,17.69L464,96h64A16,16,0,0,1,544,112Zm-112,0a16,16,0,1,0-16,16A16,16,0,0,0,432,112Z"},child:[]}]})(n)}function kHe(n){return Ss({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M216 23.86c0-23.8-30.65-32.77-44.15-13.04C48 191.85 224 200 224 288c0 35.63-29.11 64.46-64.85 63.99-35.17-.45-63.15-29.77-63.15-64.94v-85.51c0-21.7-26.47-32.23-41.43-16.5C27.8 213.16 0 261.33 0 320c0 105.87 86.13 192 192 192s192-86.13 192-192c0-170.29-168-193-168-296.14z"},child:[]}]})(n)}function OHe(n){return Ss({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M186.1.09C81.01 3.24 0 94.92 0 200.05v263.92c0 14.26 17.23 21.39 27.31 11.31l24.92-18.53c6.66-4.95 16-3.99 21.51 2.21l42.95 48.35c6.25 6.25 16.38 6.25 22.63 0l40.72-45.85c6.37-7.17 17.56-7.17 23.92 0l40.72 45.85c6.25 6.25 16.38 6.25 22.63 0l42.95-48.35c5.51-6.2 14.85-7.17 21.51-2.21l24.92 18.53c10.08 10.08 27.31 2.94 27.31-11.31V192C384 84 294.83-3.17 186.1.09zM128 224c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm128 0c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32z"},child:[]}]})(n)}function PHe(n){return Ss({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M32,224H64V416H32A31.96166,31.96166,0,0,1,0,384V256A31.96166,31.96166,0,0,1,32,224Zm512-48V448a64.06328,64.06328,0,0,1-64,64H160a64.06328,64.06328,0,0,1-64-64V176a79.974,79.974,0,0,1,80-80H288V32a32,32,0,0,1,64,0V96H464A79.974,79.974,0,0,1,544,176ZM264,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,264,256Zm-8,128H192v32h64Zm96,0H288v32h64ZM456,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,456,256Zm-8,128H384v32h64ZM640,256V384a31.96166,31.96166,0,0,1-32,32H576V224h32A31.96166,31.96166,0,0,1,640,256Z"},child:[]}]})(n)}function DHe(n){return Ss({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505.12019,19.09375c-1.18945-5.53125-6.65819-11-12.207-12.1875C460.716,0,435.507,0,410.40747,0,307.17523,0,245.26909,55.20312,199.05238,128H94.83772c-16.34763.01562-35.55658,11.875-42.88664,26.48438L2.51562,253.29688A28.4,28.4,0,0,0,0,264a24.00867,24.00867,0,0,0,24.00582,24H127.81618l-22.47457,22.46875c-11.36521,11.36133-12.99607,32.25781,0,45.25L156.24582,406.625c11.15623,11.1875,32.15619,13.15625,45.27726,0l22.47457-22.46875V488a24.00867,24.00867,0,0,0,24.00581,24,28.55934,28.55934,0,0,0,10.707-2.51562l98.72834-49.39063c14.62888-7.29687,26.50776-26.5,26.50776-42.85937V312.79688c72.59753-46.3125,128.03493-108.40626,128.03493-211.09376C512.07526,76.5,512.07526,51.29688,505.12019,19.09375ZM384.04033,168A40,40,0,1,1,424.05,128,40.02322,40.02322,0,0,1,384.04033,168Z"},child:[]}]})(n)}function BHe(n){return Ss({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M624 208h-64v-64c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v64h-64c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h64v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-64h64c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm-400 48c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"},child:[]}]})(n)}function Mj(n){return Ss({attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm141.4 389.4c-37.8 37.8-88 58.6-141.4 58.6s-103.6-20.8-141.4-58.6S48 309.4 48 256s20.8-103.6 58.6-141.4S194.6 56 248 56s103.6 20.8 141.4 58.6S448 202.6 448 256s-20.8 103.6-58.6 141.4zM343.6 196l33.6-40.3c8.6-10.3-3.8-24.8-15.4-18l-80 48c-7.8 4.7-7.8 15.9 0 20.6l80 48c11.5 6.8 24
8319-7.6 15.4-18L343.6 196zm-209.4 58.3l80-48c7.8-4.7 7.8-15.9 0-20.6l-80-48c-11.6-6.9-24 7.7-15.4 18l33.6 40.3-33.6 40.3c-8.7 10.4 3.8 24.8 15.4 18zM362.4 288H133.6c-8.2 0-14.5 7-13.5 15 7.5 59.2 58.9 105 121.1 105h13.6c62.2 0 113.6-45.8 121.1-105 1-8-5.3-15-13.5-15z"},child:[]}]})(n)}function kj(n){return Ss({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l40 0 0 64L0 160 0 288c53 0 96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96s96 43 96 96l0 64c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-64c0-53 43-96 96-96l0-128-72 0 0-64 40 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM456 96l0 64-80 0 0-64 80 0zM328 96l0 64-80 0 0-64 80 0zM200 96l0 64-80 0 0-64 80 0z"},child:[]}]})(n)}const gc=()=>{const{publicKey:n,disconnect:e,connected:t,wallet:r}=$U(),{isConnected:i,address:s}=FU(),{open:o,disconnect:a}=FL(),[c,u]=X.useState(!1),[d,f]=X.useState(null),[m,w]=X.useState(!1);X.useEffect(()=>{const I=()=>{const L=typeof window<"u"&&!!window.reown;w(L)};I();const H=setInterval(I,500);return()=>clearInterval(H)},[]);const y=I=>I?`${I.slice(0,4)}...${I.slice(-4)}`:"",b=[{name:"Swap",link:"https://yup.fun",icon:S.jsx(Nj,{className:"mr-2"})},{name:"Bridge",link:"https://yupfun.io/bridge",icon:S.jsx(kj,{className:"mr-2"})},{name:"Why YUPFUN?",link:"https://yup.fun/unique-value",icon:S.jsx(Ij,{className:"mr-2"})},{name:"Roadmap",link:"https://yup.fun/roadmap",icon:S.jsx(Rj,{className:"mr-2"})},{name:"Meme",link:"https://yup.fun/meme",icon:S.jsx(Mj,{className:"mr-2"})}],E=async()=>{var I,H;try{if(localStorage.removeItem("walletName"),localStorage.removeItem("reown-session"),d==="solana")try{await e(),(I=window.solana)!=null&&I.disconnect&&await window.solana.disconnect()}catch(L){console.error("Solana disconnection error:",L)}else if(d==="reown")try{await a(),typeof window<"u"&&((H=window.reown)!=null&&H.disconnect)&&await window.reown.disconnect()}catch(L){console.error("Reown disconnection error:",L)}f(null),setTimeout(()=>{window.location.reload()},300)}catch(L){console.error("Disconnection error:",L),window.location.reload()}};X.useEffect(()=>{const I=()=>{localStorage.getItem("walletName"),f(i&&s?"reown":t&&n?"solana":null)};I();const H=L=>{L.key==="walletName"&&I()};return window.addEventListener("storage",H),()=>window.removeEventListener("storage",H)},[i,t,s,n,r]);const T=()=>{switch(d){case"solana":return S.jsx("img",{src:"/cryptos/solana-logo.png",alt:"Solana",className:"w-5 h-5 mr-2",onError:I=>{I.target.onerror=null,I.target.src="/logos/default-logo.png"}});case"reown":return S.jsx("img",{src:"/logos/reown-logo.png",alt:"WalletConnect",className:"w-5 h-5 mr-2",onError:I=>{I.target.onerror=null,I.target.src="/logos/default-logo.png"}});default:return null}},N=()=>{if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&m)try{o({view:"Connect",namespace:"solana"})}catch(H){console.error("Failed to open Reown modal:",H),u(!0)}else u(!0)};return S.jsx("header",{className:"w-full dragon-container-full px-4 md:px-6 py-4 border-b border-[#2C2F36]",children:S.jsxs("div",{className:"max-w-7xl mx-auto flex justify-between items-center",children:[S.jsx("div",{className:"flex items-center",children:S.jsx("a",{href:"https://yup.fun",className:"text-xl md:text-2xl font-bold text-[#7EBAFF] hover:text-[#6BA8FF] transition-colors duration-200",children:S.jsx("div",{className:"flex items-center",children:S.jsx("img",{src:"/images/YUPFUN-logo.png",alt:"YUPFUN Solana token swap platform",className:"h-10 md:h-12",onError:I=>{I.target.onerror=null,I.target.src="/logos/default-logo.png"}})})})}),S.jsx("div",{className:"hidden lg:flex items-center space-x-6",children:b.map((I,H)=>S.jsxs(Oo,{to:I.link,className:`flex items-center text-white hover:text-[#7EBAFF] transition-colors duration-200 ${I.disabled?"opacity-50 cursor-not-allowed":""}`,onClick:L=>I.disabled&&L.preventDefault(),children:[I.icon,I.name,I.disabled&&S.jsx("span",{className:"ml-2 bg-gray-500 text-white text-xs px-2 py-1 rounded-full",children:"Soon"})]},H))}),S.jsx("div",{className:"lg:hidden",children:S.jsxs(Wu,{as:"div",className:"relative inline-block text-left",children:[S.jsx("div",{children:S.jsx(Wu.Button,{className:"text-white hover:text-[#7EBAFF] transition-colors duration-200",children:"Menu"})}),S.jsx(Cj,{as:X.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:S.jsx(Wu.Items,{className:"absolute left-1/2 transform -translate-x-1/2 mt-2 w-56 origin-top bg-[#1A1C24] divide-y divide-[#2C2F36] rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-50",children:S.jsx("div",{className:"px-1 py-1",children:b.map((I,H)=>S.jsx(Wu.Item,{children:({active:L})=>
8319S.jsxs(Oo,{to:I.link,className:`${L?"bg-[#2C2F36] text-[#7EBAFF]":"text-white"} group flex rounded-md items-center w-full px-2 py-2 text-sm ${I.disabled?"opacity-50 cursor-not-allowed":""}`,onClick:U=>I.disabled&&U.preventDefault(),children:[I.icon,I.name,I.disabled&&S.jsx("span",{className:"ml-2 bg-gray-500 text-white text-xs px-2 py-1 rounded-full",children:"Soon"})]})},H))})})})]})}),d?S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("div",{className:"flex items-center",children:[T(),S.jsx("span",{className:"text-white text-sm",children:y(n?n.toString():s)})]}),S.jsx("button",{onClick:E,className:"bg-[#2C2F36] hover:bg-[#363A45] text-[#7EBAFF] font-medium px-4 py-2 rounded-xl text-sm transition-colors duration-200",children:"Disconnect"})]}):S.jsx("button",{onClick:N,className:"bg-[#7EBAFF] hover:bg-[#6BA8FF] text-[#1A1C24] font-medium px-4 py-2 rounded-xl text-sm transition-colors duration-200",children:"Connect Wallet"}),S.jsx(Fse,{isOpen:c,onClose:()=>u(!1)})]})})};var oS={exports:{}};/** 8320 * @license 8321 * Lodash <https://lodash.com/> 8322 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 8323 * Released under MIT license <https://lodash.com/license> 8324 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 8325 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 8326 */var LHe=oS.exports,rZ;function $He(){return rZ||(rZ=1,function(n,e){(function(){var t,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",f=1,m=2,w=4,y=1,b=2,E=1,T=2,N=4,I=8,H=16,L=32,U=64,K=128,Y=256,k=512,j=30,V="...",W=800,$=16,A=1,_=2,R=3,P=1/0,q=9007199254740991,F=17976931348623157e292,z=NaN,B=4294967295,C=B-1,M=B>>>1,Z=[["ary",K],["bind",E],["bindKey",T],["curry",I],["curryRight",H],["flip",k],["partial",L],["partialRight",U],["rearg",Y]],J="[object Arguments]",ae="[object Array]",we="[object AsyncFunction]",he="[object Boolean]",xe="[object Date]",Se="[object DOMException]",Re="[object Error]",et="[object Function]",Me="[object GeneratorFunction]",Fe="[object Map]",ht="[object Number]",Dt="[object Null]",At="[object Object]",Wt="[object Promise]",yn="[object Proxy]",Yt="[object RegExp]",Jt="[object Set]",bn="[object String]",Kt="[object Symbol]",En="[object Undefined]",Xe="[object WeakMap]",at="[object WeakSet]",rt="[object ArrayBuffer]",lt="[object DataView]",yt="[object Float32Array]",oe="[object Float64Array]",Q="[object Int8Array]",ee="[object Int16Array]",fe="[object Int32Array]",Ee="[object Uint8Array]",Te="[object Uint8ClampedArray]",De="[object Uint16Array]",vt="[object Uint32Array]",jt=/\b__p \+= '';/g,kt=/\b(__p \+=) '' \+/g,dn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ut=/&(?:amp|lt|gt|quot|#39);/g,_n=/[&<>"']/g,vn=RegExp(Ut.source),Xn=RegExp(_n.source),kn=/<%-([\s\S]+?)%>/g,tr=/<%([\s\S]+?)%>/g,Cn=/<%=([\s\S]+?)%>/g,de=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ye=/[\\^$.*+?()[\]{}|]/g,Ce=RegExp(ye.source),ke=/^\s+/,Ye=/\s/,Bn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Rn=/\{\n\/\* \[wrapped with (.+)\] \*/,mn=/,? & /,or=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,gn=/[()=,{}\[\]\/\s]/,Rr=/\\(\\)?/g,ga=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Kr=/\w*$/,Yr=/^[-+]0x[0-9a-f]+$/i,ki=/^0b[01]+$/i,Sl=/^\[object .+?Constructor\]$/,uu=/^0o[0-7]+$/i,ma=/^(?:0|[1-9]\d*)$/,Ja=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 1,372 bytes, line 8326
83267f]/g,_l=/($^)/,sd=/['\n\r\u2028\u2029\\]/g,Cl="\\ud800-\\udfff",ep="\\u0300-\\u036f",ec="\\ufe20-\\ufe2f",Tl="\\u20d0-\\u20ff",Ao=ep+ec+Tl,du="\\u2700-\\u27bf",od="a-z\\xdf-\\xf6\\xf8-\\xff",Mc="\\xac\\xb1\\xd7\\xf7",ad="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",cd="\\u2000-\\u206f",tp=" \\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",ld="A-Z\\xc0-\\xd6\\xd8-\\xde",$o="\\ufe0e\\ufe0f",Mg=Mc+ad+cd+tp,j0="['â]",xh="["+Cl+"]",z0="["+Mg+"]",ud="["+Ao+"]",sn="\\d+",ft="["+du+"]",$e="["+od+"]",Pe="[^"+Cl+Mg+sn+du+od+ld+"]",xt="\\ud83c[\\udffb-\\udfff]",Et="(?:"+ud+"|"+xt+")",hn="[^"+Cl+"]",$n="(?:\\ud83c[\\udde6-\\uddff]){2}",pi="[\\ud800-\\udbff][\\udc00-\\udfff]",Br="["+ld+"]",wa="\\u200d",dd="(?:"+$e+"|"+Pe+")",F0="(?:"+Br+"|"+Pe+")",pb="(?:"+j0+"(?:d|ll|m|re|s|t|ve))?",M4="(?:"+j0+"(?:D|LL|M|RE|S|T|VE))?",W0=Et+"?",gb="["+$o+"]?",CE="(?:"+wa+"(?:"+[hn,$n,pi].join("|")+")"+gb+W0+")*",kg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Og="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",TE=gb+W0+CE,IE="(?:"+[ft,$n,pi].join("|")+")"+TE,k4="(?:"+[hn+ud+"?",ud,$n,pi,xh].join("|")+")",H0=RegExp(j0,"g"),hd=RegExp(ud,"g"),V0=RegExp(xt+"(?="+xt+")|"+k4+TE,"g"),q0=RegExp([Br+"?"+$e+"+"+pb+"(?="+[z0,Br,"$"].join("|")+")",F0+"+"+M4+"(?="+[z0,Br+d
vendor: 8,715 bytes, line 8326
8326d,"$"].join("|")+")",Br+"?"+dd+"+"+pb,Br+"+"+M4,Og,kg,sn,IE].join("|"),"g"),Eh=RegExp("["+wa+Cl+Ao+$o+"]"),NE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,mb=["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"],O4=-1,gi={};gi[yt]=gi[oe]=gi[Q]=gi[ee]=gi[fe]=gi[Ee]=gi[Te]=gi[De]=gi[vt]=!0,gi[J]=gi[ae]=gi[rt]=gi[he]=gi[lt]=gi[xe]=gi[Re]=gi[et]=gi[Fe]=gi[ht]=gi[At]=gi[Yt]=gi[Jt]=gi[bn]=gi[Xe]=!1;var li={};li[J]=li[ae]=li[rt]=li[lt]=li[he]=li[xe]=li[yt]=li[oe]=li[Q]=li[ee]=li[fe]=li[Fe]=li[ht]=li[At]=li[Yt]=li[Jt]=li[bn]=li[Kt]=li[Ee]=li[Te]=li[De]=li[vt]=!0,li[Re]=li[et]=li[Xe]=!1;var P4={Ã:"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",Å¿:"s"},ya={"&":"&","<":"<",">":">",'"':""","'":"'"},np={"&":"&","<":"<",">":">",""":'"',"'":"'"},wb={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},K0=parseFloat,oM=parseInt,yb=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,RE=typeof self=="object"&&self&&self.Object===Object&&self,ws=yb||RE||Function("return this")(),Pg=e&&!e.nodeType&&e,Ah=Pg&&!0&&n&&!n.nodeType&&n,D4=Ah&&Ah.exports===Pg,ME=D4&&yb.process,kc=function(){try{var Oe=Ah&&Ah.require&&Ah.require("util").types;return Oe||ME&&ME.binding&&ME.binding("util")}catch{}}(),bb=kc&&kc.isArrayBuffer,B4=kc&&kc.isDate,L4=kc&&kc.isMap,$4=kc&&kc.isRegExp,U4=kc&&kc.isSet,j4=kc&&kc.isTypedArray;function ba(Oe,st,Je){switch(Je.length){case 0:return Oe.call(st);case 1:return Oe.call(st,Je[0]);case 2:return Oe.call(st,Je[0],Je[1]);case 3:return Oe.call(st,Je[0],Je[1],Je[2])}return Oe.apply(st,Je)}function aM(Oe,st,Je,Gt){for(var Kn=-1,Lr=Oe==null?0:Oe.length;++Kn<Lr;){var _s=Oe[Kn];st(Gt,_s,Je(_s),Oe)}return Gt}function Oc(Oe,st){for(var Je=-1,Gt=Oe==null?0:Oe.length;++Je<Gt&&st(Oe[Je],Je,Oe)!==!1;);return Oe}function cM(Oe,st){for(var Je=Oe==null?0:Oe.length;Je--&&st(Oe[Je],Je,Oe)!==!1;);return Oe}function z4(Oe,st){for(var Je=-1,Gt=Oe==null?0:Oe.length;++Je<Gt;)if(!st(Oe[Je],Je,Oe))return!1;return!0}function hu(Oe,st){for(var Je=-1,Gt=Oe==null?0:Oe.length,Kn=0,Lr=[];++Je<Gt;){var _s=Oe[Je];st(_s,Je,Oe)&&(Lr[Kn++]=_s)}return Lr}function vb(Oe,st){var Je=Oe==null?0:Oe.length;return!!Je&&Dg(Oe,st,0)>-1}function kE(Oe,st,Je){for(var Gt=-1,Kn=Oe==null?0:Oe.length;++Gt<Kn;)if(Je(st,Oe[Gt]))return!0;return!1}function Hi(Oe,st){for(var Je=-1,Gt=Oe==null?0:Oe.length,Kn=Array(Gt);++Je<Gt;)Kn[Je]=st(Oe[Je],Je,Oe);return Kn}function fd(Oe,st){for(var Je=-1,Gt=st.length,Kn=Oe.length;++Je<Gt;)Oe[Kn+Je]=st[Je];return Oe}function OE(Oe,st,Je,Gt){var Kn=-1,Lr=Oe==null?0:Oe.length;for(Gt&&Lr&&(Je=Oe[++Kn]);++Kn<Lr;)Je=st(Je,Oe[Kn],Kn,Oe);return Je}function lM(Oe,st,Je,Gt){var Kn=Oe==null?0:Oe.length;for(Gt&&Kn&&(Je=Oe[--Kn]);Kn--;)Je=st(Je,Oe[Kn],Kn,Oe);return Je}function PE(Oe,st){for(var Je=-1,Gt=Oe==null?0:Oe.length;++Je<Gt;)if(st(Oe[Je],Je,Oe))return!0;return!1}var uM=Eb("length");function dM(Oe){return Oe.split("")}function hM(Oe){return Oe.match(or)||[]}function F4(Oe,st,Je){var Gt;return Je(Oe,function(Kn,Lr,_s){if(st(Kn,Lr,_s))return Gt=Lr,!1}),Gt}function xb(Oe,st,Je,Gt){for(var Kn=Oe.length,Lr=Je+(Gt?1:-1);Gt?Lr--:++Lr<Kn;)if(st(Oe[Lr],Lr,Oe))return Lr;return-1}function Dg(Oe,st,Je){return st===st?mM(Oe,st,Je):xb(Oe,Bg,Je)}function DE(Oe,st,Je,Gt){for(var Kn=Je-1,Lr=Oe.length;++Kn<Lr;)if(Gt(Oe[Kn],st))return Kn;return-1}function Bg(Oe){return Oe!==Oe}function W4(Oe,st){var Je=Oe==null?0:Oe.length;return Je?Sb(Oe,st)/Je:z}function Eb(Oe){return function(st){return st==null?t:st[Oe]}}function Ab(Oe){return function(st){return Oe==null?t:Oe[st]}}function BE(Oe,st,Je,Gt,Kn){return Kn(Oe,function(Lr,_s,$r){Je=Gt?(Gt=!1,Lr):st(Je,Lr,_s,$r)}),Je}function H4(Oe,st){var Je=Oe.length;for(Oe.sort(st);Je--;)Oe[Je]=Oe[Je].value;return Oe}function Sb(Oe,st){for(var Je,Gt=-1,Kn=Oe.length;++Gt<Kn;){var Lr=st(Oe[Gt]);Lr!==t&&(Je=Je===t?Lr:Je+Lr)}return Je}function Sh(Oe,st){for(var Je=-1,Gt=Array(Oe);++Je<Oe;)Gt[Je]=st(Je);return Gt}function fM(Oe,st){return Hi(st,function(Je){return[Je,Oe[Je]]})}function V4(Oe){return Oe&&Oe.slice(0,$E(Oe)+1).replace(ke,"")}function tc(Oe){return function(st){return Oe(st)}}function _b(Oe,st){return Hi(st,function(Je){return Oe[Je]})}function Lg(Oe,st){return Oe.has(st)}function $g(Oe,st){for(var Je=-1,Gt=Oe.length;++Je<Gt&&Dg(st,Oe[Je],0)>-1;);return Je}function Ug(Oe,st){for(var Je=Oe.length;Je--&&Dg(st,Oe[Je],0)>-1;);return Je}function pM(Oe,st){for(var Je=Oe.length,Gt=0;Je--;)Oe[Je]===st&&++Gt;return Gt}var Cb=Ab(P4),q4=Ab(ya);function K4(Oe){return"\\"+wb[Oe]}function LE(Oe,st){return Oe==null?t:Oe[st]}function _h(Oe){return Eh.test(Oe)}function Y4(Oe){return NE.test(Oe)}function G4(Oe){for(var st,Je=[];!(st=Oe.next()).done;)Je.push(st.value);return Je}function Tb(Oe){var st=-1,Je=Array(Oe.size);return Oe.forEach(function(Gt,Kn){Je[++st]=[Kn,Gt]}),Je}function Z4(Oe,st){return function(Je){return Oe(st(Je))}}function Ch(Oe,st){for(var Je=-1,Gt=Oe.length,Kn=0,Lr=[];++Je<Gt;){var _s=Oe[Je];(_s===st||_s===d)&&(Oe[Je]=d,Lr[Kn++]=Je)}return Lr}function Ib(Oe){var st=-1,Je=Array(Oe.size);return Oe.forEach(function(Gt){Je[++st]=Gt}),Je}function gM(Oe){var st=-1,Je=Array(Oe.size);return Oe.forEach(function(Gt){Je[++st]=[Gt,Gt]}),Je}function mM(Oe,st,Je){for(var Gt=Je-1,Kn=Oe.length;++Gt<Kn;)if(Oe[Gt]===st)return Gt;return-1}function nc(Oe,st,Je){for(var Gt=Je+1;Gt--;)if(Oe[Gt]===st)return Gt;return Gt}function fu(Oe){return _h(Oe)?X4(Oe):uM(Oe)}function Pc(Oe){return _h(Oe)?UE(Oe):dM(Oe)}function $E(Oe){for(var st=Oe.length;st--&&Ye.test(Oe.charAt(st)););return st}var Q4=Ab(np);function X4(Oe){for(var st=V0.lastIndex=0;V0.test(Oe);)++st;return st}function UE(Oe){return Oe.match(V0)||[]}function wM(Oe){return Oe.match(q0)||[]}var jg=function Oe(st){st=st==null?ws:Th.defaults(ws.Object(),st,Th.pick(ws,mb));var Je=st.Array,Gt=st.Date,Kn=st.Error,Lr=st.Function,_s=st.Math,$r=st.Object,Nb=st.RegExp,J4=st.String,rc=st.TypeError,Rb=Je.prototype,yM=Lr.prototype,zg=$r.prototype,Y0=st["__core-js_shared__"],G0=yM.toString,Gr=zg.hasOwnProperty,Il=0,jE=function(){var g=/[^.]+$/.exec(Y0&&Y0.keys&&Y0.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""}(),Uo=zg.toString,Dc=G0.call($r),Fg=ws._,zE=Nb("^"+G0.call(Gr).replace(ye,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rp=D4?st.Buffer:t,Nl=st.Symbol,Wg=st.Uint8Array,ip=rp?rp.allocUnsafe:t,Z0=Z4($r.getPrototypeOf,$r),Q0=$r.create,sp=zg.propertyIsEnumerable,Mb=Rb.splice,va=Nl?Nl.isConcatSpreadable:t,op=Nl?Nl.iterator:t,jo=Nl?Nl.toStringTag:t,X0=function(){try{var g=Bh($r,"defineProperty");return g({},"",{}),g}catch{}}(),kb=st.clearTimeout!==ws.clearTimeout&&st.clearTimeout,ap=Gt&&Gt.now!==ws.Date.now&&Gt.now,FE=st.setTimeout!==ws.setTimeout&&st.setTimeout,Hg=_s.ceil,pd=_s.floor,Ih=$r.getOwnPropertySymbols,Ob=rp?rp.isBuffer:t,J0=st.isFinite,Bc=Rb.join,Lc=Z4($r.keys,$r),Di=_s.max,Vi=_s.min,gd=Gt.now,cp=st.parseInt,WE=_s.random,HE=Rb.reverse,ew=Bh(st,"DataView"),Ps=Bh(st,"Map"),qi=Bh(st,"Promise"),Cr=Bh(st,"Set"),Rl=Bh(st,"WeakMap"),xa=Bh($r,"create"),Vg=Rl&&new Rl,$c={},e5=Sd(ew),t5=Sd(Ps),tw=Sd(qi),nw=Sd(Cr),n5=Sd(Rl),Nh=Nl?Nl.prototype:t,lp=Nh?Nh.valueOf
vendor: 14,287 bytes, line 8326
8326:t,Rh=Nh?Nh.toString:t;function ge(g){if(ts(g)&&!Jn(g)&&!(g instanceof gr)){if(g instanceof Ea)return g;if(Gr.call(g,"__wrapped__"))return Bs(g)}return new Ea(g)}var ic=function(){function g(){}return function(v){if(!Yi(v))return{};if(Q0)return Q0(v);g.prototype=v;var D=new g;return g.prototype=t,D}}();function Uc(){}function Ea(g,v){this.__wrapped__=g,this.__actions__=[],this.__chain__=!!v,this.__index__=0,this.__values__=t}ge.templateSettings={escape:kn,evaluate:tr,interpolate:Cn,variable:"",imports:{_:ge}},ge.prototype=Uc.prototype,ge.prototype.constructor=ge,Ea.prototype=ic(Uc.prototype),Ea.prototype.constructor=Ea;function gr(g){this.__wrapped__=g,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=B,this.__views__=[]}function rw(){var g=new gr(this.__wrapped__);return g.__actions__=Ds(this.__actions__),g.__dir__=this.__dir__,g.__filtered__=this.__filtered__,g.__iteratees__=Ds(this.__iteratees__),g.__takeCount__=this.__takeCount__,g.__views__=Ds(this.__views__),g}function Pb(){if(this.__filtered__){var g=new gr(this);g.__dir__=-1,g.__filtered__=!0}else g=this.clone(),g.__dir__*=-1;return g}function up(){var g=this.__wrapped__.value(),v=this.__dir__,D=Jn(g),ne=v<0,ce=D?g.length:0,ve=D5(0,ce,this.__views__),Ae=ve.start,Ie=ve.end,je=Ie-Ae,pt=ne?Ie:Ae-1,mt=this.__iteratees__,St=mt.length,Zt=0,An=Vi(je,this.__takeCount__);if(!D||!ne&&ce==je&&An==je)return x5(g,this.__actions__);var Gn=[];e:for(;je--&&Zt<An;){pt+=v;for(var wr=-1,Zn=g[pt];++wr<St;){var kr=mt[wr],jr=kr.iteratee,Ll=kr.type,dc=jr(Zn);if(Ll==_)Zn=dc;else if(!dc){if(Ll==A)continue e;break e}}Gn[Zt++]=Zn}return Gn}gr.prototype=ic(Uc.prototype),gr.prototype.constructor=gr;function os(g){var v=-1,D=g==null?0:g.length;for(this.clear();++v<D;){var ne=g[v];this.set(ne[0],ne[1])}}function Db(){this.__data__=xa?xa(null):{},this.size=0}function r5(g){var v=this.has(g)&&delete this.__data__[g];return this.size-=v?1:0,v}function bM(g){var v=this.__data__;if(xa){var D=v[g];return D===c?t:D}return Gr.call(v,g)?v[g]:t}function vM(g){var v=this.__data__;return xa?v[g]!==t:Gr.call(v,g)}function xM(g,v){var D=this.__data__;return this.size+=this.has(g)?0:1,D[g]=xa&&v===t?c:v,this}os.prototype.clear=Db,os.prototype.delete=r5,os.prototype.get=bM,os.prototype.has=vM,os.prototype.set=xM;function Ei(g){var v=-1,D=g==null?0:g.length;for(this.clear();++v<D;){var ne=g[v];this.set(ne[0],ne[1])}}function VE(){this.__data__=[],this.size=0}function iw(g){var v=this.__data__,D=Yg(v,g);if(D<0)return!1;var ne=v.length-1;return D==ne?v.pop():Mb.call(v,D,1),--this.size,!0}function sw(g){var v=this.__data__,D=Yg(v,g);return D<0?t:v[D][1]}function qE(g){return Yg(this.__data__,g)>-1}function qg(g,v){var D=this.__data__,ne=Yg(D,g);return ne<0?(++this.size,D.push([g,v])):D[ne][1]=v,this}Ei.prototype.clear=VE,Ei.prototype.delete=iw,Ei.prototype.get=sw,Ei.prototype.has=qE,Ei.prototype.set=qg;function Aa(g){var v=-1,D=g==null?0:g.length;for(this.clear();++v<D;){var ne=g[v];this.set(ne[0],ne[1])}}function EM(){this.size=0,this.__data__={hash:new os,map:new(Ps||Ei),string:new os}}function i5(g){var v=em(this,g).delete(g);return this.size-=v?1:0,v}function AM(g){return em(this,g).get(g)}function s5(g){return em(this,g).has(g)}function dp(g,v){var D=em(this,g),ne=D.size;return D.set(g,v),this.size+=D.size==ne?0:1,this}Aa.prototype.clear=EM,Aa.prototype.delete=i5,Aa.prototype.get=AM,Aa.prototype.has=s5,Aa.prototype.set=dp;function md(g){var v=-1,D=g==null?0:g.length;for(this.__data__=new Aa;++v<D;)this.add(g[v])}function Bb(g){return this.__data__.set(g,c),this}function o5(g){return this.__data__.has(g)}md.prototype.add=md.prototype.push=Bb,md.prototype.has=o5;function zo(g){var v=this.__data__=new Ei(g);this.size=v.size}function a5(){this.__data__=new Ei,this.size=0}function Lb(g){var v=this.__data__,D=v.delete(g);return this.size=v.size,D}function KE(g){return this.__data__.get(g)}function c5(g){return this.__data__.has(g)}function $b(g,v){var D=this.__data__;if(D instanceof Ei){var ne=D.__data__;if(!Ps||ne.length<i-1)return ne.push([g,v]),this.size=++D.size,this;D=this.__data__=new Aa(ne)}return D.set(g,v),this.size=D.size,this}zo.prototype.clear=a5,zo.prototype.delete=Lb,zo.prototype.get=KE,zo.prototype.has=c5,zo.prototype.set=$b;function YE(g,v){var D=Jn(g),ne=!D&&Id(g),ce=!D&&!ne&&qh(g),ve=!D&&!ne&&!ce&&pm(g),Ae=D||ne||ce||ve,Ie=Ae?Sh(g.length,J4):[],je=Ie.length;for(var pt in g)(v||Gr.call(g,pt))&&!(Ae&&(pt=="length"||ce&&(pt=="offset"||pt=="parent")||ve&&(pt=="buffer"||pt=="byteLength"||pt=="byteOffset")||Pl(pt,je)))&&Ie.push(pt);return Ie}function Kg(g){var v=g.length;return v?g[Yb(0,v-1)]:t}function l5(g,v){return kw(Ds(g),kl(v,0,g.length))}function u5(g){return kw(Ds(g))}function pu(g,v,D){(D!==t&&!Ra(g[v],D)||D===t&&!(v in g))&&Ml(g,v,D)}function hp(g,v,D){var ne=g[v];(!(Gr.call(g,v)&&Ra(ne,D))||D===t&&!(v in g))&&Ml(g,v,D)}function Yg(g,v){for(var D=g.length;D--;)if(Ra(g[D][0],v))return D;return-1}function Mh(g,v,D,ne){return yd(g,function(ce,ve,Ae){v(ne,ce,D(ce),Ae)}),ne}function wd(g,v){return g&&Ca(v,Us(v),g)}function ow(g,v){return g&&Ca(v,ro(v),g)}function Ml(g,v,D){v=="__proto__"&&X0?X0(g,v,{configurable:!0,enumerable:!0,value:D,writable:!0}):g[v]=D}function aw(g,v){for(var D=-1,ne=v.length,ce=Je(ne),ve=g==null;++D<ne;)ce[D]=ve?t:qw(g,v[D]);return ce}function kl(g,v,D){return g===g&&(D!==t&&(g=g<=D?g:D),v!==t&&(g=g>=v?g:v)),g}function So(g,v,D,ne,ce,ve){var Ae,Ie=v&f,je=v&m,pt=v&w;if(D&&(Ae=ce?D(g,ne,ce,ve):D(g)),Ae!==t)return Ae;if(!Yi(g))return g;var mt=Jn(g);if(mt){if(Ae=v3(g),!Ie)return Ds(g,Ae)}else{var St=no(g),Zt=St==et||St==Me;if(qh(g))return h3(g,Ie);if(St==At||St==J||Zt&&!ce){if(Ae=je||Zt?{}:x3(g),!Ie)return je?vw(g,ow(Ae,g)):ev(g,wd(Ae,g))}else{if(!li[St])return ce?g:{};Ae=E3(g,St,Ie)}}ve||(ve=new zo);var An=ve.get(g);if(An)return An;ve.set(g,Ae),TT(g)?g.forEach(function(Zn){Ae.add(So(Zn,v,D,Zn,g,ve))}):_v(g)&&g.forEach(function(Zn,kr){Ae.set(kr,So(Zn,v,D,kr,g,ve))});var Gn=pt?je?iv:rv:je?ro:Us,wr=mt?t:Gn(g);return Oc(wr||g,function(Zn,kr){wr&&(kr=Zn,Zn=g[kr]),hp(Ae,kr,So(Zn,v,D,kr,g,ve))}),Ae}function d5(g){var v=Us(g);return function(D){return GE(D,g,v)}}function GE(g,v,D){var ne=D.length;if(g==null)return!ne;for(g=$r(g);ne--;){var ce=D[ne],ve=v[ce],Ae=g[ce];if(Ae===t&&!(ce in g)||!ve(Ae))return!1}return!0}function fp(g,v,D){if(typeof g!="function")throw new rc(o);return nm(function(){g.apply(t,D)},v)}function kh(g,v,D,ne){var ce=-1,ve=vb,Ae=!0,Ie=g.length,je=[],pt=v.length;if(!Ie)return je;D&&(v=Hi(v,tc(D))),ne?(ve=kE,Ae=!1):v.length>=i&&(ve=Lg,Ae=!1,v=new md(v));e:for(;++ce<Ie;){var mt=g[ce],St=D==null?mt:D(mt);if(mt=ne||mt!==0?mt:0,Ae&&St===St){for(var Zt=pt;Zt--;)if(v[Zt]===St)continue e;je.push(mt)}else ve(v,St,ne)||je.push(mt)}return je}var yd=m3(_o),Ub=m3(Zg,!0);function ZE(g,v){var D=!0;return yd(g,function(ne,ce,ve){return D=!!v(ne,ce,ve),D}),D}function Ol(g,v,D){for(var ne=-1,ce=g.length;++ne<ce;){var ve=g[ne],Ae=v(ve);if(Ae!=null&&(Ie===t?Ae===Ae&&!Ho(Ae):D(Ae,Ie)))var Ie=Ae,je=ve}return je}function fr(g,v,D,ne){var ce=g.length;for(D=rr(D),D<0&&(D=-D>ce?0:ce+D),ne=ne===t||ne>ce?ce:rr(ne),ne<0&&(ne+=ce),ne=D>ne?0:Au(ne);D<ne;)g[D++]=v;return g}function ui(g,v){var D=[];return yd(g,function(ne,ce,ve){v(ne,ce,ve)&&D.push(ne)}),D}function Tr(g,v,D,ne,ce){var ve=-1,Ae=g.length;for(D||(D=Ed),ce||(ce=[]);++ve<Ae;){var Ie=g[ve];v>0&&D(Ie)?v>1?Tr(Ie,v-1,D,ne,ce):fd(ce,Ie):ne||(ce[ce.length]=Ie)}return ce}var Gg=vp(),pp=vp(!0);function _o(g,v){return g&&Gg(g,v,Us)}function Zg(g,v){return g&&pp(g,v,Us)}function Oh(g,v){return hu(v,function(D){return Dl(g[D])})}function jc(g,v){v=vd(v,g);for(var D=0,ne=v.length;g!=null&&D<ne;)g=g[ei(v[D++])];return D&&D==ne?g:t}function h5(g,v,D){var ne=v(g);return Jn(g)?ne:fd(ne,D(g))}function Mr(g){return g==null?g===t?En:Dt:jo&&jo in $r(g)?P5(g):j5(g)}function cw(g,v){return g>v}function QE(g,v){return g!=null&&Gr.call(g,v)}function f5(g,v){return g!=null&&v in $r(g)}function p5(g,v,D){return g>=Vi(v,D)&&g<Di(v,D)}function XE(g,v,D){for(var ne=D?kE:vb,ce=g[0].length,ve=g.length,Ae=ve,Ie=Je(ve),je=1/0,pt=[];Ae--;){var mt=g[Ae];Ae&&v&&(mt=Hi(mt,tc(v))),je=Vi(mt.length,je),Ie[Ae]=!D&&(v||ce>=120&&mt.length>=120)?new md(Ae&&mt):t}mt=g[0];var St=-1,Zt=Ie[0];e:for(;++St<ce&&pt.length<je;){var An=mt[St],Gn=v?v(An):An;if(An=D||An!==0?An:0,!(Zt?Lg(Zt,Gn):ne(pt,Gn,D))){for(Ae=ve;--Ae;){var wr=Ie[Ae];if(!(wr?Lg(wr,Gn):ne(g[Ae],Gn,D)))continue e}Zt&&Zt.push(Gn),pt.push(An)}}return pt}function JE(g,v,D,ne){return _o(g,function(ce,ve,Ae){v(ne,D(ce),ve,Ae)}),ne}function gp(g,v,D){v=vd(v,g),g=tm(g,v);var ne=g==null?g:g[ei(Co(v))];return ne==null?t:ba(ne,g,D)}function jb(g){return ts(g)&&Mr(g)==J}function Sa(g){return ts(g)&&Mr(g)==rt}function Cs(g){return ts(g)&&Mr(g)==xe}function mp(g,v,D,ne,ce){return g===v?!0:g==null||v==null||!ts(g)&&!ts(v)?g!==g&&v!==v:lw(g,v,D,ne,mp,ce)}function lw(g,v,D,ne,ce,ve){var Ae=Jn(g),Ie=Jn(v),je=Ae?ae:no(g),pt=Ie?ae:no(v);je=je==J?At:je,pt=pt==J?At:pt;var mt=je==At,St=pt==At,Zt=je==pt;if(Zt&&qh(g)){if(!qh(v))return!1;Ae=!0,mt=!1}if(Zt&&!mt)return ve||(ve=new zo),Ae||pm(g)?k5(g,v,D,ne,ce,ve):O5(g,v,je,D,ne,ce,ve);if(!(D&y)){var An=mt&&Gr.call(g,"__wrapped__"),Gn=St&&Gr.call(v,"__wrapped__");if(An||Gn){var wr=An?g.value():g,Zn=Gn?v.value():v;return ve||(ve=new zo),ce(wr,Zn,D,ne,ve)}}return Zt?(ve||(ve=new zo),to(g,v,D,ne,ce,ve)):!1}function zb(g){return ts(g)&&no(g)==Fe}function uw(g,v,D,ne){var ce=D.length,ve=ce,Ae=!ne;if(g==null)return!ve;for(g=$r(g);ce--;){var Ie=D[ce];if(Ae&&Ie[2]?Ie[1]!==g[Ie[0]]:!(Ie[0]in g))return!1}for(;++ce<ve;){Ie=D[ce];var je=Ie[0],pt=g[je],mt=Ie[1];if(Ae&&Ie[2]){if(pt===t&&!(je in g))return!1}else{var St=new zo;if(ne)var Zt=ne(pt,mt,je,g,v,St);if(!(Zt===t?mp(mt,pt,y|b,ne,St):Zt))return!1}}return!0}function gu(g){if(!Yi(g)||uv(g))return!1;var v=Dl(g)?zE:Sl;return v.test(Sd(g))}function Fb(g){return ts(g)&&Mr(g)==Yt}function e3(g){return ts(g)&&no(g)==Jt}function t3(g){return ts(g)&&_p(g.length)&&!!gi[Mr(g)]}function n3(g){return typeof g=="function"?g:g==null?He:typeof g=="object"?Jn(g)?Vb(g[0],g[1]):i3(g):Ur(g)}function Wb(g){if(!Ai(g))return Lc(g);var v=[];for(var D in $r(g))Gr.call(g,D)&&D!="constructor"&&v.push(D);return v}function g5(g){if(!Yi(g))return Lh(g);var v=Ai(g),D=[];for(var ne in g)ne=="constructor"&&(v||!Gr.call(g,ne))||D.push(ne);return D}function Hb(g,v){return g<v}function r3(g,v){var D=-1,ne=Ls(g)?Je(g.length):[];return yd(g,function(ce,ve,Ae){ne[++D]=v(ce,ve,Ae)}),ne}function i3(g){var v=ov(g);return v.length==1&&v[0][2]?$5(v[0][0],v[0][1]):function(D){return D===g||uw(D,g,v)}}function Vb(g,v){return cv(g)&&L5(v)?$5(ei(g),v):function(D){var ne=qw(D,g);return ne===t&&ne===v?ym(D,g):mp(v,ne,y|b)}}function dw(g,v,D,ne,ce){g!==v&&Gg(v,function(ve,Ae){if(ce||(ce=new zo),Yi(ve))SM(g,v,Ae,D,dw,ne,ce);else{var Ie=ne?ne(dv(g,Ae),ve,Ae+"",g,v,ce):t;Ie===t&&(Ie=ve),pu(g,Ae,Ie)}},ro)}function SM(g,v,D,ne,ce,ve,Ae){var Ie=dv(g,D),je=dv(v,D),pt=Ae.get(je);if(pt){pu(g,D,pt);return}var mt=ve?ve(Ie,je,D+"",g,v,Ae):t,St=mt===t;if(St){var Zt=Jn(je),An=!Zt&&qh(je),Gn=!Zt&&!An&&pm(je);mt=je,Zt||An||Gn?Jn(Ie)?mt=Ie:ls(Ie)?mt=Ds(Ie):An?(St=!1,mt=h3(je,!0)):Gn?(St=!1,mt=p3(je,!0)):mt=[]:Hc(je)||Id(je)?(mt=Ie,Id(Ie)?mt=RT(Ie):(!Yi(Ie)||Dl(Ie))&&(mt=x3(je))):St=!1}St&&(Ae.set(je,mt),ce(mt,je,ne,ve,Ae),Ae.delete(je)),pu(g,D,mt)}function s3(g,v){var D=g.length;if(D)return v+=v<0?D:0,Pl(v,D)?g[v]:t}function o3(g,v,D){v.length?v=Hi(v,function(ve){return Jn(ve)?function(Ae){return jc(Ae,ve.length===1?ve[0]:ve)}:ve}):v=[He];var ne=-1;v=Hi(v,tc(On()));var ce=r3(g,function(ve,Ae,Ie){var je=Hi(v,function(pt){return pt(ve)});return{criteria:je,index:++ne,value:ve}});return H4(ce,function(ve,Ae){return _5(ve,Ae,D)})}function m5(g,v){return qb(g,v,function(D,ne){return ym(g,ne)})}function qb(g,v,D){for(var ne=-1,ce=v.length,ve={};++ne<ce;){var Ae=v[ne],Ie=jc(g,Ae);D(Ie,Ae)&&Xg(ve,vd(Ae,g),Ie)}return ve}function w5(g){return function(v){return jc(v,g)}}function Kb(g,v,D,ne){var ce=ne?DE:Dg,ve=-1,Ae=v.length,Ie=g;for(g===v&&(v=Ds(v)),D&&(Ie=Hi(g,tc(D)));++ve<Ae;)for(var je=0,pt=v[ve],mt=D?D(pt):pt;(je=ce(Ie,mt,je,ne))>-1;)Ie!==g&&Mb.call(Ie,je,1),Mb.call(g,je,1);return g}function a3(g,v){for(var D=g?v.length:0,ne=D-1;D--;){var ce=v[D];if(D==ne||ce!==ve){var ve=ce;Pl(ce)?Mb.call(g,ce,1):gw(g,ce)}}return g}function Yb(g,v){return g+pd(WE()*(v-g+1))}function y5(g,v,D,ne){for(var ce=-1,ve=Di(Hg((v-g)/(D||1)),0),Ae=Je(ve);ve--;)Ae[ne?ve:++ce]=g,g+=D;return Ae}function c3(g,v){var D="";if(!g||v<1||v>q)return D;do v%2&&(D+=g),v=pd(v/2),v&&(g+=g);while(v);return D}function lr(g,v){return Rw(A3(g,v,He),g+"")}function Qg(g){return Kg(vm(g))}function Gb(g,v){var D=vm(g);return kw(D,kl(v,0,D.length))}function Xg(g,v,D,ne){if(!Yi(g))return g;v=vd(v,g);for(var ce=-1,ve=v.length,Ae=ve-1,Ie=g;Ie!=null&&++ce<ve;){var je=ei(v[ce]),pt=D;if(je==="__proto__"||je==="constructor"||je==="prototype")return g;if(ce!=Ae){var mt=Ie[je];pt=ne?ne(mt,je,Ie):t,pt===t&&(pt=Yi(mt)?mt:Pl(v[ce+1])?[]:{})}hp(Ie,je,pt),Ie=Ie[je]}return g}var hw=Vg?function(g,v){return Vg.set(g,v),g}:He,fw=X0?function(g,v){return X0(g,"toString",{configurable:!0,enumerable:!1,value:We(v),writable:!0})}:He;function b5(g){return kw(vm(g))}function sc(g,v,D){var ne=-1,ce=g.length;v<0&&(v=-v>ce?0:ce+v),D=D>ce?ce:D,D<0&&(D+=ce),ce=v>D?0:D-v>>>0,v>>>=0;for(var ve=Je(ce);++ne<ce;)ve[ne]=g[ne+v];return ve}function v5(g,v){var D;return yd(g,function(ne,ce,ve){return D=v(ne,ce,ve),!D}),!!D}function pw(g,v,D){var ne=0,ce=g==null?ne:g.length;if(typeof v=="number"&&v===v&&ce<=M){for(;ne<ce;){var ve=ne+ce>>>1,Ae=g[ve];Ae!==null&&!Ho(Ae)&&(D?Ae<=v:Ae<v)?ne=ve+1:ce=ve}return ce}return Zb(g,v,He,D)}function Zb(g,v,D,ne){var ce=0,ve=g==null?0:g.length;if(ve===0)return 0;v=D(v);for(var Ae=v!==v,Ie=v===null,je=Ho(v),pt=v===t;ce<ve;){var mt=pd((ce+ve)/2),St=D(g[mt]),Zt=St!==t,An=St===null,Gn=St===St,wr=Ho(St);if(Ae)var Zn=ne||Gn;else pt?Zn=Gn&&(ne||Zt):Ie?Zn=Gn&&Zt&&(ne||!An):je?Zn=Gn&&Zt&&!An&&(ne||!wr):An||wr?Zn=!1:Zn=ne?St<=v:St<v;Zn?ce=mt+1:ve=mt}return Vi(ve,C)}function l3(g,v){for(var D=-1,ne=g.length,ce=0,ve=[];++D<ne;){var Ae=g[D],Ie=v?v(Ae):Ae;if(!D||!Ra(Ie,je)){var je=Ie;ve[ce++]=Ae===0?0:Ae}}return ve}function Qb(g){return typeof g=="number"?g:Ho(g)?z:+g}function _a(g){if(typeof g=="string")return g;if(Jn(g))return Hi(g,_a)+"";
vendor: 6,581 bytes, line 8326
8326if(Ho(g))return Rh?Rh.call(g):"";var v=g+"";return v=="0"&&1/g==-P?"-0":v}function bd(g,v,D){var ne=-1,ce=vb,ve=g.length,Ae=!0,Ie=[],je=Ie;if(D)Ae=!1,ce=kE;else if(ve>=i){var pt=v?null:R5(g);if(pt)return Ib(pt);Ae=!1,ce=Lg,je=new md}else je=v?[]:Ie;e:for(;++ne<ve;){var mt=g[ne],St=v?v(mt):mt;if(mt=D||mt!==0?mt:0,Ae&&St===St){for(var Zt=je.length;Zt--;)if(je[Zt]===St)continue e;v&&je.push(St),Ie.push(mt)}else ce(je,St,D)||(je!==Ie&&je.push(St),Ie.push(mt))}return Ie}function gw(g,v){return v=vd(v,g),g=tm(g,v),g==null||delete g[ei(Co(v))]}function u3(g,v,D,ne){return Xg(g,v,D(jc(g,v)),ne)}function mw(g,v,D,ne){for(var ce=g.length,ve=ne?ce:-1;(ne?ve--:++ve<ce)&&v(g[ve],ve,g););return D?sc(g,ne?0:ve,ne?ve+1:ce):sc(g,ne?ve+1:0,ne?ce:ve)}function x5(g,v){var D=g;return D instanceof gr&&(D=D.value()),OE(v,function(ne,ce){return ce.func.apply(ce.thisArg,fd([ne],ce.args))},D)}function ww(g,v,D){var ne=g.length;if(ne<2)return ne?bd(g[0]):[];for(var ce=-1,ve=Je(ne);++ce<ne;)for(var Ae=g[ce],Ie=-1;++Ie<ne;)Ie!=ce&&(ve[ce]=kh(ve[ce]||Ae,g[Ie],v,D));return bd(Tr(ve,1),v,D)}function d3(g,v,D){for(var ne=-1,ce=g.length,ve=v.length,Ae={};++ne<ce;){var Ie=ne<ve?v[ne]:t;D(Ae,g[ne],Ie)}return Ae}function Xb(g){return ls(g)?g:[]}function yw(g){return typeof g=="function"?g:He}function vd(g,v){return Jn(g)?g:cv(g,v)?[g]:bu(Zr(g))}var E5=lr;function Ph(g,v,D){var ne=g.length;return D=D===t?ne:D,!v&&D>=ne?g:sc(g,v,D)}var A5=kb||function(g){return ws.clearTimeout(g)};function h3(g,v){if(v)return g.slice();var D=g.length,ne=ip?ip(D):new g.constructor(D);return g.copy(ne),ne}function wp(g){var v=new g.constructor(g.byteLength);return new Wg(v).set(new Wg(g)),v}function f3(g,v){var D=v?wp(g.buffer):g.buffer;return new g.constructor(D,g.byteOffset,g.byteLength)}function Jb(g){var v=new g.constructor(g.source,Kr.exec(g));return v.lastIndex=g.lastIndex,v}function S5(g){return lp?$r(lp.call(g)):{}}function p3(g,v){var D=v?wp(g.buffer):g.buffer;return new g.constructor(D,g.byteOffset,g.length)}function bw(g,v){if(g!==v){var D=g!==t,ne=g===null,ce=g===g,ve=Ho(g),Ae=v!==t,Ie=v===null,je=v===v,pt=Ho(v);if(!Ie&&!pt&&!ve&&g>v||ve&&Ae&&je&&!Ie&&!pt||ne&&Ae&&je||!D&&je||!ce)return 1;if(!ne&&!ve&&!pt&&g<v||pt&&D&&ce&&!ne&&!ve||Ie&&D&&ce||!Ae&&ce||!je)return-1}return 0}function _5(g,v,D){for(var ne=-1,ce=g.criteria,ve=v.criteria,Ae=ce.length,Ie=D.length;++ne<Ae;){var je=bw(ce[ne],ve[ne]);if(je){if(ne>=Ie)return je;var pt=D[ne];return je*(pt=="desc"?-1:1)}}return g.index-v.index}function g3(g,v,D,ne){for(var ce=-1,ve=g.length,Ae=D.length,Ie=-1,je=v.length,pt=Di(ve-Ae,0),mt=Je(je+pt),St=!ne;++Ie<je;)mt[Ie]=v[Ie];for(;++ce<Ae;)(St||ce<ve)&&(mt[D[ce]]=g[ce]);for(;pt--;)mt[Ie++]=g[ce++];return mt}function C5(g,v,D,ne){for(var ce=-1,ve=g.length,Ae=-1,Ie=D.length,je=-1,pt=v.length,mt=Di(ve-Ie,0),St=Je(mt+pt),Zt=!ne;++ce<mt;)St[ce]=g[ce];for(var An=ce;++je<pt;)St[An+je]=v[je];for(;++Ae<Ie;)(Zt||ce<ve)&&(St[An+D[Ae]]=g[ce++]);return St}function Ds(g,v){var D=-1,ne=g.length;for(v||(v=Je(ne));++D<ne;)v[D]=g[D];return v}function Ca(g,v,D,ne){var ce=!D;D||(D={});for(var ve=-1,Ae=v.length;++ve<Ae;){var Ie=v[ve],je=ne?ne(D[Ie],g[Ie],Ie,D,g):t;je===t&&(je=g[Ie]),ce?Ml(D,Ie,je):hp(D,Ie,je)}return D}function ev(g,v){return Ca(g,Cw(g),v)}function vw(g,v){return Ca(g,av(g),v)}function yp(g,v){return function(D,ne){var ce=Jn(D)?aM:Mh,ve=v?v():{};return ce(D,g,On(ne,2),ve)}}function bp(g){return lr(function(v,D){var ne=-1,ce=D.length,ve=ce>1?D[ce-1]:t,Ae=ce>2?D[2]:t;for(ve=g.length>3&&typeof ve=="function"?(ce--,ve):t,Ae&&Wo(D[0],D[1],Ae)&&(ve=ce<3?t:ve,ce=1),v=$r(v);++ne<ce;){var Ie=D[ne];Ie&&g(v,Ie,ne,ve)}return v})}function m3(g,v){return function(D,ne){if(D==null)return D;if(!Ls(D))return g(D,ne);for(var ce=D.length,ve=v?ce:-1,Ae=$r(D);(v?ve--:++ve<ce)&&ne(Ae[ve],ve,Ae)!==!1;);return D}}function vp(g){return function(v,D,ne){for(var ce=-1,ve=$r(v),Ae=ne(v),Ie=Ae.length;Ie--;){var je=Ae[g?Ie:++ce];if(D(ve[je],je,ve)===!1)break}return v}}function T5(g,v,D){var ne=v&E,ce=zc(g);function ve(){var Ae=this&&this!==ws&&this instanceof ve?ce:g;return Ae.apply(ne?D:this,arguments)}return ve}function oc(g){return function(v){v=Zr(v);var D=_h(v)?Pc(v):t,ne=D?D[0]:v.charAt(0),ce=D?Ph(D,1).join(""):v.slice(1);return ne[g]()+ce}}function Fo(g){return function(v){return OE(O(Nd(v).replace(H0,"")),g,"")}}function zc(g){return function(){var v=arguments;switch(v.length){case 0:return new g;case 1:return new g(v[0]);case 2:return new g(v[0],v[1]);case 3:return new g(v[0],v[1],v[2]);case 4:return new g(v[0],v[1],v[2],v[3]);case 5:return new g(v[0],v[1],v[2],v[3],v[4]);case 6:return new g(v[0],v[1],v[2],v[3],v[4],v[5]);case 7:return new g(v[0],v[1],v[2],v[3],v[4],v[5],v[6])}var D=ic(g.prototype),ne=g.apply(D,v);return Yi(ne)?ne:D}}function I5(g,v,D){var ne=zc(g);function ce(){for(var ve=arguments.length,Ae=Je(ve),Ie=ve,je=Ep(ce);Ie--;)Ae[Ie]=arguments[Ie];var pt=ve<3&&Ae[0]!==je&&Ae[ve-1]!==je?[]:Ch(Ae,je);if(ve-=pt.length,ve<D)return w3(g,v,as,ce.placeholder,t,Ae,pt,t,t,D-ve);var mt=this&&this!==ws&&this instanceof ce?ne:g;return ba(mt,this,Ae)}return ce}function xd(g){return function(v,D,ne){var ce=$r(v);if(!Ls(v)){var ve=On(D,3);v=Us(v),D=function(Ie){return ve(ce[Ie],Ie,ce)}}var Ae=g(v,D,ne);return Ae>-1?ce[ve?v[Ae]:Ae]:t}}function mu(g){return Bi(function(v){var D=v.length,ne=D,ce=Ea.prototype.thru;for(g&&v.reverse();ne--;){var ve=v[ne];if(typeof ve!="function")throw new rc(o);if(ce&&!Ae&&_w(ve)=="wrapper")var Ae=new Ea([],!0)}for(ne=Ae?ne:D;++ne<D;){ve=v[ne];var Ie=_w(ve),je=Ie=="wrapper"?sv(ve):t;je&&lv(je[0])&&je[1]==(K|I|L|Y)&&!je[4].length&&je[9]==1?Ae=Ae[_w(je[0])].apply(Ae,je[3]):Ae=ve.length==1&&lv(ve)?Ae[Ie]():Ae.thru(ve)}return function(){var pt=arguments,mt=pt[0];if(Ae&&pt.length==1&&Jn(mt))return Ae.plant(mt).value();for(var St=0,Zt=D?v[St].apply(this,pt):mt;++St<D;)Zt=v[St].call(this,Zt);return Zt}})}function as(g,v,D,ne,ce,ve,Ae,Ie,je,pt){var mt=v&K,St=v&E,Zt=v&T,An=v&(I|H),Gn=v&k,wr=Zt?t:zc(g);function Zn(){for(var kr=arguments.length,jr=Je(kr),Ll=kr;Ll--;)jr[Ll]=arguments[Ll];if(An)var dc=Ep(Zn),$l=pM(jr,dc);if(ne&&(jr=g3(jr,ne,ce,An)),ve&&(jr=C5(jr,ve,Ae,An)),kr-=$l,An&&kr<pt){var js=Ch(jr,dc);return w3(g,v,as,Zn.placeholder,D,jr,js,Ie,je,pt-kr)}var Rd=St?D:this,Cp=Zt?Rd[g]:g;return kr=jr.length,Ie?jr=yu(jr,Ie):Gn&&kr>1&&jr.reverse(),mt&&je<kr&&(jr.length=je),this&&this!==ws&&this instanceof Zn&&(Cp=wr||zc(Cp)),Cp.apply(Rd,jr)}return Zn}function xw(g,v){return function(D,ne){return JE(D,g,v(ne),{})}}function Jg(g,v){return function(D,ne){var ce;if(D===t&&ne===t)return v;if(D!==t&&(ce=D),ne!==t){if(ce===t)return ne;
vendor: 4,286 bytes, line 8326
8326typeof D=="string"||typeof ne=="string"?(D=_a(D),ne=_a(ne)):(D=Qb(D),ne=Qb(ne)),ce=g(D,ne)}return ce}}function Ew(g){return Bi(function(v){return v=Hi(v,tc(On())),lr(function(D){var ne=this;return g(v,function(ce){return ba(ce,ne,D)})})})}function Aw(g,v){v=v===t?" ":_a(v);var D=v.length;if(D<2)return D?c3(v,g):v;var ne=c3(v,Hg(g/fu(v)));return _h(v)?Ph(Pc(ne),0,g).join(""):ne.slice(0,g)}function N5(g,v,D,ne){var ce=v&E,ve=zc(g);function Ae(){for(var Ie=-1,je=arguments.length,pt=-1,mt=ne.length,St=Je(mt+je),Zt=this&&this!==ws&&this instanceof Ae?ve:g;++pt<mt;)St[pt]=ne[pt];for(;je--;)St[pt++]=arguments[++Ie];return ba(Zt,ce?D:this,St)}return Ae}function Dh(g){return function(v,D,ne){return ne&&typeof ne!="number"&&Wo(v,D,ne)&&(D=ne=t),v=Eu(v),D===t?(D=v,v=0):D=Eu(D),ne=ne===t?v<D?1:-1:Eu(ne),y5(v,D,ne,g)}}function xp(g){return function(v,D){return typeof v=="string"&&typeof D=="string"||(v=Vc(v),D=Vc(D)),g(v,D)}}function w3(g,v,D,ne,ce,ve,Ae,Ie,je,pt){var mt=v&I,St=mt?Ae:t,Zt=mt?t:Ae,An=mt?ve:t,Gn=mt?t:ve;v|=mt?L:U,v&=~(mt?U:L),v&N||(v&=-4);var wr=[g,v,ce,An,St,Gn,Zt,Ie,je,pt],Zn=D.apply(t,wr);return lv(g)&&hv(Zn,wr),Zn.placeholder=ne,fv(Zn,g,v)}function tv(g){var v=_s[g];return function(D,ne){if(D=Vc(D),ne=ne==null?0:Vi(rr(ne),292),ne&&J0(D)){var ce=(Zr(D)+"e").split("e"),ve=v(ce[0]+"e"+(+ce[1]+ne));return ce=(Zr(ve)+"e").split("e"),+(ce[0]+"e"+(+ce[1]-ne))}return v(D)}}var R5=Cr&&1/Ib(new Cr([,-0]))[1]==P?function(g){return new Cr(g)}:an;function Sw(g){return function(v){var D=no(v);return D==Fe?Tb(v):D==Jt?gM(v):fM(v,g(v))}}function wu(g,v,D,ne,ce,ve,Ae,Ie){var je=v&T;if(!je&&typeof g!="function")throw new rc(o);var pt=ne?ne.length:0;if(pt||(v&=-97,ne=ce=t),Ae=Ae===t?Ae:Di(rr(Ae),0),Ie=Ie===t?Ie:rr(Ie),pt-=ce?ce.length:0,v&U){var mt=ne,St=ce;ne=ce=t}var Zt=je?t:sv(g),An=[g,v,D,ne,ce,mt,St,ve,Ae,Ie];if(Zt&&Nw(An,Zt),g=An[0],v=An[1],D=An[2],ne=An[3],ce=An[4],Ie=An[9]=An[9]===t?je?0:g.length:Di(An[9]-pt,0),!Ie&&v&(I|H)&&(v&=-25),!v||v==E)var Gn=T5(g,v,D);else v==I||v==H?Gn=I5(g,v,Ie):(v==L||v==(E|L))&&!ce.length?Gn=N5(g,v,D,ne):Gn=as.apply(t,An);var wr=Zt?hw:hv;return fv(wr(Gn,An),g,v)}function nv(g,v,D,ne){return g===t||Ra(g,zg[D])&&!Gr.call(ne,D)?v:g}function y3(g,v,D,ne,ce,ve){return Yi(g)&&Yi(v)&&(ve.set(v,g),dw(g,v,t,y3,ve),ve.delete(v)),g}function M5(g){return Hc(g)?t:g}function k5(g,v,D,ne,ce,ve){var Ae=D&y,Ie=g.length,je=v.length;if(Ie!=je&&!(Ae&&je>Ie))return!1;var pt=ve.get(g),mt=ve.get(v);if(pt&&mt)return pt==v&&mt==g;var St=-1,Zt=!0,An=D&b?new md:t;for(ve.set(g,v),ve.set(v,g);++St<Ie;){var Gn=g[St],wr=v[St];if(ne)var Zn=Ae?ne(wr,Gn,St,v,g,ve):ne(Gn,wr,St,g,v,ve);if(Zn!==t){if(Zn)continue;Zt=!1;break}if(An){if(!PE(v,function(kr,jr){if(!Lg(An,jr)&&(Gn===kr||ce(Gn,kr,D,ne,ve)))return An.push(jr)})){Zt=!1;break}}else if(!(Gn===wr||ce(Gn,wr,D,ne,ve))){Zt=!1;break}}return ve.delete(g),ve.delete(v),Zt}function O5(g,v,D,ne,ce,ve,Ae){switch(D){case lt:if(g.byteLength!=v.byteLength||g.byteOffset!=v.byteOffset)return!1;g=g.buffer,v=v.buffer;case rt:return!(g.byteLength!=v.byteLength||!ve(new Wg(g),new Wg(v)));case he:case xe:case ht:return Ra(+g,+v);case Re:return g.name==v.name&&g.message==v.message;case Yt:case bn:return g==v+"";case Fe:var Ie=Tb;case Jt:var je=ne&y;if(Ie||(Ie=Ib),g.size!=v.size&&!je)return!1;var pt=Ae.get(g);if(pt)return pt==v;ne|=b,Ae.set(g,v);var mt=k5(Ie(g),Ie(v),ne,ce,ve,Ae);return Ae.delete(g),mt;case Kt:if(lp)return lp.call(g)==lp.call(v)}return!1}function to(g,v,D,ne,ce,ve){var Ae=D&y,Ie=rv(g),je=Ie.length,pt=rv(v),mt=pt.length;if(je!=mt&&!Ae)return!1;for(var St=je;St--;){var Zt=Ie[St];if(!(Ae?Zt in v:Gr.call(v,Zt)))return!1}var An=ve.get(g),Gn=ve.get(v);if(An&&Gn)return An==v&&Gn==g;var wr=!0;ve.set(g,v),ve.set(v,g);for(var Zn=Ae;++St<je;){Zt=Ie[St];var kr=g[Zt],jr=v[Zt];if(ne)var Ll=Ae?ne(jr,kr,Zt,v,g,ve):ne(kr,jr,Zt,g,v,ve);if(!(Ll===t?kr===jr||ce(kr,jr,D,ne,ve):Ll)){wr=!1;break}Zn||(Zn=Zt=="constructor")}if(wr&&!Zn){var dc=g.constructor,$l=v.constructor;dc!=$l&&"constructor"in g&&"constructor"in v&&!(typeof dc=="function"&&dc instanceof dc&&typeof $l=="function"&&$l instanceof $l)&&(wr=!1)}return ve.delete(g),ve.delete(v),wr}function Bi(g){return Rw(A3(g,t,Ia),g+"")}function rv(g){return h5(g,Us,Cw)}function iv(g){return h5(g,ro,av)}var sv=Vg?function(g){return Vg.get(g)}:an;
vendor: 10,213 bytes, lines 8326-8328
8326function _w(g){for(var v=g.name+"",D=$c[v],ne=Gr.call($c,v)?D.length:0;ne--;){var ce=D[ne],ve=ce.func;if(ve==null||ve==g)return ce.name}return v}function Ep(g){var v=Gr.call(ge,"placeholder")?ge:g;return v.placeholder}function On(){var g=ge.iteratee||Wn;return g=g===Wn?n3:g,arguments.length?g(arguments[0],arguments[1]):g}function em(g,v){var D=g.__data__;return Ad(v)?D[typeof v=="string"?"string":"hash"]:D.map}function ov(g){for(var v=Us(g),D=v.length;D--;){var ne=v[D],ce=g[ne];v[D]=[ne,ce,L5(ce)]}return v}function Bh(g,v){var D=LE(g,v);return gu(D)?D:t}function P5(g){var v=Gr.call(g,jo),D=g[jo];try{g[jo]=t;var ne=!0}catch{}var ce=Uo.call(g);return ne&&(v?g[jo]=D:delete g[jo]),ce}var Cw=Ih?function(g){return g==null?[]:(g=$r(g),hu(Ih(g),function(v){return sp.call(g,v)}))}:ak,av=Ih?function(g){for(var v=[];g;)fd(v,Cw(g)),g=Z0(g);return v}:ak,no=Mr;(ew&&no(new ew(new ArrayBuffer(1)))!=lt||Ps&&no(new Ps)!=Fe||qi&&no(qi.resolve())!=Wt||Cr&&no(new Cr)!=Jt||Rl&&no(new Rl)!=Xe)&&(no=function(g){var v=Mr(g),D=v==At?g.constructor:t,ne=D?Sd(D):"";if(ne)switch(ne){case e5:return lt;case t5:return Fe;case tw:return Wt;case nw:return Jt;case n5:return Xe}return v});function D5(g,v,D){for(var ne=-1,ce=D.length;++ne<ce;){var ve=D[ne],Ae=ve.size;switch(ve.type){case"drop":g+=Ae;break;case"dropRight":v-=Ae;break;case"take":v=Vi(v,g+Ae);break;case"takeRight":g=Di(g,v-Ae);break}}return{start:g,end:v}}function b3(g){var v=g.match(Rn);return v?v[1].split(mn):[]}function Tw(g,v,D){v=vd(v,g);for(var ne=-1,ce=v.length,ve=!1;++ne<ce;){var Ae=ei(v[ne]);if(!(ve=g!=null&&D(g,Ae)))break;g=g[Ae]}return ve||++ne!=ce?ve:(ce=g==null?0:g.length,!!ce&&_p(ce)&&Pl(Ae,ce)&&(Jn(g)||Id(g)))}function v3(g){var v=g.length,D=new g.constructor(v);return v&&typeof g[0]=="string"&&Gr.call(g,"index")&&(D.index=g.index,D.input=g.input),D}function x3(g){return typeof g.constructor=="function"&&!Ai(g)?ic(Z0(g)):{}}function E3(g,v,D){var ne=g.constructor;switch(v){case rt:return wp(g);case he:case xe:return new ne(+g);case lt:return f3(g,D);case yt:case oe:case Q:case ee:case fe:case Ee:case Te:case De:case vt:return p3(g,D);case Fe:return new ne;case ht:case bn:return new ne(g);case Yt:return Jb(g);case Jt:return new ne;case Kt:return S5(g)}}function B5(g,v){var D=v.length;if(!D)return g;var ne=D-1;return v[ne]=(D>1?"& ":"")+v[ne],v=v.join(D>2?", ":" "),g.replace(Bn,`{ 8327/* [wrapped with `+v+`] */ 8328`)}function Ed(g){return Jn(g)||Id(g)||!!(va&&g&&g[va])}function Pl(g,v){var D=typeof g;return v=v??q,!!v&&(D=="number"||D!="symbol"&&ma.test(g))&&g>-1&&g%1==0&&g<v}function Wo(g,v,D){if(!Yi(D))return!1;var ne=typeof v;return(ne=="number"?Ls(D)&&Pl(v,D.length):ne=="string"&&v in D)?Ra(D[v],g):!1}function cv(g,v){if(Jn(g))return!1;var D=typeof g;return D=="number"||D=="symbol"||D=="boolean"||g==null||Ho(g)?!0:te.test(g)||!de.test(g)||v!=null&&g in $r(v)}function Ad(g){var v=typeof g;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?g!=="__proto__":g===null}function lv(g){var v=_w(g),D=ge[v];if(typeof D!="function"||!(v in gr.prototype))return!1;if(g===D)return!0;var ne=sv(D);return!!ne&&g===ne[0]}function uv(g){return!!jE&&jE in g}var Iw=Y0?Dl:ck;function Ai(g){var v=g&&g.constructor,D=typeof v=="function"&&v.prototype||zg;return g===D}function L5(g){return g===g&&!Yi(g)}function $5(g,v){return function(D){return D==null?!1:D[g]===v&&(v!==t||g in $r(D))}}function U5(g){var v=jw(g,function(ne){return D.size===u&&D.clear(),ne}),D=v.cache;return v}function Nw(g,v){var D=g[1],ne=v[1],ce=D|ne,ve=ce<(E|T|K),Ae=ne==K&&D==I||ne==K&&D==Y&&g[7].length<=v[8]||ne==(K|Y)&&v[7].length<=v[8]&&D==I;if(!(ve||Ae))return g;ne&E&&(g[2]=v[2],ce|=D&E?0:N);var Ie=v[3];if(Ie){var je=g[3];g[3]=je?g3(je,Ie,v[4]):Ie,g[4]=je?Ch(g[3],d):v[4]}return Ie=v[5],Ie&&(je=g[5],g[5]=je?C5(je,Ie,v[6]):Ie,g[6]=je?Ch(g[5],d):v[6]),Ie=v[7],Ie&&(g[7]=Ie),ne&K&&(g[8]=g[8]==null?v[8]:Vi(g[8],v[8])),g[9]==null&&(g[9]=v[9]),g[0]=v[0],g[1]=ce,g}function Lh(g){var v=[];if(g!=null)for(var D in $r(g))v.push(D);return v}function j5(g){return Uo.call(g)}function A3(g,v,D){return v=Di(v===t?g.length-1:v,0),function(){for(var ne=arguments,ce=-1,ve=Di(ne.length-v,0),Ae=Je(ve);++ce<ve;)Ae[ce]=ne[v+ce];ce=-1;for(var Ie=Je(v+1);++ce<v;)Ie[ce]=ne[ce];return Ie[v]=D(Ae),ba(g,this,Ie)}}function tm(g,v){return v.length<2?g:jc(g,sc(v,0,-1))}function yu(g,v){for(var D=g.length,ne=Vi(v.length,D),ce=Ds(g);ne--;){var ve=v[ne];g[ne]=Pl(ve,D)?ce[ve]:t}return g}function dv(g,v){if(!(v==="constructor"&&typeof g[v]=="function")&&v!="__proto__")return g[v]}var hv=Mw(hw),nm=FE||function(g,v){return ws.setTimeout(g,v)},Rw=Mw(fw);function fv(g,v,D){var ne=v+"";return Rw(g,B5(ne,z5(b3(ne),D)))}function Mw(g){var v=0,D=0;return function(){var ne=gd(),ce=$-(ne-D);if(D=ne,ce>0){if(++v>=W)return arguments[0]}else v=0;return g.apply(t,arguments)}}function kw(g,v){var D=-1,ne=g.length,ce=ne-1;for(v=v===t?ne:v;++D<v;){var ve=Yb(D,ce),Ae=g[ve];g[ve]=g[D],g[D]=Ae}return g.length=v,g}var bu=U5(function(g){var v=[];return g.charCodeAt(0)===46&&v.push(""),g.replace(re,function(D,ne,ce,ve){v.push(ce?ve.replace(Rr,"$1"):ne||D)}),v});function ei(g){if(typeof g=="string"||Ho(g))return g;var v=g+"";return v=="0"&&1/g==-P?"-0":v}function Sd(g){if(g!=null){try{return G0.call(g)}catch{}try{return g+""}catch{}}return""}function z5(g,v){return Oc(Z,function(D){var ne="_."+D[0];v&D[1]&&!vb(g,ne)&&g.push(ne)}),g.sort()}function Bs(g){if(g instanceof gr)return g.clone();var v=new Ea(g.__wrapped__,g.__chain__);return v.__actions__=Ds(g.__actions__),v.__index__=g.__index__,v.__values__=g.__values__,v}function _M(g,v,D){(D?Wo(g,v,D):v===t)?v=1:v=Di(rr(v),0);var ne=g==null?0:g.length;if(!ne||v<1)return[];for(var ce=0,ve=0,Ae=Je(Hg(ne/v));ce<ne;)Ae[ve++]=sc(g,ce,ce+=v);return Ae}function F5(g){for(var v=-1,D=g==null?0:g.length,ne=0,ce=[];++v<D;){var ve=g[v];ve&&(ce[ne++]=ve)}return ce}function W5(){var g=arguments.length;if(!g)return[];for(var v=Je(g-1),D=arguments[0],ne=g;ne--;)v[ne-1]=arguments[ne];return fd(Jn(D)?Ds(D):[D],Tr(v,1))}var Ki=lr(function(g,v){return ls(g)?kh(g,Tr(v,1,ls,!0)):[]}),Ta=lr(function(g,v){var D=Co(v);return ls(D)&&(D=t),ls(g)?kh(g,Tr(v,1,ls,!0),On(D,2)):[]}),_d=lr(function(g,v){var D=Co(v);return ls(D)&&(D=t),ls(g)?kh(g,Tr(v,1,ls,!0),t,D):[]});function H5(g,v,D){var ne=g==null?0:g.length;return ne?(v=D||v===t?1:rr(v),sc(g,v<0?0:v,ne)):[]}function V5(g,v,D){var ne=g==null?0:g.length;return ne?(v=D||v===t?1:rr(v),v=ne-v,sc(g,0,v<0?0:v)):[]}function CM(g,v){return g&&g.length?mw(g,On(v,3),!0,!0):[]}function S3(g,v){return g&&g.length?mw(g,On(v,3),!0):[]}function ac(g,v,D,ne){var ce=g==null?0:g.length;return ce?(D&&typeof D!="number"&&Wo(g,v,D)&&(D=0,ne=ce),fr(g,v,D,ne)):[]}function Fc(g,v,D){var ne=g==null?0:g.length;if(!ne)return-1;var ce=D==null?0:rr(D);return ce<0&&(ce=Di(ne+ce,0)),xb(g,On(v,3),ce)}function _3(g,v,D){var ne=g==null?0:g.length;if(!ne)return-1;var ce=ne-1;return D!==t&&(ce=rr(D),ce=D<0?Di(ne+ce,0):Vi(ce,ne-1)),xb(g,On(v,3),ce,!0)}function Ia(g){var v=g==null?0:g.length;return v?Tr(g,1):[]}function q5(g){var v=g==null?0:g.length;return v?Tr(g,P):[]}function $h(g,v){var D=g==null?0:g.length;return D?(v=v===t?1:rr(v),Tr(g,v)):[]}function Ap(g){for(var v=-1,D=g==null?0:g.length,ne={};++v<D;){var ce=g[v];ne[ce[0]]=ce[1]}return ne}function Cd(g){return g&&g.length?g[0]:t}function C3(g,v,D){var ne=g==null?0:g.length;if(!ne)return-1;var ce=D==null?0:rr(D);return ce<0&&(ce=Di(ne+ce,0)),Dg(g,v,ce)}function T3(g){var v=g==null?0:g.length;return v?sc(g,0,-1):[]}var vu=lr(function(g){var v=Hi(g,Xb);return v.length&&v[0]===g[0]?XE(v):[]}),K5=lr(function(g){var v=Co(g),D=Hi(g,Xb);return v===Co(D)?v=t:D.pop(),D.length&&D[0]===g[0]?XE(D,On(v,2)):[]}),rm=lr(function(g){var v=Co(g),D=Hi(g,Xb);return v=typeof v=="function"?v:t,v&&D.pop(),D.length&&D[0]===g[0]?XE(D,t,v):[]});function Ow(g,v){return g==null?"":Bc.call(g,v)}function Co(g){var v=g==null?0:g.length;return v?g[v-1]:t}function im(g,v,D){var ne=g==null?0:g.length;if(!ne)return-1;var ce=ne;return D!==t&&(ce=rr(D),ce=ce<0?Di(ne+ce,0):Vi(ce,ne-1)),v===v?nc(g,v,ce):xb(g,Bg,ce,!0)}function Y5(g,v){return g&&g.length?s3(g,rr(v)):t}var G5=lr(sm);function sm(g,v){return g&&g.length&&v&&v.length?Kb(g,v):g}function Z5(g,v,D){return g&&g.length&&v&&v.length?Kb(g,v,On(D,2)):g}function pv(g,v,D){return g&&g.length&&v&&v.length?Kb(g,v,t,D):g}var Q5=Bi(function(g,v){var D=g==null?0:g.length,ne=aw(g,v);return a3(g,Hi(v,function(ce){return Pl(ce,D)?+ce:ce}).sort(bw)),ne});function TM(g,v){var D=[];if(!(g&&g.length))return D;var ne=-1,ce=[],ve=g.length;for(v=On(v,3);++ne<ve;){var Ae=g[ne];v(Ae,ne,g)&&(D.push(Ae),ce.push(ne))}return a3(g,ce),D}function I3(g){return g==null?g:HE.call(g)}function di(g,v,D){var ne=g==null?0:g.length;return ne?(D&&typeof D!="number"&&Wo(g,v,D)?(v=0,D=ne):(v=v==null?0:rr(v),D=D===t?ne:rr(D)),sc(g,v,D)):[]}function Oi(g,v){return pw(g,v)}function Ar(g,v,D){return Zb(g,v,On(D,2))}function Dr(g,v){var D=g==null?0:g.length;if(D){var ne=pw(g,v);if(ne<D&&Ra(g[ne],v))return ne}return-1}function hi(g,v){return pw(g,v,!0)}function cc(g,v,D){return Zb(g,v,On(D,2),!0)}function Uh(g,v){var D=g==null?0:g.length;if(D){var ne=pw(g,v,!0)-1;if(Ra(g[ne],v))return ne}return-1}function om(g){return g&&g.length?l3(g):[]}function N3(g,v){return g&&g.length?l3(g,On(v,2)):[]}function Td(g){var v=g==null?0:g.length;return v?sc(g,1,v):[]}function cs(g,v,D){return g&&g.length?(v=D||v===t?1:rr(v),sc(g,0,v<0?0:v)):[]}function jh(g,v,D){var ne=g==null?0:g.length;return ne?(v=D||v===t?1:rr(v),v=ne-v,sc(g,v<0?0:v,ne)):[]}function Sp(g,v){return g&&g.length?mw(g,On(v,3),!1,!0):[]}function R3(g,v){return g&&g.length?mw(g,On(v,3)):[]}var Wc=lr(function(g){return bd(Tr(g,1,ls,!0))}),am=lr(function(g){var v=Co(g);return ls(v)&&(v=t),bd(Tr(g,1,ls,!0),On(v,2))}),Pw=lr(function(g){var v=Co(g);return v=typeof v=="function"?v:t,bd(Tr(g,1,ls,!0),t,v)});function Na(g){return g&&g.length?bd(g):[]}function M3(g,v){return g&&g.length?bd(g,On(v,2)):[]}function k3(g,v){return v=typeof v=="function"?v:t,g&&g.length?bd(g,t,v):[]}function cm(g){if(!(g&&g.length))return[];var v=0;return g=hu(g,function(D){if(ls(D))return v=Di(D.length,v),!0}),Sh(v,function(D){return Hi(g,Eb(D))})}function Dw(g,v){if(!(g&&g.length))return[];var D=cm(g);
vendor: 5,447 bytes, line 8328
8328return v==null?D:Hi(D,function(ne){return ba(v,t,ne)})}var zh=lr(function(g,v){return ls(g)?kh(g,v):[]}),po=lr(function(g){return ww(hu(g,ls))}),Fh=lr(function(g){var v=Co(g);return ls(v)&&(v=t),ww(hu(g,ls),On(v,2))}),lm=lr(function(g){var v=Co(g);return v=typeof v=="function"?v:t,ww(hu(g,ls),t,v)}),um=lr(cm);function O3(g,v){return d3(g||[],v||[],hp)}function P3(g,v){return d3(g||[],v||[],Xg)}var X5=lr(function(g){var v=g.length,D=v>1?g[v-1]:t;return D=typeof D=="function"?(g.pop(),D):t,Dw(g,D)});function dm(g){var v=ge(g);return v.__chain__=!0,v}function D3(g,v){return v(g),g}function To(g,v){return v(g)}var J5=Bi(function(g){var v=g.length,D=v?g[0]:0,ne=this.__wrapped__,ce=function(ve){return aw(ve,g)};return v>1||this.__actions__.length||!(ne instanceof gr)||!Pl(D)?this.thru(ce):(ne=ne.slice(D,+D+(v?1:0)),ne.__actions__.push({func:To,args:[ce],thisArg:t}),new Ea(ne,this.__chain__).thru(function(ve){return v&&!ve.length&&ve.push(t),ve}))});function lc(){return dm(this)}function eT(){return new Ea(this.value(),this.__chain__)}function tT(){this.__values__===t&&(this.__values__=uc(this.value()));var g=this.__index__>=this.__values__.length,v=g?t:this.__values__[this.__index__++];return{done:g,value:v}}function IM(){return this}function Wh(g){for(var v,D=this;D instanceof Uc;){var ne=Bs(D);ne.__index__=0,ne.__values__=t,v?ce.__wrapped__=ne:v=ne;var ce=ne;D=D.__wrapped__}return ce.__wrapped__=g,v}function gv(){var g=this.__wrapped__;if(g instanceof gr){var v=g;return this.__actions__.length&&(v=new gr(this)),v=v.reverse(),v.__actions__.push({func:To,args:[I3],thisArg:t}),new Ea(v,this.__chain__)}return this.thru(I3)}function B3(){return x5(this.__wrapped__,this.__actions__)}var hm=yp(function(g,v,D){Gr.call(g,D)?++g[D]:Ml(g,D,1)});function nT(g,v,D){var ne=Jn(g)?z4:ZE;return D&&Wo(g,v,D)&&(v=t),ne(g,On(v,3))}function rT(g,v){var D=Jn(g)?hu:ui;return D(g,On(v,3))}var iT=xd(Fc),L3=xd(_3);function $3(g,v){return Tr(Bw(g,v),1)}function NM(g,v){return Tr(Bw(g,v),P)}function RM(g,v,D){return D=D===t?1:rr(D),Tr(Bw(g,v),D)}function sT(g,v){var D=Jn(g)?Oc:yd;return D(g,On(v,3))}function U3(g,v){var D=Jn(g)?cM:Ub;return D(g,On(v,3))}var oT=yp(function(g,v,D){Gr.call(g,D)?g[D].push(v):Ml(g,D,[v])});function fm(g,v,D,ne){g=Ls(g)?g:vm(g),D=D&&!ne?rr(D):0;var ce=g.length;return D<0&&(D=Di(ce+D,0)),Tv(g)?D<=ce&&g.indexOf(v,D)>-1:!!ce&&Dg(g,v,D)>-1}var mv=lr(function(g,v,D){var ne=-1,ce=typeof v=="function",ve=Ls(g)?Je(g.length):[];return yd(g,function(Ae){ve[++ne]=ce?ba(v,Ae,D):gp(Ae,v,D)}),ve}),aT=yp(function(g,v,D){Ml(g,D,v)});function Bw(g,v){var D=Jn(g)?Hi:r3;return D(g,On(v,3))}function cT(g,v,D,ne){return g==null?[]:(Jn(v)||(v=v==null?[]:[v]),D=ne?t:D,Jn(D)||(D=D==null?[]:[D]),o3(g,v,D))}var lT=yp(function(g,v,D){g[D?0:1].push(v)},function(){return[[],[]]});function uT(g,v,D){var ne=Jn(g)?OE:BE,ce=arguments.length<3;return ne(g,On(v,4),D,ce,yd)}function dT(g,v,D){var ne=Jn(g)?lM:BE,ce=arguments.length<3;return ne(g,On(v,4),D,ce,Ub)}function wv(g,v){var D=Jn(g)?hu:ui;return D(g,zw(On(v,3)))}function hT(g){var v=Jn(g)?Kg:Qg;return v(g)}function fT(g,v,D){(D?Wo(g,v,D):v===t)?v=1:v=rr(v);var ne=Jn(g)?l5:Gb;return ne(g,v)}function Si(g){var v=Jn(g)?u5:b5;return v(g)}function j3(g){if(g==null)return 0;if(Ls(g))return Tv(g)?fu(g):g.length;var v=no(g);return v==Fe||v==Jt?g.size:Wb(g).length}function MM(g,v,D){var ne=Jn(g)?PE:v5;return D&&Wo(g,v,D)&&(v=t),ne(g,On(v,3))}var pT=lr(function(g,v){if(g==null)return[];var D=v.length;return D>1&&Wo(g,v[0],v[1])?v=[]:D>2&&Wo(v[0],v[1],v[2])&&(v=[v[0]]),o3(g,Tr(v,1),[])}),yv=ap||function(){return ws.Date.now()};function kM(g,v){if(typeof v!="function")throw new rc(o);return g=rr(g),function(){if(--g<1)return v.apply(this,arguments)}}function gT(g,v,D){return v=D?t:v,v=g&&v==null?g.length:v,wu(g,K,t,t,t,t,v)}function Lw(g,v){var D;if(typeof v!="function")throw new rc(o);return g=rr(g),function(){return--g>0&&(D=v.apply(this,arguments)),g<=1&&(v=t),D}}var Hh=lr(function(g,v,D){var ne=E;if(D.length){var ce=Ch(D,Ep(Hh));ne|=L}return wu(g,ne,v,D,ce)}),bv=lr(function(g,v,D){var ne=E|T;if(D.length){var ce=Ch(D,Ep(bv));ne|=L}return wu(v,ne,g,D,ce)});function $w(g,v,D){v=D?t:v;var ne=wu(g,I,t,t,t,t,t,v);return ne.placeholder=$w.placeholder,ne}function vv(g,v,D){v=D?t:v;var ne=wu(g,H,t,t,t,t,t,v);return ne.placeholder=vv.placeholder,ne}function Vh(g,v,D){var ne,ce,ve,Ae,Ie,je,pt=0,mt=!1,St=!1,Zt=!0;if(typeof g!="function")throw new rc(o);v=Vc(v)||0,Yi(D)&&(mt=!!D.leading,St="maxWait"in D,ve=St?Di(Vc(D.maxWait)||0,v):ve,Zt="trailing"in D?!!D.trailing:Zt);function An(js){var Rd=ne,Cp=ce;return ne=ce=t,pt=js,Ae=g.apply(Cp,Rd),Ae}function Gn(js){return pt=js,Ie=nm(kr,v),mt?An(js):Ae}function wr(js){var Rd=js-je,Cp=js-pt,wz=v-Rd;return St?Vi(wz,ve-Cp):wz}function Zn(js){var Rd=js-je,Cp=js-pt;return je===t||Rd>=v||Rd<0||St&&Cp>=ve}function kr(){var js=yv();if(Zn(js))return jr(js);Ie=nm(kr,wr(js))}function jr(js){return Ie=t,Zt&&ne?An(js):(ne=ce=t,Ae)}function Ll(){Ie!==t&&A5(Ie),pt=0,ne=je=ce=Ie=t}function dc(){return Ie===t?Ae:jr(yv())}function $l(){var js=yv(),Rd=Zn(js);if(ne=arguments,ce=this,je=js,Rd){if(Ie===t)return Gn(je);if(St)return A5(Ie),Ie=nm(kr,v),An(je)}return Ie===t&&(Ie=nm(kr,v)),Ae}return $l.cancel=Ll,$l.flush=dc,$l}var xu=lr(function(g,v){return fp(g,1,v)}),Uw=lr(function(g,v,D){return fp(g,Vc(v)||0,D)});function OM(g){return wu(g,k)}function jw(g,v){if(typeof g!="function"||v!=null&&typeof v!="function")throw new rc(o);
vendor: 8,789 bytes, line 8328
8328var D=function(){var ne=arguments,ce=v?v.apply(this,ne):ne[0],ve=D.cache;if(ve.has(ce))return ve.get(ce);var Ae=g.apply(this,ne);return D.cache=ve.set(ce,Ae)||ve,Ae};return D.cache=new(jw.Cache||Aa),D}jw.Cache=Aa;function zw(g){if(typeof g!="function")throw new rc(o);return function(){var v=arguments;switch(v.length){case 0:return!g.call(this);case 1:return!g.call(this,v[0]);case 2:return!g.call(this,v[0],v[1]);case 3:return!g.call(this,v[0],v[1],v[2])}return!g.apply(this,v)}}function mT(g){return Lw(2,g)}var wT=E5(function(g,v){v=v.length==1&&Jn(v[0])?Hi(v[0],tc(On())):Hi(Tr(v,1),tc(On()));var D=v.length;return lr(function(ne){for(var ce=-1,ve=Vi(ne.length,D);++ce<ve;)ne[ce]=v[ce].call(this,ne[ce]);return ba(g,this,ne)})}),z3=lr(function(g,v){var D=Ch(v,Ep(z3));return wu(g,L,t,v,D)}),xv=lr(function(g,v){var D=Ch(v,Ep(xv));return wu(g,U,t,v,D)}),yT=Bi(function(g,v){return wu(g,Y,t,t,t,v)});function bT(g,v){if(typeof g!="function")throw new rc(o);return v=v===t?v:rr(v),lr(g,v)}function PM(g,v){if(typeof g!="function")throw new rc(o);return v=v==null?0:Di(rr(v),0),lr(function(D){var ne=D[v],ce=Ph(D,0,v);return ne&&fd(ce,ne),ba(g,this,ce)})}function F3(g,v,D){var ne=!0,ce=!0;if(typeof g!="function")throw new rc(o);return Yi(D)&&(ne="leading"in D?!!D.leading:ne,ce="trailing"in D?!!D.trailing:ce),Vh(g,v,{leading:ne,maxWait:v,trailing:ce})}function W3(g){return gT(g,1)}function DM(g,v){return z3(yw(v),g)}function BM(){if(!arguments.length)return[];var g=arguments[0];return Jn(g)?g:[g]}function Fw(g){return So(g,w)}function LM(g,v){return v=typeof v=="function"?v:t,So(g,w,v)}function vT(g){return So(g,f|w)}function Sr(g,v){return v=typeof v=="function"?v:t,So(g,f|w,v)}function H3(g,v){return v==null||GE(g,v,Us(v))}function Ra(g,v){return g===v||g!==g&&v!==v}var V3=xp(cw),xT=xp(function(g,v){return g>=v}),Id=jb(function(){return arguments}())?jb:function(g){return ts(g)&&Gr.call(g,"callee")&&!sp.call(g,"callee")},Jn=Je.isArray,Ev=bb?tc(bb):Sa;function Ls(g){return g!=null&&_p(g.length)&&!Dl(g)}function ls(g){return ts(g)&&Ls(g)}function $M(g){return g===!0||g===!1||ts(g)&&Mr(g)==he}var qh=Ob||ck,ET=B4?tc(B4):Cs;function AT(g){return ts(g)&&g.nodeType===1&&!Hc(g)}function Av(g){if(g==null)return!0;if(Ls(g)&&(Jn(g)||typeof g=="string"||typeof g.splice=="function"||qh(g)||pm(g)||Id(g)))return!g.length;var v=no(g);if(v==Fe||v==Jt)return!g.size;if(Ai(g))return!Wb(g).length;for(var D in g)if(Gr.call(g,D))return!1;return!0}function mi(g,v){return mp(g,v)}function q3(g,v,D){D=typeof D=="function"?D:t;var ne=D?D(g,v):t;return ne===t?mp(g,v,t,D):!!ne}function $s(g){if(!ts(g))return!1;var v=Mr(g);return v==Re||v==Se||typeof g.message=="string"&&typeof g.name=="string"&&!Hc(g)}function UM(g){return typeof g=="number"&&J0(g)}function Dl(g){if(!Yi(g))return!1;var v=Mr(g);return v==et||v==Me||v==we||v==yn}function Sv(g){return typeof g=="number"&&g==rr(g)}function _p(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=q}function Yi(g){var v=typeof g;return g!=null&&(v=="object"||v=="function")}function ts(g){return g!=null&&typeof g=="object"}var _v=L4?tc(L4):zb;function K3(g,v){return g===v||uw(g,v,ov(v))}function jM(g,v,D){return D=typeof D=="function"?D:t,uw(g,v,ov(v),D)}function ST(g){return CT(g)&&g!=+g}function zM(g){if(Iw(g))throw new Kn(s);return gu(g)}function _T(g){return g===null}function FM(g){return g==null}function CT(g){return typeof g=="number"||ts(g)&&Mr(g)==ht}function Hc(g){if(!ts(g)||Mr(g)!=At)return!1;var v=Z0(g);if(v===null)return!0;var D=Gr.call(v,"constructor")&&v.constructor;return typeof D=="function"&&D instanceof D&&G0.call(D)==Dc}var Cv=$4?tc($4):Fb;function Y3(g){return Sv(g)&&g>=-q&&g<=q}var TT=U4?tc(U4):e3;function Tv(g){return typeof g=="string"||!Jn(g)&&ts(g)&&Mr(g)==bn}function Ho(g){return typeof g=="symbol"||ts(g)&&Mr(g)==Kt}var pm=j4?tc(j4):t3;function Bl(g){return g===t}function G3(g){return ts(g)&&no(g)==Xe}function IT(g){return ts(g)&&Mr(g)==at}var NT=xp(Hb),Ww=xp(function(g,v){return g<=v});function uc(g){if(!g)return[];if(Ls(g))return Tv(g)?Pc(g):Ds(g);if(op&&g[op])return G4(g[op]());var v=no(g),D=v==Fe?Tb:v==Jt?Ib:vm;return D(g)}function Eu(g){if(!g)return g===0?g:0;if(g=Vc(g),g===P||g===-P){var v=g<0?-1:1;return v*F}return g===g?g:0}function rr(g){var v=Eu(g),D=v%1;return v===v?D?v-D:v:0}function Au(g){return g?kl(rr(g),0,B):0}function Vc(g){if(typeof g=="number")return g;if(Ho(g))return z;if(Yi(g)){var v=typeof g.valueOf=="function"?g.valueOf():g;g=Yi(v)?v+"":v}if(typeof g!="string")return g===0?g:+g;g=V4(g);var D=ki.test(g);return D||uu.test(g)?oM(g.slice(2),D?2:8):Yr.test(g)?z:+g}function RT(g){return Ca(g,ro(g))}function gm(g){return g?kl(rr(g),-q,q):g===0?g:0}function Zr(g){return g==null?"":_a(g)}var WM=bp(function(g,v){if(Ai(v)||Ls(v)){Ca(v,Us(v),g);return}for(var D in v)Gr.call(v,D)&&hp(g,D,v[D])}),MT=bp(function(g,v){Ca(v,ro(v),g)}),Iv=bp(function(g,v,D,ne){Ca(v,ro(v),g,ne)}),HM=bp(function(g,v,D,ne){Ca(v,Us(v),g,ne)}),VM=Bi(aw);function qM(g,v){var D=ic(g);return v==null?D:wd(D,v)}var KM=lr(function(g,v){g=$r(g);var D=-1,ne=v.length,ce=ne>2?v[2]:t;for(ce&&Wo(v[0],v[1],ce)&&(ne=1);++D<ne;)for(var ve=v[D],Ae=ro(ve),Ie=-1,je=Ae.length;++Ie<je;){var pt=Ae[Ie],mt=g[pt];(mt===t||Ra(mt,zg[pt])&&!Gr.call(g,pt))&&(g[pt]=ve[pt])}return g}),kT=lr(function(g){return g.push(t,y3),ba(Kw,t,g)});function mm(g,v){return F4(g,On(v,3),_o)}function Hw(g,v){return F4(g,On(v,3),Zg)}function OT(g,v){return g==null?g:Gg(g,On(v,3),ro)}function YM(g,v){return g==null?g:pp(g,On(v,3),ro)}function wm(g,v){return g&&_o(g,On(v,3))}function Vw(g,v){return g&&Zg(g,On(v,3))}function PT(g){return g==null?[]:Oh(g,Us(g))}function Nv(g){return g==null?[]:Oh(g,ro(g))}function qw(g,v,D){var ne=g==null?t:jc(g,v);return ne===t?D:ne}function Z3(g,v){return g!=null&&Tw(g,v,QE)}function ym(g,v){return g!=null&&Tw(g,v,f5)}var DT=xw(function(g,v,D){v!=null&&typeof v.toString!="function"&&(v=Uo.call(v)),g[v]=D},We(He)),BT=xw(function(g,v,D){v!=null&&typeof v.toString!="function"&&(v=Uo.call(v)),Gr.call(g,v)?g[v].push(D):g[v]=[D]},On),GM=lr(gp);function Us(g){return Ls(g)?YE(g):Wb(g)}function ro(g){return Ls(g)?YE(g,!0):g5(g)}function ZM(g,v){var D={};return v=On(v,3),_o(g,function(ne,ce,ve){Ml(D,v(ne,ce,ve),ne)}),D}function QM(g,v){var D={};return v=On(v,3),_o(g,function(ne,ce,ve){Ml(D,ce,v(ne,ce,ve))}),D}var XM=bp(function(g,v,D){dw(g,v,D)}),Kw=bp(function(g,v,D,ne){dw(g,v,D,ne)}),Rv=Bi(function(g,v){var D={};if(g==null)return D;var ne=!1;v=Hi(v,function(ve){return ve=vd(ve,g),ne||(ne=ve.length>1),ve}),Ca(g,iv(g),D),ne&&(D=So(D,f|m|w,M5));for(var ce=v.length;ce--;)gw(D,v[ce]);return D});function Q3(g,v){return bm(g,zw(On(v)))}var JM=Bi(function(g,v){return g==null?{}:m5(g,v)});function bm(g,v){if(g==null)return{};var D=Hi(iv(g),function(ne){return[ne]});return v=On(v),qb(g,D,function(ne,ce){return v(ne,ce[0])})}function ek(g,v,D){v=vd(v,g);var ne=-1,ce=v.length;for(ce||(ce=1,g=t);++ne<ce;){var ve=g==null?t:g[ei(v[ne])];ve===t&&(ne=ce,ve=D),g=Dl(ve)?ve.call(g):ve}return g}function LT(g,v,D){return g==null?g:Xg(g,v,D)}function $T(g,v,D,ne){return ne=typeof ne=="function"?ne:t,g==null?g:Xg(g,v,D,ne)}var X3=Sw(Us),J3=Sw(ro);function eA(g,v,D){var ne=Jn(g),ce=ne||qh(g)||pm(g);if(v=On(v,4),D==null){var ve=g&&g.constructor;ce?D=ne?new ve:[]:Yi(g)?D=Dl(ve)?ic(Z0(g)):{}:D={}}return(ce?Oc:_o)(g,function(Ae,Ie,je){return v(D,Ae,Ie,je)}),D}function UT(g,v){return g==null?!0:gw(g,v)}function Mv(g,v,D){return g==null?g:u3(g,v,yw(D))}function tk(g,v,D,ne){return ne=typeof ne=="function"?ne:t,g==null?g:u3(g,v,yw(D),ne)}function vm(g){return g==null?[]:_b(g,Us(g))}function tA(g){return g==null?[]:_b(g,ro(g))}function nA(g,v,D){return D===t&&(D=v,v=t),D!==t&&(D=Vc(D),D=D===D?D:0),v!==t&&(v=Vc(v),v=v===v?v:0),kl(Vc(g),v,D)}function kv(g,v,D){return v=Eu(v),D===t?(D=v,v=0):D=Eu(D),g=Vc(g),p5(g,v,D)}function rA(g,v,D){if(D&&typeof D!="boolean"&&Wo(g,v,D)&&(v=D=t),D===t&&(typeof v=="boolean"?(D=v,v=t):typeof g=="boolean"&&(D=g,g=t)),g===t&&v===t?(g=0,v=1):(g=Eu(g),v===t?(v=g,g=0):v=Eu(v)),g>v){var ne=g;g=v,v=ne}if(D||g%1||v%1){var ce=WE();return Vi(g+ce*(v-g+K0("1e-"+((ce+"").length-1))),v)}return Yb(g,v)}var jT=Fo(function(g,v,D){return v=v.toLowerCase(),g+(D?Ov(v):v)});function Ov(g){return x(Zr(g).toLowerCase())}function Nd(g){return g=Zr(g),g&&g.replace(Ja,Cb).replace(hd,"")}function Kh(g,v,D){g=Zr(g),v=_a(v);var ne=g.length;D=D===t?ne:kl(rr(D),0,ne);var ce=D;return D-=v.length,D>=0&&g.slice(D,ce)==v}function Yh(g){return g=Zr(g),g&&Xn.test(g)?g.replace(_n,q4):g}function Yw(g){return g=Zr(g),g&&Ce.test(g)?g.replace(ye,"\\$&"):g}var Gw=Fo(function(g,v,D){return g+(D?"-":"")+v.toLowerCase()}),Gh=Fo(function(g,v,D){return g+(D?" ":"")+v.toLowerCase()}),nk=oc("toLowerCase");function zT(g,v,D){g=Zr(g),v=rr(v);var ne=v?fu(g):0;if(!v||ne>=v)return g;var ce=(v-ne)/2;
vendor: 11,250 bytes, lines 8328-8345
8328return Aw(pd(ce),D)+g+Aw(Hg(ce),D)}function Zw(g,v,D){g=Zr(g),v=rr(v);var ne=v?fu(g):0;return v&&ne<v?g+Aw(v-ne,D):g}function rk(g,v,D){g=Zr(g),v=rr(v);var ne=v?fu(g):0;return v&&ne<v?Aw(v-ne,D)+g:g}function FT(g,v,D){return D||v==null?v=0:v&&(v=+v),cp(Zr(g).replace(ke,""),v||0)}function Pv(g,v,D){return(D?Wo(g,v,D):v===t)?v=1:v=rr(v),c3(Zr(g),v)}function WT(){var g=arguments,v=Zr(g[0]);return g.length<3?v:v.replace(g[1],g[2])}var ik=Fo(function(g,v,D){return g+(D?"_":"")+v.toLowerCase()});function Dv(g,v,D){return D&&typeof D!="number"&&Wo(g,v,D)&&(v=D=t),D=D===t?B:D>>>0,D?(g=Zr(g),g&&(typeof v=="string"||v!=null&&!Cv(v))&&(v=_a(v),!v&&_h(g))?Ph(Pc(g),0,D):g.split(v,D)):[]}var Bv=Fo(function(g,v,D){return g+(D?" ":"")+x(v)});function HT(g,v,D){return g=Zr(g),D=D==null?0:kl(rr(D),0,g.length),v=_a(v),g.slice(D,D+v.length)==v}function Qw(g,v,D){var ne=ge.templateSettings;D&&Wo(g,v,D)&&(v=t),g=Zr(g),v=Iv({},v,ne,nv);var ce=Iv({},v.imports,ne.imports,nv),ve=Us(ce),Ae=_b(ce,ve),Ie,je,pt=0,mt=v.interpolate||_l,St="__p += '",Zt=Nb((v.escape||_l).source+"|"+mt.source+"|"+(mt===Cn?ga:_l).source+"|"+(v.evaluate||_l).source+"|$","g"),An="//# sourceURL="+(Gr.call(v,"sourceURL")?(v.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++O4+"]")+` 8329`;g.replace(Zt,function(Zn,kr,jr,Ll,dc,$l){return jr||(jr=Ll),St+=g.slice(pt,$l).replace(sd,K4),kr&&(Ie=!0,St+=`' + 8330__e(`+kr+`) + 8331'`),dc&&(je=!0,St+=`'; 8332`+dc+`; 8333__p += '`),jr&&(St+=`' + 8334((__t = (`+jr+`)) == null ? '' : __t) + 8335'`),pt=$l+Zn.length,Zn}),St+=`'; 8336`;var Gn=Gr.call(v,"variable")&&v.variable;if(!Gn)St=`with (obj) { 8337`+St+` 8338} 8339`;else if(gn.test(Gn))throw new Kn(a);St=(je?St.replace(jt,""):St).replace(kt,"$1").replace(dn,"$1;"),St="function("+(Gn||"obj")+`) { 8340`+(Gn?"":`obj || (obj = {}); 8341`)+"var __t, __p = ''"+(Ie?", __e = _.escape":"")+(je?`, __j = Array.prototype.join; 8342function print() { __p += __j.call(arguments, '') } 8343`:`; 8344`)+St+`return __p 8345}`;var wr=G(function(){return Lr(ve,An+"return "+St).apply(t,Ae)});if(wr.source=St,$s(wr))throw wr;return wr}function iA(g){return Zr(g).toLowerCase()}function Lv(g){return Zr(g).toUpperCase()}function VT(g,v,D){if(g=Zr(g),g&&(D||v===t))return V4(g);if(!g||!(v=_a(v)))return g;var ne=Pc(g),ce=Pc(v),ve=$g(ne,ce),Ae=Ug(ne,ce)+1;return Ph(ne,ve,Ae).join("")}function sk(g,v,D){if(g=Zr(g),g&&(D||v===t))return g.slice(0,$E(g)+1);if(!g||!(v=_a(v)))return g;var ne=Pc(g),ce=Ug(ne,Pc(v))+1;return Ph(ne,0,ce).join("")}function $v(g,v,D){if(g=Zr(g),g&&(D||v===t))return g.replace(ke,"");if(!g||!(v=_a(v)))return g;var ne=Pc(g),ce=$g(ne,Pc(v));return Ph(ne,ce).join("")}function l(g,v){var D=j,ne=V;if(Yi(v)){var ce="separator"in v?v.separator:ce;D="length"in v?rr(v.length):D,ne="omission"in v?_a(v.omission):ne}g=Zr(g);var ve=g.length;if(_h(g)){var Ae=Pc(g);ve=Ae.length}if(D>=ve)return g;var Ie=D-fu(ne);if(Ie<1)return ne;var je=Ae?Ph(Ae,0,Ie).join(""):g.slice(0,Ie);if(ce===t)return je+ne;if(Ae&&(Ie+=je.length-Ie),Cv(ce)){if(g.slice(Ie).search(ce)){var pt,mt=je;for(ce.global||(ce=Nb(ce.source,Zr(Kr.exec(ce))+"g")),ce.lastIndex=0;pt=ce.exec(mt);)var St=pt.index;je=je.slice(0,St===t?Ie:St)}}else if(g.indexOf(_a(ce),Ie)!=Ie){var Zt=je.lastIndexOf(ce);Zt>-1&&(je=je.slice(0,Zt))}return je+ne}function h(g){return g=Zr(g),g&&vn.test(g)?g.replace(Ut,Q4):g}var p=Fo(function(g,v,D){return g+(D?" ":"")+v.toUpperCase()}),x=oc("toUpperCase");function O(g,v,D){return g=Zr(g),v=D?t:v,v===t?Y4(g)?wM(g):hM(g):g.match(v)||[]}var G=lr(function(g,v){try{return ba(g,t,v)}catch(D){return $s(D)?D:new Kn(D)}}),se=Bi(function(g,v){return Oc(v,function(D){D=ei(D),Ml(g,D,Hh(g[D],g))}),g});function me(g){var v=g==null?0:g.length,D=On();return g=v?Hi(g,function(ne){if(typeof ne[1]!="function")throw new rc(o);return[D(ne[0]),ne[1]]}):[],lr(function(ne){for(var ce=-1;++ce<v;){var ve=g[ce];if(ba(ve[0],this,ne))return ba(ve[1],this,ne)}})}function _e(g){return d5(So(g,f))}function We(g){return function(){return g}}function ct(g,v){return g==null||g!==g?v:g}var gt=mu(),Ze=mu(!0);function He(g){return g}function Wn(g){return n3(typeof g=="function"?g:So(g,f))}function Un(g){return i3(So(g,f))}function wi(g,v){return Vb(g,So(v,f))}var Le=lr(function(g,v){return function(D){return gp(D,g,v)}}),Ne=lr(function(g,v){return function(D){return gp(g,D,v)}});function ze(g,v,D){var ne=Us(v),ce=Oh(v,ne);D==null&&!(Yi(v)&&(ce.length||!ne.length))&&(D=v,v=g,g=this,ce=Oh(v,Us(v)));var ve=!(Yi(D)&&"chain"in D)||!!D.chain,Ae=Dl(g);return Oc(ce,function(Ie){var je=v[Ie];g[Ie]=je,Ae&&(g.prototype[Ie]=function(){var pt=this.__chain__;if(ve||pt){var mt=g(this.__wrapped__),St=mt.__actions__=Ds(this.__actions__);return St.push({func:je,args:arguments,thisArg:g}),mt.__chain__=pt,mt}return je.apply(g,fd([this.value()],arguments))})}),g}function dt(){return ws._===this&&(ws._=Fg),this}function an(){}function mr(g){return g=rr(g),lr(function(v){return s3(v,g)})}var Tn=Ew(Hi),Hn=Ew(z4),io=Ew(PE);function Ur(g){return cv(g)?Eb(ei(g)):w5(g)}function Zh(g){return function(v){return g==null?t:jc(g,v)}}var ok=Dh(),nle=Dh(!0);function ak(){return[]}function ck(){return!1}function rle(){return{}}function ile(){return""}function sle(){return!0}function ole(g,v){if(g=rr(g),g<1||g>q)return[];var D=B,ne=Vi(g,B);v=On(v),g-=B;for(var ce=Sh(ne,v);++D<g;)v(D);return ce}function ale(g){return Jn(g)?Hi(g,ei):Ho(g)?[g]:Ds(bu(Zr(g)))}function cle(g){var v=++Il;return Zr(g)+v}var lle=Jg(function(g,v){return g+v},0),ule=tv("ceil"),dle=Jg(function(g,v){return g/v},1),hle=tv("floor");function fle(g){return g&&g.length?Ol(g,He,cw):t}function ple(g,v){return g&&g.length?Ol(g,On(v,2),cw):t}function gle(g){return W4(g,He)}function mle(g,v){return W4(g,On(v,2))}function wle(g){return g&&g.length?Ol(g,He,Hb):t}function yle(g,v){return g&&g.length?Ol(g,On(v,2),Hb):t}var ble=Jg(function(g,v){return g*v},1),vle=tv("round"),xle=Jg(function(g,v){return g-v},0);function Ele(g){return g&&g.length?Sb(g,He):0}function Ale(g,v){return g&&g.length?Sb(g,On(v,2)):0}return ge.after=kM,ge.ary=gT,ge.assign=WM,ge.assignIn=MT,ge.assignInWith=Iv,ge.assignWith=HM,ge.at=VM,ge.before=Lw,ge.bind=Hh,ge.bindAll=se,ge.bindKey=bv,ge.castArray=BM,ge.chain=dm,ge.chunk=_M,ge.compact=F5,ge.concat=W5,ge.cond=me,ge.conforms=_e,ge.constant=We,ge.countBy=hm,ge.create=qM,ge.curry=$w,ge.curryRight=vv,ge.debounce=Vh,ge.defaults=KM,ge.defaultsDeep=kT,ge.defer=xu,ge.delay=Uw,ge.difference=Ki,ge.differenceBy=Ta,ge.differenceWith=_d,ge.drop=H5,ge.dropRight=V5,ge.dropRightWhile=CM,ge.dropWhile=S3,ge.fill=ac,ge.filter=rT,ge.flatMap=$3,ge.flatMapDeep=NM,ge.flatMapDepth=RM,ge.flatten=Ia,ge.flattenDeep=q5,ge.flattenDepth=$h,ge.flip=OM,ge.flow=gt,ge.flowRight=Ze,ge.fromPairs=Ap,ge.functions=PT,ge.functionsIn=Nv,ge.groupBy=oT,ge.initial=T3,ge.intersection=vu,ge.intersectionBy=K5,ge.intersectionWith=rm,ge.invert=DT,ge.invertBy=BT,ge.invokeMap=mv,ge.iteratee=Wn,ge.keyBy=aT,ge.keys=Us,ge.keysIn=ro,ge.map=Bw,ge.mapKeys=ZM,ge.mapValues=QM,ge.matches=Un,ge.matchesProperty=wi,ge.memoize=jw,ge.merge=XM,ge.mergeWith=Kw,ge.method=Le,ge.methodOf=Ne,ge.mixin=ze,ge.negate=zw,ge.nthArg=mr,ge.omit=Rv,ge.omitBy=Q3,ge.once=mT,ge.orderBy=cT,ge.over=Tn,ge.overArgs=wT,ge.overEvery=Hn,ge.overSome=io,ge.partial=z3,ge.partialRight=xv,ge.partition=lT,ge.pick=JM,ge.pickBy=bm,ge.property=Ur,ge.propertyOf=Zh,ge.pull=G5,ge.pullAll=sm,ge.pullAllBy=Z5,ge.pullAllWith=pv,ge.pullAt=Q5,ge.range=ok,ge.rangeRight=nle,ge.rearg=yT,ge.reject=wv,ge.remove=TM,ge.rest=bT,ge.reverse=I3,ge.sampleSize=fT,ge.set=LT,ge.setWith=$T,ge.shuffle=Si,ge.slice=di,ge.sortBy=pT,ge.sortedUniq=om,ge.sortedUniqBy=N3,ge.split=Dv,ge.spread=PM,ge.tail=Td,ge.take=cs,ge.takeRight=jh,ge.takeRightWhile=Sp,ge.takeWhile=R3,ge.tap=D3,ge.throttle=F3,ge.thru=To,ge.toArray=uc,ge.toPairs=X3,ge.toPairsIn=J3,ge.toPath=ale,ge.toPlainObject=RT,ge.transform=eA,ge.unary=W3,ge.union=Wc,ge.unionBy=am,ge.unionWith=Pw,ge.uniq=Na,ge.uniqBy=M3,ge.uniqWith=k3,ge.unset=UT,ge.unzip=cm,ge.unzipWith=Dw,ge.update=Mv,ge.updateWith=tk,ge.values=vm,ge.valuesIn=tA,ge.without=zh,ge.words=O,ge.wrap=DM,ge.xor=po,ge.xorBy=Fh,ge.xorWith=lm,ge.zip=um,ge.zipObject=O3,ge.zipObjectDeep=P3,ge.zipWith=X5,ge.entries=X3,ge.entriesIn=J3,ge.extend=MT,ge.extendWith=Iv,ze(ge,ge),ge.add=lle,ge.attempt=G,ge.camelCase=jT,ge.capitalize=Ov,ge.ceil=ule,ge.clamp=nA,ge.clone=Fw,ge.cloneDeep=vT,ge.cloneDeepWith=Sr,ge.cloneWith=LM,ge.conformsTo=H3,ge.deburr=Nd,ge.defaultTo=ct,ge.divide=dle,ge.endsWith=Kh,ge.eq=Ra,ge.escape=Yh,ge.escapeRegExp=Yw,ge.every=nT,ge.find=iT,ge.findIndex=Fc,ge.findKey=mm,ge.findLast=L3,ge.findLastIndex=_3,ge.findLastKey=Hw,ge.floor=hle,ge.forEach=sT,ge.forEachRight=U3,ge.forIn=OT,ge.forInRight=YM,ge.forOwn=wm,ge.forOwnRight=Vw,ge.get=qw,ge.gt=V3,ge.gte=xT,ge.has=Z3,ge.hasIn=ym,ge.head=Cd,ge.identity=He,ge.includes=fm,ge.indexOf=C3,ge.inRange=kv,ge.invoke=GM,ge.isArguments=Id,ge.isArray=Jn,ge.isArrayBuffer=Ev,ge.isArrayLike=Ls,ge.isArrayLikeObject=ls,ge.isBoolean=$M,ge.isBuffer=qh,ge.isDate=ET,ge.isElement=AT,ge.isEmpty=Av,ge.isEqual=mi,ge.isEqualWith=q3,ge.isError=$s,ge.isFinite=UM,ge.isFunction=Dl,ge.isInteger=Sv,ge.isLength=_p,ge.isMap=_v,ge.isMatch=K3,ge.isMatchWith=jM,ge.isNaN=ST,ge.isNative=zM,ge.isNil=FM,ge.isNull=_T,ge.isNumber=CT,ge.isObject=Yi,ge.isObjectLike=ts,ge.isPlainObject=Hc,ge.isRegExp=Cv,ge.isSafeInteger=Y3,ge.isSet=TT,ge.isString=Tv,ge.isSymbol=Ho,ge.isTypedArray=pm,ge.isUndefined=Bl,ge.isWeakMap=G3,ge.isWeakSet=IT,ge.join=Ow,ge.kebabCase=Gw,ge.last=Co,ge.lastIndexOf=im,ge.lowerCase=Gh,ge.lowerFirst=nk,ge.lt=NT,ge.lte=Ww,ge.max=fle,ge.maxBy=ple,ge.mean=gle,ge.meanBy=mle,ge.min=wle,ge.minBy=yle,ge.stubArray=ak,ge.stubFalse=ck,ge.stubObject=rle,ge.stubString=ile,ge.stubTrue=sle,ge.multiply=ble,ge.nth=Y5,ge.noConflict=dt,ge.noop=an,ge.now=yv,ge.pad=zT,ge.padEnd=Zw,ge.padStart=rk,ge.parseInt=FT,ge.random=rA,ge.reduce=uT,ge.reduceRight=dT,ge.repeat=Pv,ge.replace=WT,ge.result=ek,ge.round=vle,ge.runInContext=Oe,ge.sample=hT,ge.size=j3,ge.snakeCase=ik,ge.some=MM,ge.sortedIndex=Oi,ge.sortedIndexBy=Ar,ge.sortedIndexOf=Dr,ge.sortedLastIndex=hi,ge.sortedLastIndexBy=cc,ge.sortedLastIndexOf=Uh,ge.startCase=Bv,ge.startsWith=HT,ge.subtract=xle,ge.sum=Ele,ge.sumBy=Ale,ge.template=Qw,ge.times=ole,ge.toFinite=Eu,ge.toInteger=rr,ge.toLength=Au,ge.toLower=iA,ge.toNumber=Vc,ge.toSafeInteger=gm,ge.toString=Zr,ge.toUpper=Lv,ge.trim=VT,ge.trimEnd=sk,ge.trimStart=$v,ge.truncate=l,ge.unescape=h,ge.uniqueId=cle,ge.upperCase=p,ge.upperFirst=x,ge.each=sT,ge.eachRight=U3,ge.first=Cd,ze(ge,function(){var g={};return _o(ge,function(v,D){Gr.call(ge.prototype,D)||(g[D]=v)}),g}(),{chain:!1}),ge.VERSION=r,Oc(["bind","bindKey","curry","curryRight","partial","partialRight"],function(g){ge[g].placeholder=ge}),Oc(["drop","take"],function(g,v){gr.prototype[g]=function(D){D=D===t?1:Di(rr(D),0);var ne=this.__filtered__&&!v?new gr(this):this.clone();return ne.__filtered__?ne.__takeCount__=Vi(D,ne.__takeCount__):ne.__views__.push({size:Vi(D,B),type:g+(ne.__dir__<0?"Right":"")}),ne},gr.prototype[g+"Right"]=function(D){return this.reverse()[g](D).reverse()}}),Oc(["filter","map","takeWhile"],function(g,v){var D=v+1,ne=D==A||D==R;gr.prototype[g]=function(ce){var ve=this.clone();return ve.__iteratees__.push({iteratee:On(ce,3),type:D}),ve.__filtered__=ve.__filtered__||ne,ve}}),Oc(["head","last"],function(g,v){var D="take"+(v?"Right":"");
8345gr.prototype[g]=function(){return this[D](1).value()[0]}}),Oc(["initial","tail"],function(g,v){var D="drop"+(v?"":"Right");gr.prototype[g]=function(){return this.__filtered__?new gr(this):this[D](1)}}),gr.prototype.compact=function(){return this.filter(He)},gr.prototype.find=function(g){return this.filter(g).head()},gr.prototype.findLast=function(g){return this.reverse().find(g)},gr.prototype.invokeMap=lr(function(g,v){return typeof g=="function"?new gr(this):this.map(function(D){return gp(D,g,v)})}),gr.prototype.reject=function(g){return this.filter(zw(On(g)))},gr.prototype.slice=function(g,v){g=rr(g);var D=this;return D.__filtered__&&(g>0||v<0)?new gr(D):(g<0?D=D.takeRight(-g):g&&(D=D.drop(g)),v!==t&&(v=rr(v),D=v<0?D.dropRight(-v):D.take(v-g)),D)},gr.prototype.takeRightWhile=function(g){return this.reverse().takeWhile(g).reverse()},gr.prototype.toArray=function(){return this.take(B)},_o(gr.prototype,function(g,v){var D=/^(?:filter|find|map|reject)|While$/.test(v),ne=/^(?:head|last)$/.test(v),ce=ge[ne?"take"+(v=="last"?"Right":""):v],ve=ne||/^find/.test(v);ce&&(ge.prototype[v]=function(){var Ae=this.__wrapped__,Ie=ne?[1]:arguments,je=Ae instanceof gr,pt=Ie[0],mt=je||Jn(Ae),St=function(kr){var jr=ce.apply(ge,fd([kr],Ie));return ne&&Zt?jr[0]:jr};mt&&D&&typeof pt=="function"&&pt.length!=1&&(je=mt=!1);var Zt=this.__chain__,An=!!this.__actions__.length,Gn=ve&&!Zt,wr=je&&!An;if(!ve&&mt){Ae=wr?Ae:new gr(this);var Zn=g.apply(Ae,Ie);return Zn.__actions__.push({func:To,args:[St],thisArg:t}),new Ea(Zn,Zt)}return Gn&&wr?g.apply(this,Ie):(Zn=this.thru(St),Gn?ne?Zn.value()[0]:Zn.value():Zn)})}),Oc(["pop","push","shift","sort","splice","unshift"],function(g){var v=Rb[g],D=/^(?:push|sort|unshift)$/.test(g)?"tap":"thru",ne=/^(?:pop|shift)$/.test(g);ge.prototype[g]=function(){var ce=arguments;if(ne&&!this.__chain__){var ve=this.value();return v.apply(Jn(ve)?ve:[],ce)}return this[D](function(Ae){return v.apply(Jn(Ae)?Ae:[],ce)})}}),_o(gr.prototype,function(g,v){var D=ge[v];if(D){var ne=D.name+"";Gr.call($c,ne)||($c[ne]=[]),$c[ne].push({name:v,func:D})}}),$c[as(t,T).name]=[{name:"wrapper",func:t}],gr.prototype.clone=rw,gr.prototype.reverse=Pb,gr.prototype.value=up,ge.prototype.at=J5,ge.prototype.chain=lc,ge.prototype.commit=eT,ge.prototype.next=tT,ge.prototype.plant=Wh,ge.prototype.reverse=gv,ge.prototype.toJSON=ge.prototype.valueOf=ge.prototype.value=B3,ge.prototype.first=ge.prototype.head,op&&(ge.prototype[op]=IM),ge},Th=jg();Ah?((Ah.exports=Th)._=Th,Pg._=Th):ws._=Th}).call(LHe)}(oS,oS.exports)),oS.exports}var eae=$He(),U9={exports:{}},j9,iZ;function UHe(){if(iZ)return j9;iZ=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return j9=n,j9}var z9,sZ;function jHe(){if(sZ)return z9;sZ=1;var n=UHe();function e(){}function t(){}return t.resetWarningCache=e,z9=function(){function r(o,a,c,u,d,f){if(f!==n){var m=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 m.name="Invariant Violation",m}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},z9}var oZ;function zHe(){return oZ||(oZ=1,U9.exports=jHe()()),U9.exports}var FHe=zHe();const bi=xo(FHe),f2=[{symbol:"SOL",name:"Solana",logoURI:"/cryptos/solana-logo.png",address:"So11111111111111111111111111111111111111112"},{symbol:"YUPFUN",name:"YUPFUN Token",logoURI:"/cryptos/yupfun-logo.png",address:"4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{symbol:"USDC",name:"USD Coin",logoURI:"/cryptos/usdc-logo.png",address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"},{symbol:"USDT",name:"USDT",logoURI:"/cryptos/usdt-logo.png",address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"},{symbol:"USDS",name:"USDS",logoURI:"/cryptos/usds-logo.png",address:"USDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA"},{symbol:"PayPal USD",name:"PYUSD",logoURI:"/cryptos/pyusd-logo.png",address:"2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo"},{symbol:"Jupiter",name:"JUP",logoURI:"/cryptos/jupiter-logo.png",address:"JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"},{symbol:"Raydium",name:"RAY",logoURI:"/cryptos/raydium-logo.png",address:"4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"},{symbol:"Jito",name:"JTO",logoURI:"/cryptos/jito-logo.png",address:"jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL"},{symbol:"Pyth Network",name:"PYTH",logoURI:"/cryptos/pyth-logo.png",address:"HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3"},{symbol:"Jupiter Perps",name:"JLP",logoURI:"/cryptos/jlp-logo.png",address:"27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4"}],p2="433d6f9c-0390-4c61-b2a9-f8cd84460376",tae=({isOpen:n,onClose:e,onSelect:t,fromToken:r,toToken:i,selectingField:s})=>{const[o,a]=X.useState([]),[c,u]=X.useState([]),[d,f]=X.useState(""),[m,w]=X.useState(!1),[y,b]=X.useState(1),[E,T]=X.useState(null),[N,I]=X.useState(null),[H,L]=X.useState(!0),U=X.useRef(),K=20;X.useEffect(()=>{n&&(f(""),T(null),u(f2.slice(0,K)),b(1))},[n]);const Y=F=>F&&F.address&&(F.symbol||F.name),k=F=>
8345({symbol:F.symbol||"",name:F.name||"",logoURI:F.icon||F.logo_uri||F.logoURI||"/cryptos/fallback-token-icon.png",address:F.address||F.id||F.mint,decimals:F.decimals||6}),j=X.useCallback(async F=>{try{const z=await fetch(`https://lite-api.jup.ag/tokens/v2/search?query=${F}`,{headers:{"Content-Type":"application/json","x-api-key":p2}});if(!z.ok)throw new Error(`HTTP error! Status: ${z.status}`);const B=await z.json();let C;if(Array.isArray(B)&&B.length>0)C=B[0];else if(B&&typeof B=="object")C=B;else throw new Error("No token data found");const M=k(C);if(!Y(M))throw new Error("Invalid token data received from API.");return M}catch(z){throw console.error("Error fetching token by address:",z),z}},[]),V=X.useCallback(async F=>{w(!0);try{const z=F.toLowerCase();let B=[];const C=await fetch("https://lite-api.jup.ag/tokens/v2/tag?query=verified",{headers:{"Content-Type":"application/json","x-api-key":p2}});if(C.ok){const M=await C.json();B=(Array.isArray(M)?M:M.result||[]).filter(J=>{var ae,we;return((ae=J.symbol)==null?void 0:ae.toLowerCase().includes(z))||((we=J.name)==null?void 0:we.toLowerCase().includes(z))}).map(k)}if(B.length===0){const M=await fetch("https://lite-api.jup.ag/tokens/v2/recent",{headers:{"Content-Type":"application/json","x-api-key":p2}});if(M.ok){const Z=await M.json();B=(Array.isArray(Z)?Z:[]).filter(ae=>{var we,he;return((we=ae.symbol)==null?void 0:we.toLowerCase().includes(z))||((he=ae.name)==null?void 0:he.toLowerCase().includes(z))}).map(k)}}if(B.length===0){const M=await fetch("https://lite-api.jup.ag/tokens/v2/tag?query=lst",{headers:{"Content-Type":"application/json","x-api-key":p2}});if(M.ok){const Z=await M.json();B=(Array.isArray(Z)?Z:[]).filter(ae=>{var we,he;return((we=ae.symbol)==null?void 0:we.toLowerCase().includes(z))||((he=ae.name)==null?void 0:he.toLowerCase().includes(z))}).map(k)}}return B}catch(z){throw console.error("Error fetching tokens by symbol/name:",z),z}finally{w(!1)}},[]),W=X.useCallback(async()=>{w(!0);try{const F=await fetch("https://lite-api.jup.ag/tokens/v2/tag?query=verified",{headers:{"Content-Type":"application/json","x-api-key":p2}});if(!F.ok)throw new Error(`Failed to load verified tokens: ${F.status}`);const z=await F.json(),C=(Array.isArray(z)?z:z.result||[]).map(k);let M=[...f2];C.forEach(Z=>{M.some(J=>J.address===Z.address)||M.push(Z)});try{const Z=await fetch("https://lite-api.jup.ag/tokens/v2/tag?query=lst",{headers:{"Content-Type":"application/json","x-api-key":p2}});if(Z.ok){const J=await Z.json();(Array.isArray(J)?J:[]).map(k).forEach(he=>{M.some(xe=>xe.address===he.address)||M.push(he)})}}catch(Z){console.warn("Failed to load LST tokens, using verified list only",Z)}a(M),u(M.slice(0,K))}catch(F){console.error("Error loading popular tokens:",F),T("Failed to load tokens. Using fallback list."),a(f2),u(f2.slice(0,K))}finally{w(!1)}},[]);X.useEffect(()=>{n&&H&&(u(f2.slice(0,K)),L(!1),W())},[n,H,W]);const $=X.useCallback(async F=>{w(!0),T(null);try{if(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(F)){const z=await j(F);z?u([z]):(T("Token not found."),u([]))}else{const z=await V(F);u(z.slice(0,K)),T(z.length===0?"No tokens found.":null)}}catch(z){console.error("Search error:",z),T("Failed to search tokens. Please try again."),u([])}finally{w(!1)}},[j,V]),A=X.useMemo(()=>eae.debounce($,300),[$]);X.useEffect(()=>(d===""?(u(f2.slice(0,K)),b(1),T(null)):A(d),()=>A.cancel()),[d,A]);const _=X.useCallback(F=>{m||(U.current&&U.current.disconnect(),U.current=new IntersectionObserver(z=>{z[0].isIntersecting&&d.length===0&&b(B=>{const C=B+1;return u(o.slice(0,C*K)),C})}),F&&U.current.observe(F))},[m,d,o]);X.useEffect(()=>()=>{U.current&&U.current.disconnect()},[]);const R=X.useCallback(F=>{if(!Y(F)){T("Invalid token selected.");return}t(F),e()},[t,e]),P=F=>{navigator.clipboard.writeText(F).then(()=>{I(F);const z=co.success("Address copied to clipboard!",{duration:2e3});setTimeout(()=>{co.dismiss(z),I(null)},2e3)}).catch(()=>{co.error("Failed to copy address.",{duration:2e3})})},q=X.useMemo(()=>c,[c]);return n?S.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:S.jsxs("div",{className:"bg-[#1A1C24] rounded-2xl w-full max-w-md p-6",children:[S.jsxs("div",{className:"flex justify-between items-center mb-6",children:[S.jsx("h2",{className:"text-white text-2xl font-bold",children:"Select a token"}),S.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white",children:S.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),S.jsxs("div",{className:"relative mb-6",children:[S.jsx("input",{type:"text",placeholder:"Search by token name, symbol, or address",className:"w-full bg-[#2C2F36] text-gray-200 rounded-xl px-4 py-3 pl-10",value:d,onChange:F=>f(F.target.value)}),S.jsx("svg",{className:"w-5 h-5 text-gray-400 absolute left-3 top-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),S.jsxs("div",{className:"max-h-[400px] overflow-y-auto custom-scrollbar",children:[E&&S.jsx("div",{className:"text-red-500 text-sm mb-4",children:E}),q.map((F,z)=>S.jsxs("div",{ref:z===q.length-1?_:null,className:`flex items-center justify-between p-3 hover:bg-[#2C2F36] rounded-xl cursor-pointer ${s==="from"&&((r==null?void 0:r.address)||(r==null?void 0:r.id))===F.address||s==="to"&&((i==null?void 0:i.address)||(i==null?void 0:i.id))===F.address?"bg-[#2C2F36]":""}`,onClick:()=>R(F),children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("img",{src:F.logoURI,alt:F.symbol,className:"w-8 h-8 rounded-full",onError:B=>{B.target.onerror=null,B.target.src="/cryptos/fallback-token-icon.png"}}),S.jsxs("div",{children:[S.jsx("div",{className:"text-white",children:F.symbol}),S.jsx("div",{className:"text-gray-400 text-sm",children:F.name})]})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-gray-400 text-sm",children:`${F.address.slice(0,5)}...${F.address.slice(-4)}`}),S.jsx("button",{onClick:B=>{B.stopPropagation(),P(F.address)},className:"text-gray-400 hover:text-white",children:N===F.address?S.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):S.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]},`${F.address}-${z}`)),m&&S.jsx("div",{className:"text-center py-4",children:S.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto"})})]})]})}):null};tae.propTypes={isOpen:bi.bool.isRequired,onClose:bi.func.isRequired,onSelect:bi.func.isRequired,fromToken:bi.object,toToken:bi.object,selectingField:bi.oneOf(["from","to"])};const WHe=Qn.memo(tae),HHe=({isOpen:n,onClose:e,slippage:t,setSlippage:r})=>{const[i,s]=X.useState(""),o=c=>{r(c),s("")},a=c=>{(c===""||Number(c)>=0&&Number(c)<=100)&&(s(c),c!==""&&r(Number(c)))};return n?S.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:S.jsxs("div",{className:"bg-[#1A1C24] rounded-xl p-6 w-full max-w-sm",children:[S.jsxs("div",{className:"flex justify-between items-center mb-4",children:[S.jsx("h3",{className:"text-white text-lg font-medium",children:"Set Slippage Tolerance"}),S.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white",children:S.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),S.jsx("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[.5,1,5].map(c=>S.jsxs("button",{onClick:()=>o(c),className:`px-4 py-2 rounded-lg transition-colors ${t===c?"bg-[#7EBAFF] text-[#1A1C24]":"bg-[#2C2F36] text-white hover:bg-[#363A45]"}`,children:[c,"%"]},c))}),S.jsx("div",{className:"mb-4",children:S.jsxs("div",{className:"flex items-center gap-2 bg-[#2C2F36] rounded-lg p-2",children:[S.jsx("input",{type:"number",value:i,onChange:c=>a(c.target.value),placeholder:"Custom",className:"bg-transparent text-white outline-none w-full"}),S.jsx("span",{className:"text-gray-400",children:"%"})]})}),Number(t)>5&&S.jsx("div",{className:"text-red-500 text-sm mb-4",children:"High slippage increases the risk of price impact"}),S.jsx("button",{onClick:e,className:"w-full bg-[#7EBAFF] hover:bg-[#6
8345BA8FF] text-[#1A1C24] rounded-lg py-2 font-medium transition-colors",children:"Confirm"})]})}):null},VHe=({fromToken:n,toToken:e,fromAmount:t="0",toAmount:r="0",priceImpact:i="0",minimumReceived:s="0",fees:o="0",swapFee:a="0",fromTokenPrice:c="0",swapFeeInToken:u="0",amountAfterFee:d="0",routes:f=[],feeAmountInLamports:m=0})=>{const w=m/1e9,y=w*(r/t);return S.jsxs("div",{className:"bg-[#1A1C24] rounded-xl p-4 mt-4",children:[S.jsxs("div",{className:"flex items-center justify-between mb-4",children:[S.jsxs("span",{className:"text-white text-lg",children:["1 ",n==null?void 0:n.symbol," â ",(r/t).toFixed(6)," ",e==null?void 0:e.symbol]}),S.jsx("div",{className:"flex gap-2",children:S.jsx("button",{className:"text-[#7EBAFF]",onClick:()=>{const b=(r/t).toFixed(6);navigator.clipboard.writeText(`1 ${n==null?void 0:n.symbol} = ${b} ${e==null?void 0:e.symbol}`)},children:S.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[S.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),S.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})})})]}),S.jsxs("div",{className:"space-y-3",children:[S.jsxs("div",{className:"flex justify-between items-center text-gray-400",children:[S.jsxs("div",{className:"flex items-center gap-1",children:["Minimum Received",S.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M12 16v-4"}),S.jsx("path",{d:"M12 8h.01"})]})]}),S.jsxs("span",{className:"text-white",children:[s==null?void 0:s.toFixed(6)," ",e==null?void 0:e.symbol]})]}),S.jsxs("div",{className:"flex justify-between items-center text-gray-400",children:[S.jsxs("div",{className:"flex items-center gap-1",children:["Price Impact",S.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M12 16v-4"}),S.jsx("path",{d:"M12 8h.01"})]})]}),S.jsxs("span",{className:`${parseFloat(i)>1?"text-yellow-400":parseFloat(i)>5?"text-red-500":"text-white"}`,children:[i,"%"]})]}),S.jsxs("div",{className:"flex justify-between items-center text-gray-400",children:[S.jsxs("div",{className:"flex items-center gap-1",children:["Swap Fee (0.001-0.015 SOL)",S.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M12 16v-4"}),S.jsx("path",{d:"M12 8h.01"})]})]}),S.jsxs("span",{className:"text-white",children:[w.toFixed(4)," SOL (~",y.toFixed(2),") ",e==null?void 0:e.symbol]})]}),S.jsxs("div",{className:"flex justify-between items-center text-gray-400",children:[S.jsxs("div",{className:"flex items-center gap-1",children:["Route",S.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M12 16v-4"}),S.jsx("path",{d:"M12 8h.01"})]})]}),S.jsx("div",{className:"flex flex-wrap items-center justify-end gap-1 text-sm",children:f==null?void 0:f.map((b,E)=>S.jsxs("div",{className:"flex items-center",children:[E>0&&S.jsx("span",{className:"mx-1 text-gray-400",children:"â"}),S.jsx("span",{className:"text-white",children:b.name}),S.jsxs("span",{className:"text-gray-400 ml-1",children:["(",b.percent,"%)"]})]},E))})]}),S.jsxs("div",{className:"flex justify-between items-center text-gray-400",children:[S.jsxs("div",{className:"flex items-center gap-1",children:["Network Fee",S.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M12 16v-4"}),S.jsx("path",{d:"M12 8h.01"})]})]}),S.jsxs("span",{className:"text-white",children:[typeof o=="number"?o.toFixed(4):o," ",n==null?void 0:n.symbol]})]})]}),Number(t)<.01&&S.jsxs("div",{className:"mt-4 text-pink-500 text-sm",children:["You need at least 0.01 ",n==null?void 0:n.symbol," to pay for fees and deposits"]}),parseFloat(i)>5&&S.jsx("div",{className:"mt-4 text-pink-500 text-sm",children:"Warning: High price impact. You may want to reduce your trade size."})]})},F9=new Map,g8="433d6f9c-0390-4c61-b2a9-f8cd84460376",W9=5,qHe=5e3,KHe=new bt("5S4bV6LwHyfme8349Xu4x7K46RzGTPfdt5hkZhtuaPXe"),m8=async(n,e)=>{var t,r,i,s;if(F9.has(e))return F9.get(e);if(e==="So11111111111111111111111111111111111111112")return 9;try{const o=new bt(e),a=await n.getParsedAccountInfo(o);if(((s=(i=(r=(t=a.value)==null?void 0:t.data)==null?void 0:r.parsed)==null?void 0:i.info)==null?void 0:s.decimals)!==void 0){const c=a.value.data.parsed.info.decimals;return F9.set(e,c),c}return 6}catch(o){return console.error("Error fetching token decimals:",o),6}},Ux=async(n,e,t=W9,r=qHe)=>{try{const i=await fetch(n,e);if(i.status===400){const s=await i.json();throw new Error(s.message||"Invalid request")}if(i.status===429&&t>0){const s=i.headers.get("Retry-After"),o=s?parseInt(s)*1e3:Math.min(r*Math.pow(2,W9-t)+Math.random()*1e3);return console.log(`Rate limited, retrying in ${Math.round(o)}ms...`),await new Promise(a=>setTimeout(a,o)),Ux(n,e,t-1,r)}if(!i.ok){const s=await i.json();throw new Error(`HTTP error! status: ${i.status}, message: ${s.message||"Unknown error"}`)}return i}catch(i){if(t>0&&!i.message.includes("Invalid request")){const s=Math.min(r*Math.pow(2,W9-t)+Math.random()*1e3);return console.log(`Request failed, retrying in ${Math.round(s)}ms...`),await new Promise(o=>setTimeout(o,s)),Ux(n,e,t-1,r)}throw i}},P2=n=>{try{return new bt(n),!0}catch{return!1}},YHe=async()=>{try{const e=await(await Ux("https://lite-api.jup.ag/tokens/v2/tag?query=verified",{headers:{"Content-Type":"application/json","x-api-key":g8}})).json();return Array.isArray(e)?e:e.result||e||[]}catch(n){return console.error("Error fetching token list:",n),[]}},GHe=async(n,e,t,r,i)=>{var c;if(r<.01)throw new Error(`Minimum amount is ${.01} ${e.symbol}`);const o=e.address||e.id,a=t.address||t.id;if(!P2(o))throw new Error(`Invalid fromToken address: ${o}`);if(!P2(a))throw new Error(`Invalid toToken address: ${a}`);try{const u=parseFloat(r);if(isNaN(u))throw new Error("Invalid amount provided");(t.decimals===void 0||t.decimals===null)&&(t.decimals=await m8(n,a)),(e.decimals===void 0||e.decimals===null)&&(e.decimals=await m8(n,o));const d=Math.floor(u*Math.pow(10,e.decimals));try{const m=await(await Ux(`https://lite-api.jup.ag/swap/v1/quote?inputMint=${o}&outputMint=${a}&amount=${d}&slippageBps=${i*100}`,{headers:{"Content-Type":"application/json","x-api-key":g8}})).json();if(m.error)throw m.errorCode==="TOKEN_NOT_TRADABLE"?new Error(`Token ${t.symbol||t.address} is not currently tradable on Jupiter`):new Error(m.error);if(!m||!m.outAmount)throw new Error("No route found for this swap. Please try a different token pair.");const w=m.outAmount/Math.pow(10,t.decimals),y=w/u,b=parseFloat(m.priceImpactPct*100).toFixed(2);let E=u*.02;const T=y,N=E*T,I=u-E;let H;try{H=Math.floor(E*Math.pow(10,e.decimals))}catch{H=.001*Zp}const L=.001*Zp,U=.015*Zp;return H<L?H=L:H>U&&(H=U),{amountOut:w,minimumReceived:m.otherAmountThreshold/Math.pow(10,t.decimals),priceImpact:b,fees:(m.feeBps/1e4).toFixed(4),price:y,swapFee:E,swapFeeInToken:N,fromTokenPrice:T,amountAfterFee:I,feeAmountInLamports:H,routes:((c=m.routePlan)==null?void 0:c.map(K=>({name:K.swapInfo.label,percent:K.percent})))||[]}}catch(f){throw f.message.includes("400")||f.message.includes("Invalid request")?new Error(`Token ${t.symbol||t.address} is not currently tradable on Jupiter`):f}}catch(u){throw u.message.includes("TOKEN_NOT_TRADABLE")||u.message.includes("not currently tradable")||u.message.includes("400")||u.message.includes("Invalid request")?new Error(`Token ${t.symbol||t.address} is not currently tradable. Please try another token.`):new Error("Failed to calculate swap. Please try a different token pair.")}},ZHe=n=>{var e,t,r,i;return{signTransaction:(e=n==null?void 0:n.signTransaction)==null?void 0:e.b
8345ind(n),signAllTransactions:(t=n==null?void 0:n.signAllTransactions)==null?void 0:t.bind(n),signAndSendTransaction:(r=n==null?void 0:n.signAndSendTransaction)==null?void 0:r.bind(n),sendTransaction:(i=n==null?void 0:n.sendTransaction)==null?void 0:i.bind(n)}},QHe=async(n,e,t,r,i,s)=>{let a=0;const c=t.address||t.id,u=r.address||r.id;if(!P2(c))throw new Error(`Invalid fromToken address: ${c}`);if(!P2(u))throw new Error(`Invalid toToken address: ${u}`);const d=async()=>{try{if(!e||!e.publicKey)throw new Error("Wallet not connected");const f=ZHe(e),m=parseFloat(i);if(isNaN(m))throw new Error("Invalid amount provided");(t.decimals===void 0||t.decimals===null)&&(t.decimals=await m8(n,t.address));const w=Math.floor(m*Math.pow(10,t.decimals));if(!P2(t.address))throw new Error(`Invalid fromToken address: ${t.address}`);if(!P2(r.address))throw new Error(`Invalid toToken address: ${r.address}`);(r.decimals===void 0||r.decimals===null)&&(r.decimals=await m8(n,r.address));const b=await(await Ux(`https://lite-api.jup.ag/swap/v1/quote?inputMint=${t.address}&outputMint=${r.address}&amount=${w}&slippageBps=${s*100}`,{headers:{"Content-Type":"application/json","x-api-key":g8}})).json();let E=m*.02;const T=b.amountOut/m,N=E*T;let I;try{I=Math.floor(E*Math.pow(10,t.decimals))}catch{I=.001*Zp}const H=.001*Zp,L=.015*Zp;I<H?I=H:I>L&&(I=L);const U=await n.getBalance(e.publicKey),K=I+.015*Zp;if(U<K)return{error:`Low balance! Ensure at least ${(K/Zp).toFixed(2)} SOL to cover fees and guarantee a smooth transaction.`,feeAmountInLamports:I,solBalance:U,requiredSolBalance:K};const Y=new Wr().add(fo.transfer({fromPubkey:e.publicKey,toPubkey:KHe,lamports:I}));Y.recentBlockhash=(await n.getLatestBlockhash()).blockhash,Y.feePayer=e.publicKey;let k;if(f.signAndSendTransaction)try{k=await f.signAndSendTransaction(Y)}catch(R){if(console.warn("signAndSendTransaction failed, falling back",R),f.signTransaction){const P=await f.signTransaction(Y);k=await n.sendRawTransaction(P.serialize())}else if(f.sendTransaction)k=await f.sendTransaction(Y,n);else throw new Error("Wallet does not support any transaction methods")}else if(typeof e.sendTransaction=="function")k=await e.sendTransaction(Y,n);else if(typeof e.signTransaction=="function"){const R=await e.signTransaction(Y);k=await n.sendRawTransaction(R.serialize())}else throw new Error("Wallet does not support any transaction methods");const V=await(await Ux("https://lite-api.jup.ag/swap/v1/swap",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":g8},body:JSON.stringify({quoteResponse:b,userPublicKey:e.publicKey.toString(),wrapUnwrapSOL:!0,computeUnitPriceMicroLamports:5e4,asLegacyTransaction:!1})})).json(),{swapTransaction:W}=V,$=w1.deserialize(pn.from(W,"base64"));$.recentBlockhash=(await n.getLatestBlockhash()).blockhash,$.feePayer=e.publicKey;const A={commitment:"confirmed",timeout:6e4,disableRetryOnRateLimit:!1};let _;if(typeof e.signAndSendTransaction=="function")try{_=await e.signAndSendTransaction($,A)}catch(R){if(console.warn("signAndSendTransaction failed, falling back",R),typeof e.signTransaction=="function"){const P=await e.signTransaction($);_=await n.sendRawTransaction(P.serialize(),{skipPreflight:!1,maxRetries:3})}else if(typeof e.sendTransaction=="function")_=await e.sendTransaction($,n,A);else throw new Error("Wallet does not support any transaction methods")}else if(typeof e.sendTransaction=="function")_=await e.sendTransaction($,n);else if(typeof e.signTransaction=="function"){const R=await e.signTransaction($);_=await n.sendRawTransaction(R.serialize())}else throw new Error("Wallet does not support any transaction methods");return{signature:_,quote:b,feeSignature:k}}catch(f){let m="Unknown error";if(f!=null&&(typeof f=="string"&&f.trim()!==""?m=f:f.message?m=f.message:f.toString&&(m=f.toString())),a<3&&(m.includes("429")||m.includes("timeout")||m.includes("failed")||m.includes("Unable to confirm"))){a++;const w=Math.pow(2,a)*1e3;return console.log(`Retrying swap in ${w}ms...`,f),await new Promise(y=>setTimeout(y,w)),d()}throw f instanceof Error?f:new Error(m)}};return d()},qI=async(n,e,t)=>{if(!e||!t)return 0;try{if(t.symbol==="SOL")return await n.getBalance(e)/1e9;const r=t.address||t.id,i=new bt(r),s=await n.getParsedTokenAccountsByOwner(e,{mint:i});return s.value.length&&s.value[0].account.data.parsed.info.tokenAmount.uiAmount||0}catch(r){return console.error("Error getting token balance:",r),0}},XHe=({fromToken:n,toToken:e})=>{const[t,r]=X.useState(null),[i,s]=X.useState(!1),[o,a]=X.useState(null),[c,u]=X.useState(null),d="433d6f9c-0390-4c61-b2a9-f8cd84460376";X.useEffect(()=>{(async()=>{const w=(n==null?void 0:n.address)||(n==null?void 0:n.id),y=(e==null?void 0:e.address)||(e==null?void 0:e.id);if(!(!w||!y)){s(!0);try{const b=`https://lite-api.jup.ag/price/v3?ids=${w},${y}`,E=await fetch(b,{headers:{"Content-Type":"application/json","x-api-key":d}});if(!E.ok)throw new Error("Failed to fetch token prices");const T=await E.json();r(T),a(null)}catch(b){a(b.message),r(null)}finally{s(!1)}}})()},[n==null?void 0:n.address,n==null?void 0:n.id,e==null?void 0:e.address,e==null?void 0:e.id]);const f=m=>{navigator.clipboard.writeText(m).then(()=>{u(m);const w=co.success("Address copied to clipboard!",{duration:2e3});setTimeout(()=>{co.dismiss(w),u(null)},2e3)}
8345).catch(()=>{co.error("Failed to copy address.",{duration:2e3})})};return S.jsxs("div",{className:"flex justify-center items-center gap-4 flex-wrap",children:[i&&S.jsx("div",{children:"Loading token prices..."}),o&&S.jsxs("div",{children:["Error: ",o]}),t&&S.jsxs("div",{className:"space-y-4",children:[t[n.address]&&S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("img",{src:n.logoURI,alt:n.symbol,className:"w-6 h-6 rounded-full",onError:m=>{m.target.onerror=null,m.target.src="/cryptos/fallback-token-icon.png"}}),S.jsxs("span",{children:[n.symbol," = $",parseFloat(t[n.address].usdPrice).toFixed(6)," USD"]}),S.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[S.jsx("span",{className:"text-sm font-medium",children:`${n.address.slice(0,4)}...${n.address.slice(-4)}`}),S.jsx("button",{onClick:m=>{m.stopPropagation(),f(n.address)},className:"text-gray-400 hover:text-white",children:c===n.address?S.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):S.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]}),t[e.address]&&S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("img",{src:e.logoURI,alt:e.symbol,className:"w-6 h-6 rounded-full",onError:m=>{m.target.onerror=null,m.target.src="/cryptos/fallback-token-icon.png"}}),S.jsxs("span",{children:[e.symbol," = $",parseFloat(t[e.address].usdPrice).toFixed(6)," USD"]}),S.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[S.jsx("span",{className:"text-sm font-medium",children:`${e.address.slice(0,4)}...${e.address.slice(-4)}`}),S.jsx("button",{onClick:m=>{m.stopPropagation(),f(e.address)},className:"text-gray-400 hover:text-white",children:c===e.address?S.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):S.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]})]})]})},Oj=({className:n=""})=>{const e="4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump",t=()=>{navigator.clipboard.writeText(e),co.success("YUPFUN address copied!")};return S.jsxs("div",{className:`flex items-center ${n}`,children:[S.jsx("span",{className:"text-gray-400 mr-2",children:"CA:"}),S.jsxs("span",{className:"text-[#7EBAFF] mr-2",children:[S.jsx("span",{className:"hidden md:inline",children:e}),S.jsx("span",{className:"md:hidden",children:`${e.substring(0,4)}...${e.substring(e.length-4)}`})]}),S.jsx("button",{onClick:t,className:"text-gray-400 hover:text-[#7EBAFF] transition-colors","aria-label":"Copy contract address",children:S.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})})]})},JHe="433d6f9c-0390-4c61-b2a9-f8cd84460376",KI=()=>{const[n,e]=X.useState(null),{publicKey:t,sendTransaction:r,connected:i,wallet:s,disconnect:o}=$U(),{connection:a}=zie(),{fromToken:c,toToken:u}=v9e(),d=OU(),{isConnected:f,address:m}=FU(),{disconnect:w,open:y}=FL(),{walletProvider:b}=U7e("solana"),[E,T]=X.useState(!1),[N,I]=X.useState(!1),[H,L]=X.useState(!1),[U,K]=X.useState(null),[Y,k]=X.useState(null),[j,V]=X.useState(null),[W,$]=X.useState(""),[A,_]=X.useState(""),[R,P]=X.useState(.5),[q,F]=X.useState(!1),[z,B]=X.useState(0),[C,M]=X.useState(null),[Z,J]=X.useState(null),[ae,we]=X.useState(!1),[he,xe]=X.useState(!1),[Se,Re]=X.useState(null),[et,Me]=X.useState({}),[Fe,ht]=X.useState(!1),[Dt,At]=X.useState(0),Wt=Q=>
8345({symbol:Q.symbol||"",name:Q.name||"",logoURI:Q.icon||Q.logo_uri||Q.logoURI||"/cryptos/fallback-token-icon.png",address:Q.address||Q.id||Q.mint,decimals:Q.decimals||6});X.useMemo(()=>new mR(a.rpcEndpoint,"confirmed"),[a.rpcEndpoint]);const yn=X.useMemo(()=>{var Q;return t||((Q=s==null?void 0:s.adapter)!=null&&Q.publicKey?s.adapter.publicKey:f&&m?new bt(m):null)},[t,s,f,m]),Yt=X.useMemo(()=>i||f,[i,f]);X.useEffect(()=>{(async()=>{var fe;if(localStorage.getItem("walletName")==="Reown"&&!f)try{typeof((fe=window.reown)==null?void 0:fe.reconnect)=="function"&&await window.reown.reconnect()}catch(Ee){console.error("Failed to reconnect WalletConnect session:",Ee),localStorage.removeItem("walletName")}})()},[f]),X.useEffect(()=>{N&&(async()=>{var ee;try{if(typeof((ee=window.reown)==null?void 0:ee.getConnectionUri)=="function"){const fe=await window.reown.getConnectionUri();Re(fe)}}catch(fe){console.error("Error generating WalletConnect URI:",fe)}})()},[N]),X.useEffect(()=>{(()=>{localStorage.getItem("walletName")==="Reown"||f&&m?e("reown"):i&&t?e("adapter"):(e(null),localStorage.removeItem("walletName"))})()},[f,i,m,t]),X.useEffect(()=>{$(""),_(""),M(null),J(null)},[n,yn]),X.useEffect(()=>{!f&&b&&(console.log("Clearing stale Reown walletProvider"),b.signTransaction=null,b.signAndSendTransaction=null,b.sendTransaction=null)},[f,b]),X.useCallback(async(Q,ee)=>{let Ee=0;const Te=async()=>{try{if(!Yt)throw new Error("Wallet not connected");const{blockhash:De}=await ee.getLatestBlockhash();if(Q.recentBlockhash=De,Q.feePayer=yn,Q.signatures=[],n==="reown"&&b){if(typeof b.signAndSendTransaction=="function")return await b.signAndSendTransaction(Q);if(typeof b.signTransaction=="function"){const vt=await b.signTransaction(Q);return await ee.sendRawTransaction(vt.serialize())}throw new Error("WalletConnect wallet doesn't support required methods")}if(n==="adapter"&&(s!=null&&s.adapter)){if(typeof s.adapter.signAndSendTransaction=="function")return await s.adapter.signAndSendTransaction(Q);if(typeof s.adapter.sendTransaction=="function")return await s.adapter.sendTransaction(Q,ee,{skipPreflight:!1,maxRetries:3,preflightCommitment:"confirmed"});if(typeof s.adapter.signTransaction=="function"){const vt=await s.adapter.signTransaction(Q);return await ee.sendRawTransaction(vt.serialize())}}if(typeof r=="function")return await r(Q,ee);throw new Error("No supported transaction methods found in wallet")}catch(De){if((De.message.includes("429")||De.message.includes("timeout")||De.message.includes("failed"))&&Ee<3){Ee++;const jt=Math.pow(2,Ee)*500;return await new Promise(kt=>setTimeout(kt,jt)),Te()}const vt=typeof De=="string"?De:(De==null?void 0:De.message)||"";throw(vt.includes("User rejected")||vt.includes("Session disconnected"))&&(localStorage.removeItem("walletName"),localStorage.removeItem("reown-session"),window.location.reload()),De}};return Te()},[Yt,s,b,r,yn,f,n]);const Jt=X.useCallback(async Q=>{try{const ee=await fetch(`https://lite-api.jup.ag/tokens/v2/search?query=${Q}`,{headers:{"Content-Type":"application/json","x-api-key":JHe}});if(!ee.ok)throw new Error(`HTTP error! status: ${ee.status}`);const fe=await ee.json();let Ee;if(Array.isArray(fe)&&fe.length>0)Ee=fe[0];else if(fe&&typeof fe=="object")Ee=fe;else return null;return Wt(Ee)}catch(ee){return console.error("Error fetching token details:",ee),null}},[]),bn=X.useCallback(async()=>{try{const Q=await YHe(),ee="So11111111111111111111111111111111111111112",fe="4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump";let Ee=Wt(Q.find(kt=>(kt.address||kt.id)===ee)||{});const Te=Wt({symbol:"YUPFUN",name:"YUPFUN Token",logoURI:"/cryptos/yupfun-logo.png",address:fe,decimals:6}),De=async(kt,dn)=>{if(!kt)return dn;let Ut=Q.find(_n=>(_n.address||_n.id)===kt);if(Ut)return Wt(Ut);try{return await Jt(kt)||dn}catch{return dn}},vt=await De(c,Ee),jt=await De(u,Te);if(k(vt),V(jt),c||u){const kt=vt.address,dn=jt.address;d(`/swap/sol/${kt}/${dn}`,{replace:!0})}}catch(Q){console.error("Error loading tokens:",Q),J("Failed to load tokens. Please try refreshing the page.")}},[c,u,Jt,d]);X.useEffect(()=>{bn()},[bn]);const Kt=X.useCallback(async()=>
8345{if(yn&&Y)try{const Q=await qI(a,yn,Y);B(Q)}catch(Q){console.error("Error updating balance:",Q),B(0)}else B(0)},[yn,Y,a]);X.useEffect(()=>{Kt()},[Kt]);const En=X.useMemo(()=>eae.debounce(async Q=>{if(!Q||isNaN(parseFloat(Q))){M(null),_(""),ht(!1);return}const ee=`${Y==null?void 0:Y.address}-${j==null?void 0:j.address}`;if(et[ee]){J(`Token ${j==null?void 0:j.symbol} is not currently tradable`),_(""),M(null),ht(!1);return}if(!Y||!j){M(null),ht(!1);return}try{ht(!0),F(!0),J(null);const fe=await GHe(a,Y,j,parseFloat(Q),R);M(fe),_(fe.amountOut.toString())}catch(fe){console.error("Swap calculation error:",fe),(fe.message.includes("not currently tradable")||fe.message.includes("400"))&&Me(Ee=>({...Ee,[`${Y==null?void 0:Y.address}-${j==null?void 0:j.address}`]:!0})),fe.message.includes("not currently tradable")?J(fe.message):fe.message.includes("No route found")?J("No trading route available for this token pair. Please try different tokens."):J(fe.message||"Failed to calculate swap. Please try a different token pair."),_(""),M(null)}finally{ht(!1),F(!1)}},1e3),[Y,j,R,a,et]);X.useEffect(()=>{const Q=`${Y==null?void 0:Y.address}-${j==null?void 0:j.address}`;if(!W||W===""||parseFloat(W)===0){_(""),M(null),ht(!1);return}return Y&&j&&parseFloat(W)>0&&!et[Q]?En(W):et[Q]&&(J(`Token ${j==null?void 0:j.symbol} is not currently tradable`),_(""),M(null),ht(!1)),()=>{En.cancel()}},[W,Y,j,En,et]),X.useEffect(()=>{(async()=>{if(yn&&j)try{const ee=await qI(a,yn,j);At(ee)}catch(ee){console.error("Error updating 'To' balance:",ee),At(0)}else At(0)})()},[yn,j,a]);const Xe=Q=>{if(/^\d*\.?\d*$/.test(Q)){if($(Q),J(null),!Q||Q===""){_(""),M(null),ht(!1);return}if(parseFloat(Q)<.02){_(""),M(null),ht(!1);return}}},at=()=>{we(!0);const Q=Y,ee=W;k(j),V(Q),$(A),_(ee),J(null),setTimeout(()=>we(!1),300)},rt=X.useCallback(Q=>{const ee=Wt(Q);Me({});let fe=Y,Ee=j;U==="from"?(ee.address===(j==null?void 0:j.address)&&(Ee=Y),fe=ee,$("")):(ee.address===(Y==null?void 0:Y.address)&&(fe=j),Ee=ee),k(fe),V(Ee),_(""),M(null),J(null),T(!1),fe&&Ee&&d(`/swap/sol/${fe.address}/${Ee.address}`,{replace:!0}),W&&(ht(!0),En(W))},[Y,j,U,d,W,En]),lt=async()=>{var ee,fe,Ee,Te,De,vt,jt,kt,dn,Ut,_n;if(!yn||!Y||!j||!W||!A)return;const Q=`swap-toast-${Date.now()}`;try{if(F(!0),J(null),!Yt)throw new Error("No wallet connected");if(!yn)throw new Error("Wallet public key not available");await new Promise(Cn=>setTimeout(Cn,300));const vn={publicKey:yn,signTransaction:null,sendTransaction:null,signAndSendTransaction:null};let Xn=!1;if(n==="reown"&&b?(vn.signTransaction=((ee=b.signTransaction)==null?void 0:ee.bind(b))||null,vn.sendTransaction=((fe=b.sendTransaction)==null?void 0:fe.bind(b))||null,vn.signAndSendTransaction=((Ee=b.signAndSendTransaction)==null?void 0:Ee.bind(b))||null,Xn=vn.signTransaction||vn.sendTransaction||vn.signAndSendTransaction):n==="adapter"&&(s!=null&&s.adapter)&&(vn.signTransaction=((Te=s.adapter.signTransaction)==null?void 0:Te.bind(s.adapter))||null,vn.sendTransaction=(r==null?void 0:r.bind(s.adapter))||null,vn.signAndSendTransaction=((De=s.adapter.signAndSendTransaction)==null?void 0:De.bind(s.adapter))||null,Xn=vn.signTransaction||vn.sendTransaction||vn.signAndSendTransaction),!Xn){try{if(n==="reown"&&w)throw await w(),await new Promise(Cn=>setTimeout(Cn,500)),y({view:"Connect",namespace:"solana"}),new Error("Please reconnect your wallet");if(o)throw await o(),await new Promise(Cn=>setTimeout(Cn,500)),await connect(),new Error("Please try the swap again after reconnecting")}catch(Cn){throw console.error("Reconnect failed:",Cn),new Error("Wallet connection issue. Please reconnect manually.")}throw new Error("No valid signing method available. Please reconnect your wallet.")}co.custom(S.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-[#1A1C24] rounded-lg border border-[#2C2F36] min-w-[300px]",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("svg",{className:"w-5 h-5 text-[#7EBAFF] animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),S.jsx("span",{className:"text-white",children:"Preparing swap..."})]}),S.jsx("button",{onClick:()=>co.dismiss(Q),className:"mt-2 px-3 py-1 bg-[#7EBAFF] text-[#1A1C24] rounded text-sm self-end",children:"Dismiss"})]}),{id:Q,duration:1/0,position:"bottom-right"});const kn=await QHe(a,vn,Y,j,parseFloat(W),R);if(kn!=null&&kn.error){J(kn.error),co.custom(S.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-[#1A1C24] rounded-lg border border-[#2C2F36] min-w-[300px]",children:[S.jsxs("div",{className:"flex items-center gap-2 text-red-500",children:[S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),S.jsx("span",{children:kn.error})]}),S.jsx("button",{onClick:()=>co.dismiss(Q),className:"mt-2 px-3 py-1 bg-[#7EBAFF] text-[#1A1C24] rounded text-sm self-end",children:"Dismiss"})]}),{id:Q,duration:1/0,position:"bottom-right"});return}if(!kn||!kn.signature)throw new Error("Failed to get transaction signature");const tr=yt(kn.signature,Q);$(""),_(""),M(null),await tr}catch(vn){console.error("Swap execution error:",vn);const Xn=(vn==null?void 0:vn.message)||"Transaction rejected or failed";if(J(Xn),co.custom(S.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-[#1A1C24] rounded-lg border border-[#2C2F36] min-w-[300px]",children:[S.jsxs("div",{className:"flex items-center gap-2 text-red-500",children:[S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),S.jsx("span",{children:Xn})]}),S.jsx("button",{onClick:()=>co.dismiss(Q),className:"mt-2 px-3 py-1 bg-[#7EBAFF] text-[#1A1C24] rounded text-sm self-end",children:"Dismiss"})]}),{id:Q,duration:1/0,position:"bottom-right"}),(jt=(vt=vn==null?void 0:vn.message)==null?void 0:vt.includes)!=null&&jt.call(vt,"Session disconnected")||(dn=(kt=vn==null?void 0:vn.message)==null?void 0:kt.includes)!=null&&dn.call(kt,"User rejected"))try{xe(!0),localStorage.removeItem("walletName"),localStorage.removeItem("reown-session"),n==="reown"&&w?(await w(),typeof window<"u"&&((Ut=window.reown)!=null&&Ut.disconnect)&&await window.reown.disconnect()):o&&(await o(),(_n=window.solana)!=null&&_n.disconnect&&await window.solana.disconnect())}catch(kn){console.error("Disconnection error:",kn)}finally{xe(!1)}}finally{F(!1)}};X.useEffect(()=>()=>{s!=null&&s.adapter&&(s.adapter.signTransaction=null,s.adapter.signAndSendTransaction=null,s.adapter.sendTransaction=null),b&&(b.signTransaction=null,b.signAndSendTransaction=null,b.sendTransaction=null)},[s,b]);
8345const yt=async(Q,ee)=>{var Ee,Te,De;if(!Q)return;const fe=(vt,jt)=>{const kt=S.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-[#1A1C24] rounded-lg border border-[#2C2F36] min-w-[300px]",children:[S.jsxs("div",{className:"flex items-start justify-between",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[vt==="success"?S.jsx("svg",{className:"w-5 h-5 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):vt==="error"?S.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}):S.jsx("svg",{className:"w-5 h-5 text-[#7EBAFF] animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),S.jsx("span",{className:"text-white",children:jt})]}),S.jsx("button",{onClick:()=>co.dismiss(ee),className:"text-gray-400 hover:text-white",children:S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),S.jsxs("a",{href:`https://solscan.io/tx/${Q}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-[#7EBAFF] text-sm hover:underline",children:["View on Solscan",S.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]});co.dismiss(ee),co.custom(kt,{id:ee,duration:1/0,position:"bottom-right",shouldDismiss:!1})};try{fe("loading","Processing transaction...");let vt=0;const jt=45;for(;vt<jt;){const kt=await a.getSignatureStatus(Q);if((Ee=kt==null?void 0:kt.value)!=null&&Ee.err){fe("error",`Transaction failed: ${kt.value.err.toString()}`);return}if(((Te=kt==null?void 0:kt.value)==null?void 0:Te.confirmationStatus)==="confirmed"||((De=kt==null?void 0:kt.value)==null?void 0:De.confirmationStatus)==="finalized"){const dn=await qI(a,yn,Y),Ut=await qI(a,yn,j);B(dn),At(Ut),fe("success","Swap completed successfully!");return}fe("loading",`Processing (${vt+1}/${jt})`),vt++,await new Promise(dn=>setTimeout(dn,1e3))}fe("error","Transaction confirmation timed out")}catch(vt){console.error("Error monitoring transaction:",vt),fe("error","Error monitoring transaction")}},oe=()=>{z>0&&($(z.toString()),J(null))};return S.jsx("div",{className:"min-h-screen p-4 md:p-8",children:S.jsxs("div",{className:"max-w-[480px] mx-auto",children:[S.jsx("div",{className:"mb-4",children:S.jsxs("div",{className:"dragon-container-full rounded-xl p-4",children:[S.jsx("p",{className:"text-lg text-[#7EBAFF] font-medium rounded",children:"ð YUP! Itâs Fun. Itâs YUPFUN. ð No custody. Just fast, low-fee swaps."}),S.jsx(Oj,{className:"justify-center mt-2"})]})}),S.jsxs("div",{className:"dragon-container bg-[#1A1C24] rounded-2xl p-4",children:[S.jsxs("div",{className:"mb-2",children:[S.jsxs("div",{className:"flex justify-between items-center mb-2",children:[S.jsx("span",{className:"text-gray-400",children:"From"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{onClick:()=>Xe((z*.5).toString()),disabled:!z,className:"px-2 py-1 rounded bg-[#2C2F36] text-gray-400 text-sm hover:bg-[#363A45] disabled:opacity-50",children:"50%"}),S.jsx("button",{onClick:()=>Xe(z.toString()),disabled:!z,className:"px-2 py-1 rounded bg-[#2C2F36] text-gray-400 text-sm hover:bg-[#363A45] disabled:opacity-50",children:"Max"})]})]}),S.jsxs("div",{className:"bg-[#2C2F36] rounded-xl p-4",children:[S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsx("input",{type:"text",value:W,onChange:Q=>{Xe(Q.target.value),ht(!0)},placeholder:"0",className:"bg-transparent text-white text-2xl outline-none w-[150px]"}),Fe&&W&&parseFloat(W)>0&&S.jsx("svg",{className:"w-5 h-5 ml-2 text-[#7EBAFF] animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),S.jsxs("button",{onClick:()=>{K("from"),T(!0)},className:"flex items-center gap-2 bg-[#1A1C24] rounded-full px-4 py-2",children:[Y?S.jsxs(S.Fragment,{children:[S.jsx("img",{src:Y.logoURI,alt:Y.symbol,className:"w-6 h-6 rounded-full",onError:Q=>{Q.target.onerror=null,Q.target.src="/cryptos/fallback-token-icon.png"}}),S.jsx("span",{className:"text-white",children:Y.symbol})]}):S.jsx("span",{className:"text-white",children:"Select Token"}),S.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18.347 18.384q.32 0 .535-.216a.73.73 0 0 0 .215-.534V8.103l2.317 2.317a.68.68 0 0 0 .508.208.767.767 0 0 0 .77-.752.74.74 0 0 0-.233-.535l-3.47-3.469a.8.8 0 0 0-.297-.198 1 1 0 0 0-.678 0 .8.8 0 0 0-.3.198L14.22 9.366a.7.7 0 0 0-.22.518q.003.294.236.528.232.216.526.223a.7.7 0 0 0 .527-.225l2.308-2.307v9.54q0 .315.216.528a.73.73 0 0 0 .534.213m-8.702 0a1 1 0 0 0 .34-.059.8.8 0 0 0 .3-.197l3.495-3.495a.7.7 0 0 0 .22-.517.74.74 0 0 0-.236-.529.8.8 0 0 0-.527-.223.7.7 0 0 0-.527.225l-2.307 2.308v-9.54a.731.731 0 0 0-.75-.74.73.73 0 0 0-.535.215.73.73 0 0 0-.215.534v9.531L6.585 13.58a.68.68 0 0 0-.507-.208.767.767 0 0 0-.77.752q0 .302.233.534l3.47 3.47q.14.14.297.198a1 1 0 0 0 .337.058"})})]})]}),S.jsxs("div",{className:"text-sm text-gray-400 mt-2 cursor-pointer",onClick:oe,children:["Balance: ",z==null?void 0:z.toFixed(6)," ",Y==null?void 0:Y.symbol]}),S.jsxs("div",{className:"text-sm text-gray-400 mt-1",children:[q?"Loading...":isNaN(W*((C==null?void 0:C.fromTokenPrice)||0))?"":`~${(W*((C==null?void 0:C.fromTokenPrice)||0)).toFixed(2)}`," ",j==null?void 0:j.symbol]})]})]}),S.jsx("div",{className:"flex justify-center -my-1",children:S.jsx("button",{onClick:at,disabled:!Y||!j||ae,className:"bg-[#2C2F36] p-2 rounded-full hover:bg-[#363A45] disabled:opacity-50",children:S.jsx("svg",{className:`w-6 h-6 text-[#7EBAFF] ${ae?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18.347 18.384q.32 0 .535-.216a.73.73 0 0 0 .215-.534V8.103l2.317 2.317a.68.68 0 0 0 .508.208.767.767 0 0 0 .77-.752.74.74 0 0 0-.233-.535l-3.47-3.469a.8.8 0 0 0-.297-.198 1 1 0 0 0-.678 0 .8.8 0 0 0-.3.198L14.22 9.366a.7.7 0 0 0-.22.518q.003.294.236.528.232.216.526.223a.7.7 0 0 0 .527-.225l2.308-2.307v9.54q0 .315.216.528a.73.73 0 0 0 .534.213m-8.702 0a1 1 0 0 0 .34-.059.8.8 0 0 0 .3-.197l3.495-3.495a.7.7 0 0 0 .22-.517.74.74 0 0 0-.236-.529.8.8 0 0 0-.527-.223.7.7 0 0 0-.527.225l-2.307 2.308v-9.54a.731.731 0 0 0-.75-.74.73.73 0 0 0-.535.215.73.73 0 0 0-.215.534v9.531L6.585 13.58a.68.68 0 0 0-.507-.208.767.767 0 0 0-.77.752q0 .302.233.534l3.47 3.47q.14.14.297.198a1 1 0 0 0 .337.058"})})})}),S.jsxs("div",{className:"mt-2",children:[S.jsx("div",{className:"flex justify-between items-center mb-2",children:S.jsx("span",{className:"text-gray-400",children:"To"})}),S.jsxs("div",{className:"bg-[#2C2F36] rounded-xl p-4",children:[S.jsxs("div",{className:"flex justify-between items-center",children:[S.jsxs("div",{className:"flex items-center",children:[S.jsx("input",{type:"number",value:A,readOnly:!0,placeholder:"0",className:"bg-transparent text-white text-2xl outline-none w-[150px]"}),(Fe||W&&!A&&!Z)&&S.jsx("svg",{className:"w-5 h-5 ml-2 text-[#7EBAFF] animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})]}),S.jsxs("button",{onClick:()=>{K("to"),T(!0)},className:"flex items-center gap-2 bg-[#1A1C24] rounded-full px-4 py-2",children:[j?S.jsxs(S.Fragment,{children:[S.jsx("img",{src:j.logoURI,alt:j.symbol,className:"w-6 h-6 rounded-full",onError:Q=>{Q.target.onerror=null,Q.target.src="/cryptos/fallback-token-icon.png"}}),S.jsx("span",{className:"text-white",children:j.symbol})]}):S.jsx("span",{className:"text-white",children:"Select Token"}),S.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18.347 18.384q.32 0 .535-.216a.73.73 0 0 0 .215-.534V8.103l2.317 2.317a.68.68 0 0 0 .508.208.767.767 0 0 0 .77-.752.74.74 0 0 0-.233-.535l-3.47-3.469a.8.8 0 0 0-.297-.198 1 1 0 0 0-.678 0 .8.8 0 0 0-.3.198L14.22 9.366a.7.7 0 0 0-.22.518q.003.294.236.528.232.216.526.223a.7.7 0 0 0 .527-.225l2.308-2.307v9.54q0 .315.216.528a.73.73 0 0 0 .534.213m-8.702 0a1 1 0 0 0 .34-.059.8.8 0 0 0 .3-.197l3.495-3.495a.7.7 0 0 0 .22-.517.74.74 0 0 0-.236-.529.8.8 0 0 0-.527-.223.7.7 0 0 0-.527.225l-2.307 2.308v-9.54a.731.731 0 0 0-.75-.74.73.73 0 0 0-.535.215.73.73 0 0 0-.215.534v9.531L6.585 13.58a.68.68 0 0 0-.507-.208.767.767 0 0 0-.77.752q0 .302.233.534l3.47 3.47q.14.14.297.198a1 1 0 0 0 .337.058"})})]})]}),S.jsxs("div",{className:"text-sm text-gray-400 mt-2 cursor-pointer",onClick:()=>Dt>0&&$(Dt.toString()),children:["Balance: ",Dt==null?void 0:Dt.toFixed(6)," ",j==null?void 0:j.symbol]}),S.jsxs("div",{className:"text-sm text-gray-400 mt-1",children:[q?"Loading...":isNaN((C==null?void 0:C.amountAfterFee)*((C==null?void 0:C.fromTokenPrice)||0))?"":`~${((C==null?void 0:C.amountAfterFee)*((C==null?void 0:C.fromTokenPrice)||0)).toFixed(2)}`," ",j==null?void 0:j.symbol]})]})]}),Z&&S.jsx("div",{className:"mt-4 text-red-500 text-sm text-center",children:Z}),C&&W&&A&&S.jsx(VHe,{fromToken:Y,toToken:j,fromAmount:W,toAmount:A,priceImpact:C.priceImpact,minimumReceived:C.minimumReceived,fees:isNaN(C.fees)?"0.0000":C.fees,swapFee:C.swapFee,fromTokenPrice:C.fromTokenPrice,swapFeeInToken:C.swapFeeInToken,amountAfterFee:C.amountAfterFee,routes:C.routes,feeAmountInLamports:C.feeAmountInLamports}),S.jsx("button",{onClick:()=>yn?lt():I(!0),disabled:q||!W||!A||yn&&parseFloat(W)>
8345z||!Y||!j||!!Z,className:"w-full bg-[#7EBAFF] hover:bg-[#6BA8FF] text-[#1A1C24] font-medium rounded-xl py-4 mt-4 transition-colors disabled:opacity-50",children:q?"Calculating...":yn?parseFloat(W)>z?"Insufficient Balance":Z?"Price Impact Too High":"Swap":"Connect Wallet"})]}),S.jsx("div",{className:"dragon-container",children:S.jsx("div",{className:"max-w-[480px] mx-auto",children:S.jsx(XHe,{fromToken:Y,toToken:j})})}),S.jsx(HHe,{isOpen:H,onClose:()=>L(!1),slippage:R,setSlippage:P}),S.jsx(Fse,{isOpen:N,onClose:()=>I(!1),wcUri:Se}),S.jsx(WHe,{isOpen:E,onClose:()=>T(!1),onSelect:rt,fromToken:Y,toToken:j,selectingField:U})]})})},eVe=X.memo(()=>{const n=[{name:"Jupiter",logo:"/exchanges/jupiter-logo.png",url:"https://jup.ag/swap/SOL-4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{name:"Raydium",logo:"/exchanges/raydium-logo.png",url:"https://raydium.io/swap/?inputCurrency=SOL&outputCurrency=4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump&inputMint=sol&outputMint=4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{name:"PumpSwap (SOL-YUPFUN)",logo:"/exchanges/pump-logo.png",url:"https://swap.pump.fun/?input=So11111111111111111111111111111111111111112&output=4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{name:"Meteora (YUPFUN-SOL)",logo:"/exchanges/meteora-logo.svg",url:"https://v2.meteora.ag/damm/6mqLVoobNaGqDKfyGm38mbCVX1RBFdRv5JraYSoNqcrd"},{name:"Orca (YUPFUN-SOL)",logo:"/exchanges/orca-logo.png",url:"https://www.orca.so/?tokenIn=So11111111111111111111111111111111111111112&tokenOut=4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{name:"Mexc DEX+ (YUPFUN-SOL)",logo:"/exchanges/mexc-dex-logo.png",url:"https://www.mexc.com/dex/trade?pair_ca=CW5g3ymJ5b37v8stB4EZ28G8oqncM2nVHpVuRP5Y6BGM&chain_id=100000&token_ca=4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{name:"XWallet (YUPFUN-SOL)",logo:"/exchanges/xwallet-logo.png",url:"https://web3.okx.com/dex-swap?chain=solana,solana&token=11111111111111111111111111111111,4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"}],e=[{name:"Bitmart (Trading)",logo:"/exchanges/bitmart-logo.png",url:"https://www.bitmart.com/trade/en-US?type=spot&symbol=YUPFUN_USDT"},{name:"Biconomy.com",logo:"/exchanges/biconomy-logo.png",url:"https://www.biconomy.com/exchange/YUPFUN_USDT"},{name:"GroveX",logo:"/exchanges/grovex-logo.png",url:"https://www.grovex.io/en_US/trade/YUPFUN_USDT"},{name:"Bitmart (Sign Up)",text:"Bitmart Sign Up",url:"https://www.bitmart.com/invite/YupFun/en-US/",isReferral:!0}],t=(r,i)=>S.jsx("div",{className:"mb-6",children:S.jsxs("div",{className:"flex justify-center items-center gap-4 flex-wrap",children:[i,r.map((s,o)=>S.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:`hover:opacity-80 transition-opacity flex items-center ${s.isReferral?"text-white bg-blue-600 px-2 py-1 rounded-md":""}`,title:s.name,children:[s.logo?S.jsx("img",{src:s.logo,alt:s.name,className:"h-8",onError:a=>{a.target.onerror=null,a.target.src="/exchanges/default-exchange.png"},loading:"lazy"}):S.jsx("span",{children:s.text}),s.isReferral&&S.jsx(BHe,{className:"ml-1 text-xs text-white"})]},o))]})});return S.jsxs("div",{children:[t(n,"DEXs:"),t(e,"CEXs:")]})}),tVe=X.memo(()=>{const n=[{name:"Coingecko",logo:"/logos/coingecko-logo.png",url:"https://www.coingecko.com/en/coins/yupfun-token"},{name:"YUPFUN Music Channel",logo:"/logos/youtube-logo.png",url:"https://www.youtube.com/channel/UCfECOZ9r-E78No8VkIrTZsg"},{name:"Stockwits",logo:"/logos/stockwits-logo.jpg",url:"https://stocktwits.com/symbol/YUPFUN.X"},{name:"Rugcheck",logo:"/logos/rugcheck-logo.jpg",url:"https://rugcheck.xyz/tokens/4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{name:"Blockspot.io",logo:"/logos/blockspot-logo.png",url:"https://blockspot.io/coin/yupfun-token"},{name:"Birdeye",logo:"/logos/birdeye-logo.png",url:"https://birdeye.so/token/4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump?chain=solana"},{name:"Dextools.io",logo:"/logos/dextools-logo.png",url:"https://www.dextools.io/app/en/solana/pair-explorer/CW5g3ymJ5b37v8stB4EZ28G8oqncM2nVHpVuRP5Y6BGM?t=1745369419014"},{name:"Dexscreener",logo:"/logos/dexscreener-logo.png",url:"https://dexscreener.com/solana/4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{name:"GeckoTerminal",logo:"/logos/geckoterminal-logo.png",url:"https://www.geckoterminal.com/solana/pools/CW5g3ymJ5b37v8stB4EZ28G8oqncM2nVHpVuRP5Y6BGM"},{name:"GMGN",logo:"/logos/gmgn-logo.png",url:"https://gmgn.ai/sol/token/solscan_4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{name:"Photon",logo:"/logos/photon-logo.svg",url:"https://photon-sol.tinyastro.io/en/lp/CW5g3ymJ5b37v8stB4EZ28G8oqncM2nVHpVuRP5Y6BGM"},{name:"PoinPaprika",logo:"/logos/coinpaprika-logo.svg",url:"https://coinpaprika.com/coin/yupfun-yupfun-token"},{name:"YUPFUN Solana",logo:"/explorers/solscan-logo.png",url:"https://solscan.io/token/4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"},{name:"YUPFUN Ether",logo:"/explorers/etherscan-logo.png",url:"https://etherscan.io/token/0x9a148D64Fa859284577F6B4
8345C16f1a4F1Dc97eCa1"},{name:"YUPFUN BNB",logo:"/explorers/bscscan-logo.png",url:"https://bscscan.com/token/0x8d67244b477EebEAA4D35f8995D456D549b2cC19"},{name:"YUPFUN Base",logo:"/explorers/basescan-logo.png",url:"https://basescan.org/token/0x44eB287b017a345Cd207dCc264a9358Ce0105677"},{name:"YUPFUN Avalanche",logo:"/explorers/avalanchescan-logo.png",url:"https://snowtrace.io/token/0xE24397b8AA6DE8996AcA3ee1fD0A42E750D8bC80"},{name:"YUPFUN Polygon",logo:"/explorers/polygonscan-logo.png",url:"https://polygonscan.com/token/0xb4f6e654afe99ece356db480d2a3fded4d846843"},{name:"YUPFUN Arbitrum",logo:"/explorers/arbiscan-logo.png",url:"https://arbiscan.io/token/0xd2ac0ed4180d6e8afc7a0bfd9e61356d90a23f6d"},{name:"YUPFUN Optimistic",logo:"/explorers/optimisticscan-logo.png",url:"https://optimistic.etherscan.io/token/0x53280c1ddf704192d0ec9c1376bb41e3b50412e0"}];return S.jsx("div",{className:"mt-6",children:S.jsx("div",{className:"flex justify-center items-center gap-4 flex-wrap",children:n.map((e,t)=>S.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-80 transition-opacity",title:e.name,children:S.jsx("img",{src:e.logo,alt:e.name,className:"h-8",onError:r=>{r.target.onerror=null,r.target.src="/logos/default-logo.png"},loading:"lazy"})},t))})})}),nVe=()=>{const n=new Date().getFullYear();return S.jsx("footer",{className:"dragon-container-full py-8 mt-16",children:S.jsxs("div",{className:"max-w-[1200px] mx-auto px-4",children:[S.jsx("div",{className:"mb-4 text-center",children:S.jsxs("p",{className:"text-lg text-gray-300 mx-auto",children:[S.jsx("span",{className:"text-[#7EBAFF] font-bold",children:"ð¥ð YUPFUN Token:"})," The meme coin with serious DeFi power! ð¥ Swap tokens, bridge chains & explore our growing ecosystemâe-commerce, gaming, and fintech. Built on Solana. Fast, secure, and wallet-based. No middlemen. Just bigger memes & bolder dreams."]})}),S.jsxs("div",{className:"flex flex-col items-center",children:[S.jsxs("div",{className:"w-full",children:[S.jsx(eVe,{}),S.jsx(tVe,{})]}),S.jsxs("div",{className:"flex flex-wrap justify-center items-center gap-4 mt-4",children:[S.jsx(Oo,{to:"https://yup.fun/about-us",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:"About Us"}),S.jsx(Oo,{to:"https://yup.fun/white-paper",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:"White Paper"}),S.jsx(Oo,{to:"https://yup.fun/how-to-swap",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:"Guide: Swap"}),S.jsx(Oo,{to:"https://yup.fun/how-to-bridge",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:"Guide: Bridge"}),S.jsx(Oo,{to:"https://yup.fun/faq",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:"FAQ"}),S.jsx(Oo,{to:"https://yup.fun/terms-of-service",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:"Terms"}),S.jsx(Oo,{to:"https://yup.fun/privacy-policy",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:"Privacy"})]}),S.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-4 mt-4",children:[S.jsxs("span",{className:"text-gray-400",children:["© ",n," YUP.FUN"]}),S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("a",{href:"https://t.me/Yupfun_Token",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:S.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:S.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.64 6.8c-.33 1.48-.74 3.12-1.18 4.86-.44 1.74-.88 3.38-1.28 4.82-.2.72-.58 1.08-1.14 1.12-.72.04-1.26-.24-1.64-.84-.28-.4-.56-.8-.84-1.2-.3-.36-.6-.72-.9-1.08-.32-.36-.64-.54-.96-.54-.16 0-.4.1-.72.3l-1.14.7c-.12.08-.24.12-.36.12-.16 0-.32-.08-.48-.24-.16-.16-.24-.32-.24-.48 0-.12.04-.24.12-.36l.7-1.14c.2-.32.3-.56.3-.72 0-.32-.18-.64-.54-.96-.36-.3-.72-.6-1.08-.9-.4-.28-.8-.56-1.2-.84-.6-.38-.88-.92-.84-1.64.04-.56.4-.94 1.12-1.14 1.44-.4 3.08-.84 4.82-1.28 1.74-.44 3.38-.88 4.86-1.18.72-.12 1.38.06 1.98.54.6.48.9 1.12.9 1.92
83450 .16-.02.32-.06.48z"})})}),S.jsx("a",{href:"https://x.com/YUPFUN_Token",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:S.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:S.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),S.jsx("a",{href:"https://x.com/i/communities/1938770064813019310",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",title:"DragonNation: WAGMI YUPFUN",children:S.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:S.jsx("path",{d:"M7.501 19.917L7.471 21H.472l.029-1.027c.184-6.618 3.736-8.977 7-8.977.963 0 1.95.212 2.87.672-.444.478-.851 1.03-1.212 1.656-.507-.204-1.054-.329-1.658-.329-2.767 0-4.57 2.223-4.938 6.004H7.56c-.023.302-.05.599-.059.917zm15.998.056L23.528 21H9.472l.029-1.027c.184-6.618 3.736-8.977 7-8.977s6.816 2.358 7 8.977zM21.437 19c-.367-3.781-2.17-6.004-4.938-6.004s-4.57 2.223-4.938 6.004h9.875zm-4.938-9c-.799 0-1.527-.279-2.116-.73-.836-.64-1.384-1.638-1.384-2.735 0-1.86 1.657-3.535 3.5-3.535s3.5 1.675 3.5 3.535c0 1.097-.548 2.095-1.384 2.735-.589.451-1.317.73-2.116.73zm-1.5-3.535c0 .5.449.535 1.5.535 1.051 0 1.5-.035 1.5-.535 0-.998-1.343-1.535-1.5-1.535-.157 0-1.5.537-1.5 1.535z"})})}),S.jsx("a",{href:"https://github.com/yupfun",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:S.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:S.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})})}),S.jsx("a",{href:"https://www.youtube.com/playlist?list=PLkcHt3oLId2_L6XzMKKoPS8UJXtPOeLRJ",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:S.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:S.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})})}),S.jsx("a",{href:"https://www.tiktok.com/@yupfun_token",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-[#7EBAFF] transition-colors",children:S.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:S.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"})})})]})]}),S.jsx("div",{className:"mt-6 w-full max-w-2xl",children:S.jsx("div",{className:"flex flex-col items-center text-center",children:S.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 w-full",children:[S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"YUPFUN Solana:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"YUPFUN BNB:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"0x8d67244b477EebEAA4D35f8995D456D549b2cC19"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"YUPFUN Base:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"0x44eB287b017a345Cd207dCc264a9358Ce0105677"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"YUPFUN ETH:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"0x9a148D64Fa859284577F6B4
8345C16f1a4F1Dc97eCa1"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"YUPFUN Avalanche:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"0xE24397b8AA6DE8996AcA3ee1fD0A42E750D8bC80"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"YUPFUN Polygon:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"0xb4f6e654afe99ece356db480d2a3fded4d846843"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"YUPFUN Arbitrum:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"0xd2ac0ed4180d6e8afc7a0bfd9e61356d90a23f6d"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"YUPFUN Optimistic:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"0x53280c1ddf704192d0ec9c1376bb41e3b50412e0"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"BTC:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"1BjhQsByQXwCYa6hM51WeKuPZ9n4Cgrwv"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"SOL:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"3qaYBazd1aZALNpmPVztbADKUq9Vc1Yhjt4yXHaXLSHX"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"ETH, BSC, Base, Avalanche, Arbitrum:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"0x0B090E9bF5524952eed6f1FB8e62BAB0B4aBD7b5"})]}),S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-sm text-gray-300 font-medium",children:"SUI:"}),S.jsx("p",{className:"text-xs text-gray-400 break-all",children:"0x31599e0fd16c851816a94aef4e8f6a3fc6f11eff375e57168870b28203d586a2"})]})]})})})]})]})})},nae=X.createContext({});function rVe(n){const e=X.useRef(null);return e.current===null&&(e.current=n()),e.current}const Pj=typeof window<"u",iVe=Pj?X.useLayoutEffect:X.useEffect,Dj=X.createContext(null);function Bj(n,e){n.indexOf(e)===-1&&n.push(e)}function Lj(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const xg=(n,e,t)=>t>e?e:t<n?n:t;let $j=()=>{};const Eg={},rae=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n);function iae(n){return typeof n=="object"&&n!==null}const sae=n=>/^0[^.\s]+$/u.test(n);function Uj(n){let e;return()=>(e===void 0&&(e=n()),e)}const Hu=n=>n,sVe=(n,e)=>t=>e(n(t)),_4=(...n)=>n.reduce(sVe),yC=(n,e,t)=>{const r=e-n;return r===0?1:(t-n)/r};class jj{constructor(){this.subscriptions=[]}add(e){return Bj(this.subscriptions,e),()=>Lj(this.subscriptions,e)}notify(e,t,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,t,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Of=n=>n*1e3,Pf=n=>n/1e3;function oae(n,e){return e?n*(1e3/e):0}const aae=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,oVe=1e-7,aVe=12;function cVe(n,e,t,r,i){let s,o,a=0;do o=e+(t-e)/2,s=aae(o,r,i)-n,s>0?t=o:e=o;while(Math.abs(s)>oVe&&++a<aVe);return o}function C4(n,e,t,r){if(n===e&&t===r)return Hu;const i=s=>cVe(s,0,1,n,t);return s=>s===0||s===1?s:aae(i(s),e,r)}const cae=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,lae=n=>e=>1-n(1-e),uae=C4(.33,1.53,.69,.99),zj=lae(uae),dae=cae(zj),hae=n=>(n*=2)<1?.5*zj(n):.5*(2-Math.pow(2,-10*(n-1))),Fj=n=>1-Math.sin(Math.acos(n)),fae=lae(Fj),pae=cae(Fj),lVe=C4(.42,0,1,1),uVe=C4(0,0,.58,1),gae=C4(.42,0,.58,1),dVe=n=>Array.isArray(n)&&typeof n[0]!="number",mae=n=>Array.isArray(n)&&typeof n[0]=="number",hVe={linear:Hu,easeIn:lVe,easeInOut:gae,easeOut:uVe,circIn:Fj,circInOut:pae,circOut:fae,backIn:zj,backInOut:dae,backOut:uae,anticipate:hae},fVe=n=>typeof n=="string",aZ=n=>{if(mae(n)){$j(n.length===4);const[e,t,r,i]=n;return C4(e,t,r,i)}else if(fVe(n))return hVe[n];return n},YI=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function pVe(n,e){let t=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),n()),d(a)}const u={schedule:(d,f=!1,m=!1)=>{const y=m&&i?t:r;return f&&o.add(d),y.has(d)||y.add(d),d},cancel:d=>
vendor: 20,941 bytes, line 8345
8345{r.delete(d),o.delete(d)},process:d=>{if(a=d,i){s=!0;return}i=!0,[t,r]=[r,t],t.forEach(c),t.clear(),i=!1,s&&(s=!1,u.process(d))}};return u}const gVe=40;function wae(n,e){let t=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>t=!0,o=YI.reduce((I,H)=>(I[H]=pVe(s),I),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:m,render:w,postRender:y}=o,b=()=>{const I=Eg.useManualTiming?i.timestamp:performance.now();t=!1,Eg.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(I-i.timestamp,gVe),1)),i.timestamp=I,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),d.process(i),f.process(i),m.process(i),w.process(i),y.process(i),i.isProcessing=!1,t&&e&&(r=!1,n(b))},E=()=>{t=!0,r=!0,i.isProcessing||n(b)};return{schedule:YI.reduce((I,H)=>{const L=o[H];return I[H]=(U,K=!1,Y=!1)=>(t||E(),L.schedule(U,K,Y)),I},{}),cancel:I=>{for(let H=0;H<YI.length;H++)o[YI[H]].cancel(I)},state:i,steps:o}}const{schedule:gs,cancel:C0,state:ta,steps:H9}=wae(typeof requestAnimationFrame<"u"?requestAnimationFrame:Hu,!0);let k6;function mVe(){k6=void 0}const hl={now:()=>(k6===void 0&&hl.set(ta.isProcessing||Eg.useManualTiming?ta.timestamp:performance.now()),k6),set:n=>{k6=n,queueMicrotask(mVe)}},yae=n=>e=>typeof e=="string"&&e.startsWith(n),Wj=yae("--"),wVe=yae("var(--"),Hj=n=>wVe(n)?yVe.test(n.split("/*")[0].trim()):!1,yVe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,AE={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},bC={...AE,transform:n=>xg(0,1,n)},GI={...AE,default:1},jS=n=>Math.round(n*1e5)/1e5,Vj=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bVe(n){return n==null}const vVe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,qj=(n,e)=>t=>!!(typeof t=="string"&&vVe.test(t)&&t.startsWith(n)||e&&!bVe(t)&&Object.prototype.hasOwnProperty.call(t,e)),bae=(n,e,t)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Vj);return{[n]:parseFloat(i),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},xVe=n=>xg(0,255,n),V9={...AE,transform:n=>Math.round(xVe(n))},Vy={test:qj("rgb","red"),parse:bae("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:r=1})=>"rgba("+V9.transform(n)+", "+V9.transform(e)+", "+V9.transform(t)+", "+jS(bC.transform(r))+")"};function EVe(n){let e="",t="",r="",i="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),r=n.substring(5,7),i=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),r=n.substring(3,4),i=n.substring(4,5),e+=e,t+=t,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const lL={test:qj("#"),parse:EVe,transform:Vy.transform},T4=n=>({test:e=>typeof e=="string"&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Wm=T4("deg"),Df=T4("%"),nr=T4("px"),AVe=T4("vh"),SVe=T4("vw"),cZ={...Df,parse:n=>Df.parse(n)/100,transform:n=>Df.transform(n*100)},D2={test:qj("hsl","hue"),parse:bae("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:r=1})=>"hsla("+Math.round(n)+", "+Df.transform(jS(e))+", "+Df.transform(jS(t))+", "+jS(bC.transform(r))+")"},ao={test:n=>Vy.test(n)||lL.test(n)||D2.test(n),parse:n=>Vy.test(n)?Vy.parse(n):D2.test(n)?D2.parse(n):lL.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Vy.transform(n):D2.transform(n),getAnimatableNone:n=>{const e=ao.parse(n);return e.alpha=0,ao.transform(e)}},_Ve=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function CVe(n){var e,t;return isNaN(n)&&typeof n=="string"&&(((e=n.match(Vj))==null?void 0:e.length)||0)+(((t=n.match(_Ve))==null?void 0:t.length)||0)>0}const vae="number",xae="color",TVe="var",IVe="var(",lZ="${}",NVe=/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 vC(n){const e=n.toString(),t=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(NVe,c=>(ao.test(c)?(r.color.push(s),i.push(xae),t.push(ao.parse(c))):c.startsWith(IVe)?(r.var.push(s),i.push(TVe),t.push(c)):(r.number.push(s),i.push(vae),t.push(parseFloat(c))),++s,lZ)).split(lZ);return{values:t,split:a,indexes:r,types:i}}function Eae(n){return vC(n).values}function Aae(n){const{split:e,types:t}=vC(n),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=t[o];a===vae?s+=jS(i[o]):a===xae?s+=ao.transform(i[o]):s+=i[o]}return s}}const RVe=n=>typeof n=="number"?0:ao.test(n)?ao.getAnimatableNone(n):n;function MVe(n){const e=Eae(n);return Aae(n)(e.map(RVe))}const T0={test:CVe,parse:Eae,createTransformer:Aae,getAnimatableNone:MVe};function q9(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function kVe({hue:n,saturation:e,lightness:t,alpha:r}){n/=360,e/=100,t/=100;let i=0,s=0,o=0;if(!e)i=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,c=2*t-a;i=q9(c,a,n+1/3),s=q9(c,a,n),o=q9(c,a,n-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function w8(n,e){return t=>t>0?e:n}const xs=(n,e,t)=>n+(e-n)*t,K9=(n,e,t)=>{const r=n*n,i=t*(e*e-r)+r;return i<0?0:Math.sqrt(i)},OVe=[lL,Vy,D2],PVe=n=>OVe.find(e=>e.test(n));function uZ(n){const e=PVe(n);if(!e)return!1;let t=e.parse(n);return e===D2&&(t=kVe(t)),t}const dZ=(n,e)=>{const t=uZ(n),r=uZ(e);if(!t||!r)return w8(n,e);const i={...t};return s=>(i.red=K9(t.red,r.red,s),i.green=K9(t.green,r.green,s),i.blue=K9(t.blue,r.blue,s),i.alpha=xs(t.alpha,r.alpha,s),Vy.transform(i))},uL=new Set(["none","hidden"]);function DVe(n,e){return uL.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function BVe(n,e){return t=>xs(n,e,t)}function Kj(n){return typeof n=="number"?BVe:typeof n=="string"?Hj(n)?w8:ao.test(n)?dZ:UVe:Array.isArray(n)?Sae:typeof n=="object"?ao.test(n)?dZ:LVe:w8}function Sae(n,e){const t=[...n],r=t.length,i=n.map((s,o)=>Kj(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)t[o]=i[o](s);return t}}function LVe(n,e){const t={...n,...e},r={};for(const i in t)n[i]!==void 0&&e[i]!==void 0&&(r[i]=Kj(n[i])(n[i],e[i]));return i=>{for(const s in r)t[s]=r[s](i);return t}}function $Ve(n,e){const t=[],r={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const s=e.types[i],o=n.indexes[s][r[s]],a=n.values[o]??0;t[i]=a,r[s]++}return t}const UVe=(n,e)=>{const t=T0.createTransformer(e),r=vC(n),i=vC(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?uL.has(n)&&!i.values.length||uL.has(e)&&!r.values.length?DVe(n,e):_4(Sae($Ve(r,i),i.values),t):w8(n,e)};function _ae(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?xs(n,e,t):Kj(n)(n,e)}const jVe=n=>{const e=({timestamp:t})=>n(t);return{start:(t=!0)=>gs.update(e,t),stop:()=>C0(e),now:()=>ta.isProcessing?ta.timestamp:hl.now()}},Cae=(n,e,t=10)=>{let r="";const i=Math.max(Math.round(e/t),2);for(let s=0;s<i;s++)r+=Math.round(n(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},y8=2e4;function Yj(n){let e=0;const t=50;let r=n.next(e);for(;!r.done&&e<y8;)e+=t,r=n.next(e);return e>=y8?1/0:e}function zVe(n,e=100,t){const r=t({...n,keyframes:[0,e]}),i=Math.min(Yj(r),y8);return{type:"keyframes",ease:s=>r.next(i*s).value/e,duration:Pf(i)}}const FVe=5;function Tae(n,e,t){const r=Math.max(e-FVe,0);return oae(t-n(r),e-r)}const ks={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},Y9=.001;function WVe({duration:n=ks.duration,bounce:e=ks.bounce,velocity:t=ks.velocity,mass:r=ks.mass}){let i,s,o=1-e;o=xg(ks.minDamping,ks.maxDamping,o),n=xg(ks.minDuration,ks.maxDuration,Pf(n)),o<1?(i=u=>{const d=u*o,f=d*n,m=d-t,w=dL(u,o),y=Math.exp(-f);return Y9-m/w*y},s=u=>{const f=u*o*n,m=f*t+t,w=Math.pow(o,2)*Math.pow(u,2)*n,y=Math.exp(-f),b=dL(Math.pow(u,2),o);return(-i(u)+Y9>0?-1:1)*((m-w)*y)/b}):(i=u=>{const d=Math.exp(-u*n),f=(u-t)*n+1;return-Y9+d*f},s=u=>{const d=Math.exp(-u*n),f=(t-u)*(n*n);return d*f});const a=5/n,c=VVe(i,s,a);if(n=Of(n),isNaN(c))return{stiffness:ks.stiffness,damping:ks.damping,duration:n};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:n}}}const HVe=12;function VVe(n,e,t){let r=t;for(let i=1;i<HVe;i++)r=r-n(r)/e(r);return r}function dL(n,e){return n*Math.sqrt(1-e*e)}const qVe=["duration","bounce"],KVe=["stiffness","damping","mass"];function hZ(n,e){return e.some(t=>n[t]!==void 0)}function YVe(n){let e={velocity:ks.velocity,stiffness:ks.stiffness,damping:ks.damping,mass:ks.mass,isResolvedFromDuration:!1,...n};if(!hZ(n,KVe)&&hZ(n,qVe))if(n.visualDuration){const t=n.visualDuration,r=2*Math.PI/(t*1.2),i=r*r,s=2*xg(.05,1,1-(n.bounce||0))*Math.sqrt(i);e={...e,mass:ks.mass,stiffness:i,damping:s}}else{const t=WVe(n);e={...e,...t,mass:ks.mass},e.isResolvedFromDuration=!0}return e}function b8(n=ks.visualDuration,e=ks.bounce){const t=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:e}:n;let{restSpeed:r,restDelta:i}=t;const s=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:f,velocity:m,isResolvedFromDuration:w}=YVe({...t,velocity:-Pf(t.velocity||0)}),y=m||0,b=u/(2*Math.sqrt(c*d)),E=o-s,T=Pf(Math.sqrt(c/d)),N=Math.abs(E)<5;r||(r=N?ks.restSpeed.granular:ks.restSpeed.default),i||(i=N?ks.restDelta.granular:ks.restDelta.default);let I;if(b<1){const L=dL(T,b);I=U=>{const K=Math.exp(-b*T*U);return o-K*((y+b*T*E)/L*Math.sin(L*U)+E*Math.cos(L*U))}}else if(b===1)I=L=>o-Math.exp(-T*L)*(E+(y+T*E)*L);else{const L=T*Math.sqrt(b*b-1);I=U=>{const K=Math.exp(-b*T*U),Y=Math.min(L*U,300);return o-K*((y+b*T*E)*Math.sinh(Y)+L*E*Math.cosh(Y))/L}}const H={calculatedDuration:w&&f||null,next:L=>{const U=I(L);if(w)a.done=L>=f;else{let K=L===0?y:0;b<1&&(K=L===0?Of(y):Tae(I,L,U));const Y=Math.abs(K)<=r,k=Math.abs(o-U)<=i;a.done=Y&&k}return a.value=a.done?o:U,a},toString:()=>{const L=Math.min(Yj(H),y8),U=Cae(K=>H.next(L*K).value,L,30);return L+"ms "+U},toTransition:()=>{}};return H}b8.applyToOptions=n=>{const e=zVe(n,100,b8);return n.ease=e.ease,n.duration=Of(e.duration),n.type="keyframes",n};function hL({keyframes:n,velocity:e=0,power:t=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:d}){const f=n[0],m={done:!1,value:f},w=Y=>a!==void 0&&Y<a||c!==void 0&&Y>c,y=Y=>a===void 0?c:c===void 0||Math.abs(a-Y)<Math.abs(c-Y)?a:c;let b=t*e;const E=f+b,T=o===void 0?E:o(E);T!==E&&(b=T-f);const N=Y=>-b*Math.exp(-Y/r),I=Y=>T+N(Y),H=Y=>{const k=N(Y),j=I(Y);m.done=Math.abs(k)<=u,m.value=m.done?T:j};let L,U;const K=Y=>{w(m.value)&&(L=Y,U=b8({keyframes:[m.value,y(m.value)],velocity:Tae(I,Y,m.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return K(0),{calculatedDuration:null,next:Y=>{let k=!1;return!U&&L===void 0&&(k=!0,H(Y),K(Y)),L!==void 0&&Y>=L?U.next(Y-L):(!k&&H(Y),m)}}}function GVe(n,e,t){const r=[],i=t||Eg.mix||_ae,s=n.length-1;for(let o=0;o<s;o++){let a=i(n[o],n[o+1]);if(e){const c=Array.isArray(e)?e[o]||Hu:e;a=_4(c,a)}r.push(a)}return r}function ZVe(n,e,{clamp:t=!0,ease:r,mixer:i}={}){const s=n.length;if($j(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=n[0]===n[1];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const a=GVe(e,r,i),c=a.length,u=d=>{if(o&&d<n[0])return e[0];let f=0;if(c>1)for(;f<n.length-2&&!(d<n[f+1]);f++);const m=yC(n[f],n[f+1],d);return a[f](m)};return t?d=>u(xg(n[0],n[s-1],d)):u}function QVe(n,e){const t=n[n.length-1];for(let r=1;r<=e;r++){const i=yC(0,e,r);n.push(xs(t,1,i))}}function XVe(n){const e=[0];return QVe(e,n.length-1),e}function JVe(n,e){return n.map(t=>t*e)}function eqe(n,e){return n.map(()=>e||gae).splice(0,n.length-1)}function zS({duration:n=300,keyframes:e,times:t,ease:r="easeInOut"}){const i=dVe(r)?r.map(aZ):aZ(r),s={done:!1,value:e[0]},o=JVe(t&&t.length===e.length?t:XVe(e),n),a=ZVe(o,e,{ease:Array.isArray(i)?i:eqe(e,i)});return{calculatedDuration:n,next:c=>(s.value=a(c),s.done=c>=n,s)}}const tqe=n=>n!==null;function Gj(n,{repeat:e,repeatType:t="loop"},r,i=1){const s=n.filter(tqe),a=i<0||e&&t!=="loop"&&e%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const nqe={decay:hL,inertia:hL,tween:zS,keyframes:zS,spring:b8};function Iae(n){typeof n.type=="string"&&(n.type=nqe[n.type])}class Zj{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const rqe=n=>n/100;class Qj extends Zj{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:t}=this.options;t&&t.updatedAt!==hl.now()&&this.tick(hl.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Iae(e);const{type:t=zS,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=e;let{keyframes:a}=e;const c=t||zS;c!==zS&&typeof a[0]!="number"&&(this.mixKeyframes=_4(rqe,_ae(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Yj(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:m,repeatDelay:w,type:y,onUpdate:b,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const T=this.currentTime-u*(this.playbackSpeed>=0?1:-1),N=this.playbackSpeed>=0?T<0:T>i;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let I=this.currentTime,H=r;if(f){const Y=Math.min(this.currentTime,i)/a;let k=Math.floor(Y),j=Y%1;!j&&Y>=1&&(j=1),j===1&&k--,k=Math.min(k,f+1),!!(k%2)&&(m==="reverse"?(j=1-j,w&&(j-=w/a)):m==="mirror"&&(H=o)),I=xg(0,1,j)*a}const L=N?{done:!1,value:d[0]}:H.next(I);s&&(L.value=s(L.value));let{done:U}=L;!N&&c!==null&&(U=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const K=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return K&&y!==hL&&(L.value=Gj(d,this.options,E,this.speed)),b&&b(L.value),K&&this.finish(),L}then(e,t){return this.finished.then(e,t)}get duration(){return Pf(this.calculatedDuration)}get time(){return Pf(this.currentTime)}set time(e){var t;e=Of(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(t=this.driver)==null||t.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(hl.now());const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Pf(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:e=jVe,startTime:t}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);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=t??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(hl.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,t;this.notifyFinished(),this.teardown(),this.state="finished",(t=(e=this.options).onComplete)==null||t.call(e)}cancel(){var e,t;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(t=(e=this.options).onCancel)==null||t.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var t;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(t=this.driver)==null||t.stop(),e.observe(this)}}function iqe(n){for(let e=1;e<n.length;e++)n[e]??(n[e]=n[e-1])}const qy=n=>n*180/Math.PI,fL=n=>{const e=qy(Math.atan2(n[1],n[0]));return pL(e)},sqe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:fL,rotateZ:fL,skewX:n=>qy(Math.atan(n[1])),skewY:n=>qy(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},pL=n=>(n=n%360,n<0&&(n+=360),n),fZ=fL,pZ=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),gZ=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),oqe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:pZ,scaleY:gZ,scale:n=>(pZ(n)+gZ(n))/2,rotateX:n=>pL(qy(Math.atan2(n[6],n[5]))),rotateY:n=>pL(qy(Math.atan2(-n[2],n[0]))),rotateZ:fZ,rotate:fZ,skewX:n=>qy(Math.atan(n[4])),skewY:n=>qy(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function gL(n){return n.includes("scale")?1:0}function mL(n,e){if(!n||n==="none")return gL(e);const t=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(t)r=oqe,i=t;else{const a=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sqe,i=a}if(!i)return gL(e);const s=r[e],o=i[1].split(",").map(cqe);return typeof s=="function"?s(o):o[s]}const aqe=(n,e)=>{const{transform:t="none"}=getComputedStyle(n);return mL(t,e)};function cqe(n){return parseFloat(n.trim())}const SE=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],_E=new Set(SE),mZ=n=>n===AE||n===nr,lqe=new Set(["x","y","z"]),uqe=SE.filter(n=>!lqe.has(n));function dqe(n){const e=[];return uqe.forEach(t=>{const r=n.getValue(t);r!==void 0&&(e.push([t,r.get()]),r.set(t.startsWith("scale")?1:0))}),e}const Jy={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:(n,{transform:e})=>mL(e,"x"),y:(n,{transform:e})=>mL(e,"y")};Jy.translateX=Jy.x;Jy.translateY=Jy.y;const e1=new Set;let wL=!1,yL=!1,bL=!1;function Nae(){if(yL){const n=Array.from(e1).filter(r=>r.needsMeasurement),e=new Set(n.map(r=>r.element)),t=new Map;e.forEach(r=>{const i=dqe(r);i.length&&(t.set(r,i),r.render())}),n.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=t.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),n.forEach(r=>r.measureEndState()),n.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}yL=!1,wL=!1,e1.forEach(n=>n.complete(bL)),e1.clear()}function Rae(){e1.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(yL=!0)})}function hqe(){bL=!0,Rae(),Nae(),bL=!1}class Xj{constructor(e,t,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(e1.add(this),wL||(wL=!0,gs.read(Rae),gs.resolveKeyframes(Nae))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:r,motionValue:i}=this;if(e[0]===null){const s=i==null?void 0:i.get(),o=e[e.length-1];if(s!==void 0)e[0]=s;else if(r&&t){const a=r.readValue(t,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&s===void 0&&i.set(e[0])}iqe(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),e1.delete(this)}cancel(){this.state==="scheduled"&&(e1.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fqe=n=>n.startsWith("--");function pqe(n,e,t){fqe(e)?n.style.setProperty(e,t):n.style[e]=t}const gqe=Uj(()=>window.ScrollTimeline!==void 0),mqe={};function wqe(n,e){const t=Uj(n);return()=>mqe[e]??t()}const Mae=wqe(()=>{try{document.createElement("div").animate({opacity:0}
8345,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),aS=([n,e,t,r])=>`cubic-bezier(${n}, ${e}, ${t}, ${r})`,wZ={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:aS([0,.65,.55,1]),circOut:aS([.55,0,1,.45]),backIn:aS([.31,.01,.66,-.59]),backOut:aS([.33,1.53,.69,.99])};function kae(n,e){if(n)return typeof n=="function"?Mae()?Cae(n,e):"ease-out":mae(n)?aS(n):Array.isArray(n)?n.map(t=>kae(t,e)||wZ.easeOut):wZ[n]}function yqe(n,e,t,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const d={[e]:t};c&&(d.offset=c);const f=kae(a,i);Array.isArray(f)&&(d.easing=f);const m={delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(m.pseudoElement=u),n.animate(d,m)}function Oae(n){return typeof n=="function"&&"applyToOptions"in n}function bqe({type:n,...e}){return Oae(n)&&Mae()?n.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class vqe extends Zj{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:t,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=e,$j(typeof e.type!="string");const u=bqe(e);this.animation=yqe(t,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=Gj(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(d):pqe(t,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 e,t;(t=(e=this.animation).finish)==null||t.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,t;this.isPseudoElement||(t=(e=this.animation).commitStyles)==null||t.call(e)}get duration(){var t,r;const e=((r=(t=this.animation.effect)==null?void 0:t.getComputedTiming)==null?void 0:r.call(t).duration)||0;return Pf(Number(e))}get time(){return Pf(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Of(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&gqe()?(this.animation.timeline=e,Hu):t(this)}}const Pae={anticipate:hae,backInOut:dae,circInOut:pae};function xqe(n){return n in Pae}function Eqe(n){typeof n.ease=="string"&&xqe(n.ease)&&(n.ease=Pae[n.ease])}const yZ=10;class Aqe extends vqe{constructor(e){Eqe(e),Iae(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:r,onComplete:i,element:s,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const a=new Qj({...o,autoplay:!1}),c=Of(this.finishedTime??this.time);t.setWithVelocity(a.sample(c-yZ).value,a.sample(c).value,yZ),a.stop()}}const bZ=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(T0.test(n)||n==="0")&&!n.startsWith("url("));function Sqe(n){const e=n[0];if(n.length===1)return!0;for(let t=0;t<n.length;t++)if(n[t]!==e)return!0}function _qe(n,e,t,r){const i=n[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=n[n.length-1],o=bZ(i,e),a=bZ(s,e);return!o||!a?!1:Sqe(n)||(t==="spring"||Oae(t))&&r}function vL(n){n.duration=0,n.type}const Cqe=new Set(["opacity","clipPath","filter","transform"]),Tqe=Uj(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Iqe(n){var d;const{motionValue:e,name:t,repeatDelay:r,repeatType:i,damping:s,type:o}=n;
8345if(!(((d=e==null?void 0:e.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Tqe()&&t&&Cqe.has(t)&&(t!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const Nqe=40;class Rqe extends Zj{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:d,...f}){var y;super(),this.stop=()=>{var b,E;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(E=this.keyframeResolver)==null||E.cancel()},this.createdAt=hl.now();const m={autoplay:e,delay:t,type:r,repeat:i,repeatDelay:s,repeatType:o,name:c,motionValue:u,element:d,...f},w=(d==null?void 0:d.KeyframeResolver)||Xj;this.keyframeResolver=new w(a,(b,E,T)=>this.onKeyframesResolved(b,E,m,!T),c,u,d),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,t,r,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=hl.now(),_qe(e,s,o,a)||((Eg.instantAnimations||!c)&&(d==null||d(Gj(e,r,t))),e[0]=e[e.length-1],vL(r),r.repeat=0);const m={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Nqe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...r,keyframes:e},w=!u&&Iqe(m)?new Aqe({...m,element:m.motionValue.owner.current}):new Qj(m);w.finished.then(()=>this.notifyFinished()).catch(Hu),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),hqe()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const Mqe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function kqe(n){const e=Mqe.exec(n);if(!e)return[,];const[,t,r,i]=e;return[`--${t??r}`,i]}function Dae(n,e,t=1){const[r,i]=kqe(n);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return rae(o)?parseFloat(o):o}return Hj(i)?Dae(i,e,t+1):i}function Jj(n,e){return(n==null?void 0:n[e])??(n==null?void 0:n.default)??n}const Bae=new Set(["width","height","top","left","right","bottom",...SE]),Oqe={test:n=>n==="auto",parse:n=>n},Lae=n=>e=>e.test(n),$ae=[AE,nr,Df,Wm,SVe,AVe,Oqe],vZ=n=>$ae.find(Lae(n));function Pqe(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||sae(n):!0}const Dqe=new Set(["brightness","contrast","saturate","opacity"]);function Bqe(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[r]=t.match(Vj)||[];if(!r)return n;const i=t.replace(r,"");let s=Dqe.has(e)?1:0;return r!==t&&(s*=100),e+"("+s+i+")"}const Lqe=/\b([a-z-]*)\(.*?\)/gu,xL={...T0,getAnimatableNone:n=>{const e=n.match(Lqe);return e?e.map(Bqe).join(" "):n}},xZ={...AE,transform:Math.round},$qe={rotate:Wm,rotateX:Wm,rotateY:Wm,rotateZ:Wm,scale:GI,scaleX:GI,scaleY:GI,scaleZ:GI,skew:Wm,skewX:Wm,skewY:Wm,distance:nr,translateX:nr,translateY:nr,translateZ:nr,x:nr,y:nr,z:nr,perspective:nr,transformPerspective:nr,opacity:bC,originX:cZ,originY:cZ,originZ:nr},ez={borderWidth:nr,borderTopWidth:nr,borderRightWidth:nr,borderBottomWidth:nr,borderLeftWidth:nr,borderRadius:nr,radius:nr,borderTopLeftRadius:nr,borderTopRightRadius:nr,borderBottomRightRadius:nr,borderBottomLeftRadius:nr,width:nr,maxWidth:nr,height:nr,maxHeight:nr,top:nr,right:nr,bottom:nr,left:nr,padding:nr,paddingTop:nr,paddingRight:nr,paddingBottom:nr,paddingLeft:nr,margin:nr,marginTop:nr,marginRight:nr,marginBottom:nr,marginLeft:nr,backgroundPositionX:nr,backgroundPositionY:nr,...$qe,zIndex:xZ,fillOpacity:bC,strokeOpacity:bC,numOctaves:xZ}
vendor: 6,075 bytes, line 8345
8345,Uqe={...ez,color:ao,backgroundColor:ao,outlineColor:ao,fill:ao,stroke:ao,borderColor:ao,borderTopColor:ao,borderRightColor:ao,borderBottomColor:ao,borderLeftColor:ao,filter:xL,WebkitFilter:xL},Uae=n=>Uqe[n];function jae(n,e){let t=Uae(n);return t!==xL&&(t=T0),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const jqe=new Set(["auto","none","0"]);function zqe(n,e,t){let r=0,i;for(;r<n.length&&!i;){const s=n[r];typeof s=="string"&&!jqe.has(s)&&vC(s).values.length&&(i=n[r]),r++}if(i&&t)for(const s of e)n[s]=jae(t,i)}class Fqe extends Xj{constructor(e,t,r,i,s){super(e,t,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let u=e[c];if(typeof u=="string"&&(u=u.trim(),Hj(u))){const d=Dae(u,t.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Bae.has(r)||e.length!==2)return;const[i,s]=e,o=vZ(i),a=vZ(s);if(o!==a)if(mZ(o)&&mZ(a))for(let c=0;c<e.length;c++){const u=e[c];typeof u=="string"&&(e[c]=parseFloat(u))}else Jy[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,r=[];for(let i=0;i<e.length;i++)(e[i]===null||Pqe(e[i]))&&r.push(i);r.length&&zqe(e,r,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Jy[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const i=t[t.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:t,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const i=e.getValue(t);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=Jy[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Wqe(n,e,t){if(n instanceof EventTarget)return[n];if(typeof n=="string"){let r=document;const i=(t==null?void 0:t[n])??r.querySelectorAll(n);return i?Array.from(i):[]}return Array.from(n)}const zae=(n,e)=>e&&typeof n=="number"?e.transform(n):n;function Hqe(n){return iae(n)&&"offsetHeight"in n}const EZ=30,Vqe=n=>!isNaN(parseFloat(n));class qqe{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=hl.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=hl.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Vqe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new jj);const r=this.events[e].add(t);return e==="change"?()=>{r(),gs.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=hl.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>EZ)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,EZ);return oae(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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 e,t;(e=this.dependents)==null||e.clear(),(t=this.events.destroy)==null||t.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jx(n,e){return new qqe(n,e)}const{schedule:tz}=wae(queueMicrotask,!1),jd={x:!1,y:!1};function Fae(){return jd.x||jd.y}function Kqe(n){return n==="x"||n==="y"?jd[n]?null:(jd[n]=!0,()=>{jd[n]=!1}):jd.x||jd.y?null:(jd.x=jd.y=!0,()=>{jd.x=jd.y=!1})}function Wae(n,e){const t=Wqe(n),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[t,i,()=>r.abort()]}function AZ(n){return!(n.pointerType==="touch"||Fae())}function Yqe(n,e,t={}){const[r,i,s]=Wae(n,t),o=a=>{if(!AZ(a))return;const{target:c}=a,u=e(c,a);if(typeof u!="function"||!c)return;const d=f=>{AZ(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Hae=(n,e)=>e?n===e?!0:Hae(n,e.parentElement):!1,nz=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,Gqe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Zqe(n){return Gqe.has(n.tagName)||n.tabIndex!==-1}const O6=new WeakSet;function SZ(n){return e=>{e.key==="Enter"&&n(e)}}function G9(n,e){n.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Qqe=(n,e)=>{const t=n.currentTarget;if(!t)return;const r=SZ(()=>
vendor: 14,109 bytes, line 8345
8345{if(O6.has(t))return;G9(t,"down");const i=SZ(()=>{G9(t,"up")}),s=()=>G9(t,"cancel");t.addEventListener("keyup",i,e),t.addEventListener("blur",s,e)});t.addEventListener("keydown",r,e),t.addEventListener("blur",()=>t.removeEventListener("keydown",r),e)};function _Z(n){return nz(n)&&!Fae()}function Xqe(n,e,t={}){const[r,i,s]=Wae(n,t),o=a=>{const c=a.currentTarget;if(!_Z(a))return;O6.add(c);const u=e(c,a),d=(w,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",m),O6.has(c)&&O6.delete(c),_Z(w)&&typeof u=="function"&&u(w,{success:y})},f=w=>{d(w,c===window||c===document||t.useGlobalTarget||Hae(c,w.target))},m=w=>{d(w,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",m,i)};return r.forEach(a=>{(t.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Hqe(a)&&(a.addEventListener("focus",u=>Qqe(u,i)),!Zqe(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Vae(n){return iae(n)&&"ownerSVGElement"in n}function Jqe(n){return Vae(n)&&n.tagName==="svg"}const Ka=n=>!!(n&&n.getVelocity),eKe=[...$ae,ao,T0],tKe=n=>eKe.find(Lae(n)),qae=X.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function nKe(n=!0){const e=X.useContext(Dj);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:r,register:i}=e,s=X.useId();X.useEffect(()=>{if(n)return i(s)},[n]);const o=X.useCallback(()=>n&&r&&r(s),[s,r,n]);return!t&&r?[!1,o]:[!0]}const Kae=X.createContext({strict:!1}),CZ={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"]},zx={};for(const n in CZ)zx[n]={isEnabled:e=>CZ[n].some(t=>!!e[t])};function rKe(n){for(const e in n)zx[e]={...zx[e],...n[e]}}const iKe=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 v8(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||iKe.has(n)}let Yae=n=>!v8(n);function sKe(n){typeof n=="function"&&(Yae=e=>e.startsWith("on")?!v8(e):n(e))}try{sKe(require("@emotion/is-prop-valid").default)}catch{}function oKe(n,e,t){const r={};for(const i in n)i==="values"&&typeof n.values=="object"||(Yae(i)||t===!0&&v8(i)||!e&&!v8(i)||n.draggable&&i.startsWith("onDrag"))&&(r[i]=n[i]);return r}const QR=X.createContext({});function XR(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function xC(n){return typeof n=="string"||Array.isArray(n)}const rz=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],iz=["initial",...rz];function JR(n){return XR(n.animate)||iz.some(e=>xC(n[e]))}function Gae(n){return!!(JR(n)||n.variants)}function aKe(n,e){if(JR(n)){const{initial:t,animate:r}=n;return{initial:t===!1||xC(t)?t:void 0,animate:xC(r)?r:void 0}}return n.inherit!==!1?e:{}}function cKe(n){const{initial:e,animate:t}=aKe(n,X.useContext(QR));return X.useMemo(()=>({initial:e,animate:t}),[TZ(e),TZ(t)])}function TZ(n){return Array.isArray(n)?n.join(" "):n}const EC={};function lKe(n){for(const e in n)EC[e]=n[e],Wj(e)&&(EC[e].isCSSVariable=!0)}function Zae(n,{layout:e,layoutId:t}){return _E.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!EC[n]||n==="opacity")}const uKe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dKe=SE.length;function hKe(n,e,t){let r="",i=!0;for(let s=0;s<dKe;s++){const o=SE[s],a=n[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||t){const u=zae(a,ez[o]);if(!c){i=!1;const d=uKe[o]||o;r+=`${d}(${u}) `}t&&(e[o]=u)}}return r=r.trim(),t?r=t(e,i?"":r):i&&(r="none"),r}function sz(n,e,t){const{style:r,vars:i,transformOrigin:s}=n;let o=!1,a=!1;for(const c in e){const u=e[c];if(_E.has(c)){o=!0;continue}else if(Wj(c)){i[c]=u;continue}else{const d=zae(u,ez[c]);c.startsWith("origin")?(a=!0,s[c]=d):r[c]=d}}if(e.transform||(o||t?r.transform=hKe(e,n.transform,t):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}const oz=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qae(n,e,t){for(const r in e)!Ka(e[r])&&!Zae(r,t)&&(n[r]=e[r])}function fKe({transformTemplate:n},e){return X.useMemo(()=>{const t=oz();return sz(t,e,n),Object.assign({},t.vars,t.style)},[e])}function pKe(n,e){const t=n.style||{},r={};return Qae(r,t,n),Object.assign(r,fKe(n,e)),r}function gKe(n,e){const t={},r=pKe(n,e);return n.drag&&n.dragListener!==!1&&(t.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(t.tabIndex=0),t.style=r,t}const mKe={offset:"stroke-dashoffset",array:"stroke-dasharray"},wKe={offset:"strokeDashoffset",array:"strokeDasharray"};function yKe(n,e,t=1,r=0,i=!0){n.pathLength=1;const s=i?mKe:wKe;n[s.offset]=nr.transform(-r);const o=nr.transform(e),a=nr.transform(t);n[s.array]=`${o} ${a}`}function Xae(n,{attrX:e,attrY:t,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},c,u,d){if(sz(n,a,u),c){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:f,style:m}=n;f.transform&&(m.transform=f.transform,delete f.transform),(m.transform||f.transformOrigin)&&(m.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),m.transform&&(m.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox),e!==void 0&&(f.x=e),t!==void 0&&(f.y=t),r!==void 0&&(f.scale=r),i!==void 0&&yKe(f,i,s,o,!1)}const Jae=()=>({...oz(),attrs:{}}),ece=n=>typeof n=="string"&&n.toLowerCase()==="svg";function bKe(n,e,t,r){const i=X.useMemo(()=>{const s=Jae();return Xae(s,e,ece(r),n.transformTemplate,n.style),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};Qae(s,n.style,n),i.style={...s,...i.style}}return i}const vKe=["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 az(n){return typeof n!="string"||n.includes("-")?!1:!!(vKe.indexOf(n)>-1||/[A-Z]/u.test(n))}function xKe(n,e,t,{latestValues:r},i,s=!1){const a=(az(n)?bKe:gKe)(e,r,i,n),c=oKe(e,typeof n=="string",s),u=n!==X.Fragment?{...c,...a,ref:t}:{},{children:d}=e,f=X.useMemo(()=>Ka(d)?d.get():d,[d]);return X.createElement(n,{...u,children:f})}function IZ(n){const e=[{},{}];return n==null||n.values.forEach((t,r)=>{e[0][r]=t.get(),e[1][r]=t.getVelocity()}),e}function cz(n,e,t,r){if(typeof e=="function"){const[i,s]=IZ(r);e=e(t!==void 0?t:n.custom,i,s)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[i,s]=IZ(r);e=e(t!==void 0?t:n.custom,i,s)}return e}function P6(n){return Ka(n)?n.get():n}function EKe({scrapeMotionValuesFromProps:n,createRenderState:e},t,r,i){return{latestValues:AKe(t,r,i,n),renderState:e()}}function AKe(n,e,t,r){const i={},s=r(n,{});for(const m in s)i[m]=P6(s[m]);let{initial:o,animate:a}=n;const c=JR(n),u=Gae(n);e&&u&&!c&&n.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let d=t?t.initial===!1:!1;d=d||o===!1;const f=d?a:o;if(f&&typeof f!="boolean"&&!XR(f)){const m=Array.isArray(f)?f:[f];for(let w=0;w<m.length;w++){const y=cz(n,m[w]);if(y){const{transitionEnd:b,transition:E,...T}=y;for(const N in T){let I=T[N];if(Array.isArray(I)){const H=d?I.length-1:0;I=I[H]}I!==null&&(i[N]=I)}for(const N in b)i[N]=b[N]}}}return i}const tce=n=>(e,t)=>{const r=X.useContext(QR),i=X.useContext(Dj),s=()=>EKe(n,e,r,i);return t?s():rVe(s)};function lz(n,e,t){var s;const{style:r}=n,i={};for(const o in r)(Ka(r[o])||e.style&&Ka(e.style[o])||Zae(o,n)||((s=t==null?void 0:t.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const SKe=tce({scrapeMotionValuesFromProps:lz,createRenderState:oz});function nce(n,e,t){const r=lz(n,e,t);for(const i in n)if(Ka(n[i])||Ka(e[i])){const s=SE.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=n[i]}return r}const _Ke=tce({scrapeMotionValuesFromProps:nce,createRenderState:Jae}),CKe=Symbol.for("motionComponentSymbol");function B2(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function TKe(n,e,t){return X.useCallback(r=>{r&&n.onMount&&n.onMount(r),e&&(r?e.mount(r):e.unmount()),t&&(typeof t=="function"?t(r):B2(t)&&(t.current=r))},[e])}const uz=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),IKe="framerAppearId",rce="data-"+uz(IKe),ice=X.createContext({});function NKe(n,e,t,r,i){var b,E;const{visualElement:s}=X.useContext(QR),o=X.useContext(Kae),a=X.useContext(Dj),c=X.useContext(qae).reducedMotion,u=X.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(n,{visualState:e,parent:s,props:t,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=X.useContext(ice);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&RKe(u.current,t,i,f);const m=X.useRef(!1);X.useInsertionEffect(()=>{d&&m.current&&d.update(t,a)});const w=t[rce],y=X.useRef(!!w&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,w))&&((E=window.MotionHasOptimisedAnimation)==null?void 0:E.call(window,w)));return iVe(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),y.current&&d.animationState&&d.animationState.animateChanges())}),X.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,w)}),y.current=!1),d.enteringChildren=void 0)}),d}function RKe(n,e,t,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=e;n.projection=new t(n.latestValues,e["data-framer-portal-id"]?void 0:sce(n.parent)),n.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&B2(a),visualElement:n,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function sce(n){if(n)return n.options.allowProjection!==!1?n.projection:sce(n.parent)}function Z9(n,{forwardMotionProps:e=!1}={},t,r){t&&rKe(t);const i=az(n)?_Ke:SKe;function s(a,c){let u;const d={...X.useContext(qae),...a,layoutId:MKe(a)},{isStatic:f}=d,m=cKe(a),w=i(a,f);if(!f&&Pj){kKe();const y=OKe(d);u=y.MeasureLayout,m.visualElement=NKe(n,w,d,r,y.ProjectionNode)}return S.jsxs(QR.Provider,{value:m,children:[u&&m.visualElement?S.jsx(u,{visualElement:m.visualElement,...d}):null,xKe(n,a,TKe(w,m.visualElement,c),w,f,e)]})}s.displayName=`motion.${typeof n=="string"?n:`create(${n.displayName??n.name??""})`}`;const o=X.forwardRef(s);return o[CKe]=n,o}function MKe({layoutId:n}){const e=X.useContext(nae).id;return e&&n!==void 0?e+"-"+n:n}function kKe(n,e){X.useContext(Kae).strict}function OKe(n){const{drag:e,layout:t}=zx;if(!e&&!t)return{};const r={...e,...t};return{MeasureLayout:e!=null&&e.isEnabled(n)||t!=null&&t.isEnabled(n)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function PKe(n,e){if(typeof Proxy>"u")return Z9;const t=new Map,r=(s,o)=>Z9(s,o,n,e),i=(s,o)=>r(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?r:(t.has(o)||t.set(o,Z9(o,void 0,n,e)),t.get(o))})}function oce({top:n,left:e,right:t,bottom:r}){return{x:{min:e,max:t},y:{min:n,max:r}}}function DKe({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function BKe(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),r=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:r.y,right:r.x}}function Q9(n){return n===void 0||n===1}function EL({scale:n,scaleX:e,scaleY:t}){return!Q9(n)||!Q9(e)||!Q9(t)}function my(n){return EL(n)||ace(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function ace(n){return NZ(n.x)||NZ(n.y)}function NZ(n){return n&&n!=="0%"}function x8(n,e,t){const r=n-t,i=e*r;return t+i}function RZ(n,e,t,r,i){return i!==void 0&&(n=x8(n,i,r)),x8(n,t,r)+e}function AL(n,e=0,t=1,r,i){n.min=RZ(n.min,e,t,r,i),n.max=RZ(n.max,e,t,r,i)}function cce(n,{x:e,y:t}){AL(n.x,e.translate,e.scale,e.originPoint),AL(n.y,t.translate,t.scale,t.originPoint)}const MZ=.999999999999,kZ=1.0000000000001;function LKe(n,e,t,r=!1){const i=t.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a<i;a++){s=t[a],o=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&$2(n,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,cce(n,o)),r&&my(s.latestValues)&&$2(n,s.latestValues))}e.x<kZ&&e.x>MZ&&(e.x=1),e.y<kZ&&e.y>MZ&&(e.y=1)}function L2(n,e){n.min=n.min+e,n.max=n.max+e}function OZ(n,e,t,r,i=.5){const s=xs(n.min,n.max,i);AL(n,e,t,s,r)}function $2(n,e){OZ(n.x,e.x,e.scaleX,e.scale,e.originX),OZ(n.y,e.y,e.scaleY,e.scale,e.originY)}function lce(n,e){return oce(BKe(n.getBoundingClientRect(),e))}function $Ke(n,e,t){const r=lce(n,t),{scroll:i}=e;return i&&(L2(r.x,i.offset.x),L2(r.y,i.offset.y)),r}const PZ=()=>({translate:0,scale:1,origin:0,originPoint:0}),U2=()=>({x:PZ(),y:PZ()}),DZ=()=>({min:0,max:0}),zs=()=>({x:DZ(),y:DZ()}),SL={current:null},uce={current:!1};function UKe(){if(uce.current=!0,!!Pj)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>SL.current=n.matches;n.addEventListener("change",e),e()}else SL.current=!1}const jKe=new WeakMap;function zKe(n,e,t){for(const r in e){const i=e[r],s=t[r];
vendor: 9,282 bytes, line 8345
8345if(Ka(i))n.addValue(r,i);else if(Ka(s))n.addValue(r,jx(i,{owner:n}));else if(s!==i)if(n.hasValue(r)){const o=n.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=n.getStaticValue(r);n.addValue(r,jx(o!==void 0?o:i,{owner:n}))}}for(const r in t)e[r]===void 0&&n.removeValue(r);return e}const BZ=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class FKe{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Xj,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 m=hl.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,gs.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=JR(t),this.isVariantNode=Gae(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(t,{},this);for(const m in f){const w=f[m];c[m]!==void 0&&Ka(w)&&w.set(c[m])}}mount(e){var t;this.current=e,jKe.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),uce.current||UKe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:SL.current,(t=this.parent)==null||t.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),C0(this.notifyUpdate),C0(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=_E.has(e);r&&this.onBindTransform&&this.onBindTransform();const i=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&gs.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{i(),s&&s(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in zx){const t=zx[e];if(!t)continue;const{isEnabled:r,Feature:i}=t;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):zs()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let r=0;r<BZ.length;r++){const i=BZ[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=zKe(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&t!==void 0&&(r=jx(t===null?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(rae(r)||sae(r))?r=parseFloat(r):!tKe(r)&&T0.test(t)&&(r=jae(e,t)),this.setBaseTarget(e,Ka(r)?r.get():r)),Ka(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var s;const{initial:t}=this.props;let r;if(typeof t=="string"||typeof t=="object"){const o=cz(this.props,t,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[e])}if(t&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Ka(i)?i:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new jj),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){tz.render(this.render)}}class dce extends FKe{constructor(){super(...arguments),this.KeyframeResolver=Fqe}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ka(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function hce(n,{style:e,vars:t},r,i){const s=n.style;let o;for(o in e)s[o]=e[o];i==null||i.applyProjectionStyles(s,r);for(o in t)s.setProperty(o,t[o])}function WKe(n){return window.getComputedStyle(n)}class HKe extends dce{constructor(){super(...arguments),this.type="html",this.renderInstance=hce}readValueFromInstance(e,t){var r;if(_E.has(t))return(r=this.projection)!=null&&r.isProjecting?gL(t):aqe(e,t);{const i=WKe(e),s=(Wj(t)?i.getPropertyValue(t):i[t])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:t}){return lce(e,t)}build(e,t,r){sz(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return lz(e,t,r)}}const fce=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 VKe(n,e,t,r){hce(n,e,void 0,r);for(const i in e.attrs)n.setAttribute(fce.has(i)?i:uz(i),e.attrs[i])}class qKe extends dce{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=zs}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(_E.has(t)){const r=Uae(t);return r&&r.default||0}return t=fce.has(t)?t:uz(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return nce(e,t,r)}build(e,t,r){Xae(e,t,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,t,r,i){VKe(e,t,r,i)}mount(e){this.isSVGTag=ece(e.tagName),super.mount(e)}}const KKe=(n,e)=>az(n)?new qKe(e):new HKe(e,{allowProjection:n!==X.Fragment});function nx(n,e,t){const r=n.getProps();return cz(r,e,t!==void 0?t:r.custom,n)}const _L=n=>Array.isArray(n);function YKe(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,jx(t))}function GKe(n){return _L(n)?n[n.length-1]||0:n}function ZKe(n,e){const t=nx(n,e);let{transitionEnd:r={},transition:i={},...s}=t||{};s={...s,...r};
vendor: 5,817 bytes, line 8345
8345for(const o in s){const a=GKe(s[o]);YKe(n,o,a)}}function QKe(n){return!!(Ka(n)&&n.add)}function CL(n,e){const t=n.getValue("willChange");if(QKe(t))return t.add(e);if(!t&&Eg.WillChange){const r=new Eg.WillChange("auto");n.addValue("willChange",r),r.add(e)}}function pce(n){return n.props[rce]}const XKe=n=>n!==null;function JKe(n,{repeat:e,repeatType:t="loop"},r){const i=n.filter(XKe),s=e&&t!=="loop"&&e%2===1?0:i.length-1;return i[s]}const eYe={type:"spring",stiffness:500,damping:25,restSpeed:10},tYe=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),nYe={type:"keyframes",duration:.8},rYe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},iYe=(n,{keyframes:e})=>e.length>2?nYe:_E.has(n)?n.startsWith("scale")?tYe(e[1]):eYe:rYe;function sYe({when:n,delay:e,delayChildren:t,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const dz=(n,e,t,r={},i,s)=>o=>{const a=Jj(r,n)||{},c=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Of(c);const d={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:m=>{e.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:n,motionValue:e,element:s?void 0:i};sYe(a)||Object.assign(d,iYe(n,d)),d.duration&&(d.duration=Of(d.duration)),d.repeatDelay&&(d.repeatDelay=Of(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(vL(d),d.delay===0&&(f=!0)),(Eg.instantAnimations||Eg.skipAnimations)&&(f=!0,vL(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&e.get()!==void 0){const m=JKe(d.keyframes,a);if(m!==void 0){gs.update(()=>{d.onUpdate(m),d.onComplete()});return}}return a.isSync?new Qj(d):new Rqe(d)};function oYe({protectedKeys:n,needsAnimating:e},t){const r=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,r}function gce(n,e,{delay:t=0,transitionOverride:r,type:i}={}){let{transition:s=n.getDefaultTransition(),transitionEnd:o,...a}=e;r&&(s=r);const c=[],u=i&&n.animationState&&n.animationState.getState()[i];for(const d in a){const f=n.getValue(d,n.latestValues[d]??null),m=a[d];if(m===void 0||u&&oYe(u,d))continue;const w={delay:t,...Jj(s||{},d)},y=f.get();if(y!==void 0&&!f.isAnimating&&!Array.isArray(m)&&m===y&&!w.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const T=pce(n);if(T){const N=window.MotionHandoffAnimation(T,d,gs);N!==null&&(w.startTime=N,b=!0)}}CL(n,d),f.start(dz(d,f,m,n.shouldReduceMotion&&Bae.has(d)?{type:!1}:w,n,b));const E=f.animation;E&&c.push(E)}return o&&Promise.all(c).then(()=>{gs.update(()=>{o&&ZKe(n,o)})}),c}function mce(n,e,t,r=0,i=1){const s=Array.from(n).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=n.size,a=(o-1)*r;return typeof t=="function"?t(s,o):i===1?s*r:a-s*r}function TL(n,e,t={}){var c;const r=nx(n,e,t.type==="exit"?(c=n.presenceContext)==null?void 0:c.custom:void 0);let{transition:i=n.getDefaultTransition()||{}}=r||{};t.transitionOverride&&(i=t.transitionOverride);const s=r?()=>Promise.all(gce(n,r,t)):()=>Promise.resolve(),o=n.variantChildren&&n.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:m}=i;return aYe(n,e,u,d,f,m,t)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,d]=a==="beforeChildren"?[s,o]:[o,s];return u().then(()=>d())}else return Promise.all([s(),o(t.delay)])}function aYe(n,e,t=0,r=0,i=0,s=1,o){const a=[];for(const c of n.variantChildren)c.notify("AnimationStart",e),a.push(TL(c,e,{...o,delay:t+(typeof r=="function"?0:r)+mce(n.variantChildren,c,r,i,s)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function cYe(n,e,t={}){n.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>TL(n,s,t));r=Promise.all(i)}else if(typeof e=="string")r=TL(n,e,t);else{const i=typeof e=="function"?nx(n,e,t.custom):e;r=Promise.all(gce(n,i,t))}return r.then(()=>{n.notify("AnimationComplete",e)})}function wce(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let r=0;r<t;r++)if(e[r]!==n[r])return!1;return!0}const lYe=iz.length;function yce(n){if(!n)return;if(!n.isControllingVariants){const t=n.parent?yce(n.parent)||{}:{};return n.props.initial!==void 0&&(t.initial=n.props.initial),t}const e={};for(let t=0;t<lYe;t++){const r=iz[t],i=n.props[r];(xC(i)||i===!1)&&(e[r]=i)}return e}const uYe=[...rz].reverse(),dYe=rz.length;function hYe(n){return e=>Promise.all(e.map(({animation:t,options:r})=>cYe(n,t,r)))}function fYe(n){let e=hYe(n),t=LZ(),r=!0;const i=c=>(u,d)=>{var m;const f=nx(n,d,c==="exit"?(m=n.presenceContext)==null?void 0:m.custom:void 0);if(f){const{transition:w,transitionEnd:y,...b}=f;u={...u,...b,...y}}return u};function s(c){e=c(n)}function o(c){const{props:u}=n,d=yce(n.parent)||{},f=[],m=new Set;let w={},y=1/0;for(let E=0;E<dYe;E++){const T=uYe[E],N=t[T],I=u[T]!==void 0?u[T]:d[T],H=xC(I),L=T===c?N.isActive:null;L===!1&&(y=E);let U=I===d[T]&&I!==u[T]&&H;if(U&&r&&n.manuallyAnimateOnMount&&(U=!1),N.protectedKeys={...w},!N.isActive&&L===null||!I&&!N.prevProp||XR(I)||typeof I=="boolean")continue;const K=pYe(N.prevProp,I);let Y=K||T===c&&N.isActive&&!U&&H||E>y&&H,k=!1;const j=Array.isArray(I)?I:[I];let V=j.reduce(i(T),{});L===!1&&(V={});const{prevResolvedValues:W={}}=N,$={...W,...V},A=P=>{Y=!0,m.has(P)&&(k=!0,m.delete(P)),N.needsAnimating[P]=!0;const q=n.getValue(P);q&&(q.liveStyle=!1)};for(const P in $){const q=V[P],F=W[P];if(w.hasOwnProperty(P))continue;let z=!1;_L(q)&&_L(F)?z=!wce(q,F):z=q!==F,z?q!=null?A(P):m.add(P):q!==void 0&&m.has(P)?A(P):N.protectedKeys[P]=!0}N.prevProp=I,N.prevResolvedValues=V,N.isActive&&(w={...w,...V}),r&&n.blockInitialAnimation&&(Y=!1);const _=U&&K;Y&&(!_||k)&&f.push(...j.map(P=>{const q={type:T};if(typeof P=="string"&&r&&!_&&n.manuallyAnimateOnMount&&n.parent){const{parent:F}=n,z=nx(F,P);
vendor: 22,782 bytes, line 8345
8345if(F.enteringChildren&&z){const{delayChildren:B}=z.transition||{};q.delay=mce(F.enteringChildren,n,B)}}return{animation:P,options:q}}))}if(m.size){const E={};if(typeof u.initial!="boolean"){const T=nx(n,Array.isArray(u.initial)?u.initial[0]:u.initial);T&&T.transition&&(E.transition=T.transition)}m.forEach(T=>{const N=n.getBaseTarget(T),I=n.getValue(T);I&&(I.liveStyle=!0),E[T]=N??null}),f.push({animation:E})}let b=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!n.manuallyAnimateOnMount&&(b=!1),r=!1,b?e(f):Promise.resolve()}function a(c,u){var f;if(t[c].isActive===u)return Promise.resolve();(f=n.variantChildren)==null||f.forEach(m=>{var w;return(w=m.animationState)==null?void 0:w.setActive(c,u)}),t[c].isActive=u;const d=o(c);for(const m in t)t[m].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t,reset:()=>{t=LZ(),r=!0}}}function pYe(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!wce(e,n):!1}function uy(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function LZ(){return{animate:uy(!0),whileInView:uy(),whileHover:uy(),whileTap:uy(),whileDrag:uy(),whileFocus:uy(),exit:uy()}}class U0{constructor(e){this.isMounted=!1,this.node=e}update(){}}class gYe extends U0{constructor(e){super(e),e.animationState||(e.animationState=fYe(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();XR(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let mYe=0;class wYe extends U0{constructor(){super(...arguments),this.id=mYe++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);t&&!e&&i.then(()=>{t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const yYe={animation:{Feature:gYe},exit:{Feature:wYe}};function AC(n,e,t,r={passive:!0}){return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t)}function I4(n){return{point:{x:n.pageX,y:n.pageY}}}const bYe=n=>e=>nz(e)&&n(e,I4(e));function FS(n,e,t,r){return AC(n,e,bYe(t),r)}const bce=1e-4,vYe=1-bce,xYe=1+bce,vce=.01,EYe=0-vce,AYe=0+vce;function bc(n){return n.max-n.min}function SYe(n,e,t){return Math.abs(n-e)<=t}function $Z(n,e,t,r=.5){n.origin=r,n.originPoint=xs(e.min,e.max,n.origin),n.scale=bc(t)/bc(e),n.translate=xs(t.min,t.max,n.origin)-n.originPoint,(n.scale>=vYe&&n.scale<=xYe||isNaN(n.scale))&&(n.scale=1),(n.translate>=EYe&&n.translate<=AYe||isNaN(n.translate))&&(n.translate=0)}function WS(n,e,t,r){$Z(n.x,e.x,t.x,r?r.originX:void 0),$Z(n.y,e.y,t.y,r?r.originY:void 0)}function UZ(n,e,t){n.min=t.min+e.min,n.max=n.min+bc(e)}function _Ye(n,e,t){UZ(n.x,e.x,t.x),UZ(n.y,e.y,t.y)}function jZ(n,e,t){n.min=e.min-t.min,n.max=n.min+bc(e)}function HS(n,e,t){jZ(n.x,e.x,t.x),jZ(n.y,e.y,t.y)}function Bu(n){return[n("x"),n("y")]}const xce=({current:n})=>n?n.ownerDocument.defaultView:null,zZ=(n,e)=>Math.abs(n-e);function CYe(n,e){const t=zZ(n.x,e.x),r=zZ(n.y,e.y);return Math.sqrt(t**2+r**2)}class Ece{constructor(e,t,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!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 m=J9(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,y=CYe(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!w&&!y)return;const{point:b}=m,{timestamp:E}=ta;this.history.push({...b,timestamp:E});const{onStart:T,onMove:N}=this.handlers;w||(T&&T(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,m)},this.handlePointerMove=(m,w)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=X9(w,this.transformPagePoint),gs.update(this.updatePoint,!0)},this.handlePointerUp=(m,w)=>{this.end();const{onEnd:y,onSessionEnd:b,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=J9(m.type==="pointercancel"?this.lastMoveEventInfo:X9(w,this.transformPagePoint),this.history);this.startEvent&&y&&y(m,T),b&&b(m,T)},!nz(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const a=I4(e),c=X9(a,this.transformPagePoint),{point:u}=c,{timestamp:d}=ta;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=t;f&&f(e,J9(c,this.history)),this.removeListeners=_4(FS(this.contextWindow,"pointermove",this.handlePointerMove),FS(this.contextWindow,"pointerup",this.handlePointerUp),FS(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),C0(this.updatePoint)}}function X9(n,e){return e?{point:e(n.point)}:n}function FZ(n,e){return{x:n.x-e.x,y:n.y-e.y}}function J9({point:n},e){return{point:n,delta:FZ(n,Ace(e)),offset:FZ(n,TYe(e)),velocity:IYe(e,.1)}}function TYe(n){return n[0]}function Ace(n){return n[n.length-1]}function IYe(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,r=null;const i=Ace(n);for(;t>=0&&(r=n[t],!(i.timestamp-r.timestamp>Of(e)));)t--;if(!r)return{x:0,y:0};const s=Pf(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function NYe(n,{min:e,max:t},r){return e!==void 0&&n<e?n=r?xs(e,n,r.min):Math.max(n,e):t!==void 0&&n>t&&(n=r?xs(t,n,r.max):Math.min(n,t)),n}function WZ(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function RYe(n,{top:e,left:t,bottom:r,right:i}){return{x:WZ(n.x,t,i),y:WZ(n.y,e,r)}}function HZ(n,e){let t=e.min-n.min,r=e.max-n.max;return e.max-e.min<n.max-n.min&&([t,r]=[r,t]),{min:t,max:r}}function MYe(n,e){return{x:HZ(n.x,e.x),y:HZ(n.y,e.y)}}function kYe(n,e){let t=.5;const r=bc(n),i=bc(e);return i>r?t=yC(e.min,e.max-r,n.min):r>i&&(t=yC(n.min,n.max-i,e.min)),xg(0,1,t)}function OYe(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const IL=.35;function PYe(n=IL){return n===!1?n=0:n===!0&&(n=IL),{x:VZ(n,"left","right"),y:VZ(n,"top","bottom")}}function VZ(n,e,t){return{min:qZ(n,e),max:qZ(n,t)}}function qZ(n,e){return typeof n=="number"?n:n[e]||0}const DYe=new WeakMap;class BYe{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=zs(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=f=>{const{dragSnapToOrigin:m}=this.getProps();m?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(I4(f).point)},o=(f,m)=>{const{drag:w,dragPropagation:y,onDragStart:b}=this.getProps();if(w&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Kqe(w),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bu(T=>{let N=this.getAxisMotionValue(T).get()||0;if(Df.test(N)){const{projection:I}=this.visualElement;if(I&&I.layout){const H=I.layout.layoutBox[T];H&&(N=bc(H)*(parseFloat(N)/100))}}this.originPoint[T]=N}),b&&gs.postRender(()=>b(f,m)),CL(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;const{dragPropagation:w,dragDirectionLock:y,onDirectionLock:b,onDrag:E}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:T}=m;if(y&&this.currentDirection===null){this.currentDirection=LYe(T),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",m.point,T),this.updateAxis("y",m.point,T),this.visualElement.render(),E&&E(f,m)},c=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m,this.stop(f,m),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Bu(f=>{var m;return this.getAnimationState(f)==="paused"&&((m=this.getAxisMotionValue(f).animation)==null?void 0:m.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new Ece(e,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:xce(this.visualElement)})}stop(e,t){const r=e||this.latestPointerEvent,i=t||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&gs.postRender(()=>a(r,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){const{drag:i}=this.getProps();if(!r||!ZI(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=NYe(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:e,dragElastic:t}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;e&&B2(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=RYe(r.layoutBox,e):this.constraints=!1,this.elastic=PYe(t),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Bu(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=OYe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!B2(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=$Ke(r,i.root,this.visualElement.getTransformPagePoint());let o=MYe(i.layout.layoutBox,s);if(t){const a=t(DKe(o));this.hasMutatedConstraints=!!a,a&&(o=oce(a))}return o}startAnimation(e){const{drag:t,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=Bu(d=>{if(!ZI(d,t,this.currentDirection))return;let f=c&&c[d]||{};o&&(f={min:0,max:0});const m=i?200:1e6,w=i?40:1e7,y={type:"inertia",velocity:r?e[d]:0,bounceStiffness:m,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(a)}startAxisValueAnimation(e,t){const r=this.getAxisMotionValue(e);return CL(this.visualElement,e),r.start(dz(e,r,0,t,this.visualElement,!1))}stopAnimation(){Bu(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Bu(e=>{var t;return(t=this.getAxisMotionValue(e).animation)==null?void 0:t.pause()})}getAnimationState(e){var t;return(t=this.getAxisMotionValue(e).animation)==null?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[t];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Bu(t=>{const{drag:r}=this.getProps();if(!ZI(t,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(t);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[t];s.set(e[t]-xs(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!B2(t)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Bu(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=kYe({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Bu(o=>{if(!ZI(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(xs(c,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;DYe.set(this.visualElement,this);const e=this.visualElement.current,t=FS(e,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();B2(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),gs.read(r);const o=AC(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Bu(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(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=IL,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function ZI(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function LYe(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class $Ye extends U0{constructor(e){super(e),this.removeGroupControls=Hu,this.removeListeners=Hu,this.controls=new BYe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Hu}unmount(){this.removeGroupControls(),this.removeListeners()}}const KZ=n=>(e,t)=>{n&&gs.postRender(()=>n(e,t))};class UYe extends U0{constructor(){super(...arguments),this.removePointerDownListener=Hu}onPointerDown(e){this.session=new Ece(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xce(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:KZ(e),onStart:KZ(t),onMove:r,onEnd:(s,o)=>{delete this.session,i&&gs.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=FS(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const D6={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function YZ(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const HA={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(nr.test(n))n=parseFloat(n);else return n;const t=YZ(n,e.target.x),r=YZ(n,e.target.y);return`${t}% ${r}%`}},jYe={correct:(n,{treeScale:e,projectionDelta:t})=>{const r=n,i=T0.parse(n);if(i.length>5)return r;const s=T0.createTransformer(n),o=typeof i[0]!="number"?1:0,a=t.x.scale*e.x,c=t.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const u=xs(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};let eD=!1;class zYe extends X.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;lKe(FYe),s&&(t.group&&t.group.add(s),r&&r.register&&i&&r.register(s),eD&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),D6.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:r,drag:i,isPresent:s}=this.props,{projection:o}=r;return o&&(o.isPresent=s,eD=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||gs.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),tz.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:i}=e;eD=!0,i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Sce(n){const[e,t]=nKe(),r=X.useContext(nae);return S.jsx(zYe,{...n,layoutGroup:r,switchLayoutGroup:X.useContext(ice),isPresent:e,safeToRemove:t})}const FYe={borderRadius:{...HA,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:HA,borderTopRightRadius:HA,borderBottomLeftRadius:HA,borderBottomRightRadius:HA,boxShadow:jYe};function WYe(n,e,t){const r=Ka(n)?n:jx(n);return r.start(dz("",r,e,t)),r.animation}const HYe=(n,e)=>n.depth-e.depth;class VYe{constructor(){this.children=[],this.isDirty=!1}add(e){Bj(this.children,e),this.isDirty=!0}remove(e){Lj(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(HYe),this.isDirty=!1,this.children.forEach(e)}}function qYe(n,e){const t=hl.now(),r=({timestamp:i})=>{const s=i-t;s>=e&&(C0(r),n(s-e))};return gs.setup(r,!0),()=>C0(r)}const _ce=["TopLeft","TopRight","BottomLeft","BottomRight"],KYe=_ce.length,GZ=n=>typeof n=="string"?parseFloat(n):n,ZZ=n=>typeof n=="number"||nr.test(n);function YYe(n,e,t,r,i,s){i?(n.opacity=xs(0,t.opacity??1,GYe(r)),n.opacityExit=xs(e.opacity??1,0,ZYe(r))):s&&(n.opacity=xs(e.opacity??1,t.opacity??1,r));for(let o=0;o<KYe;o++){const a=`border${_ce[o]}Radius`;let c=QZ(e,a),u=QZ(t,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||ZZ(c)===ZZ(u)?(n[a]=Math.max(xs(GZ(c),GZ(u),r),0),(Df.test(u)||Df.test(c))&&(n[a]+="%")):n[a]=u}(e.rotate||t.rotate)&&(n.rotate=xs(e.rotate||0,t.rotate||0,r))}function QZ(n,e){return n[e]!==void 0?n[e]:n.borderRadius}const GYe=Cce(0,.5,fae),ZYe=Cce(.5,.95,Hu);function Cce(n,e,t){return r=>r<n?0:r>e?1:t(yC(n,e,r))}function XZ(n,e){n.min=e.min,n.max=e.max}function ku(n,e){XZ(n.x,e.x),XZ(n.y,e.y)}function JZ(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}function eQ(n,e,t,r,i){return n-=e,n=x8(n,1/t,r),i!==void 0&&(n=x8(n,1/i,r)),n}function QYe(n,e=0,t=1,r=.5,i,s=n,o=n){if(Df.test(e)&&(e=parseFloat(e),e=xs(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=xs(s.min,s.max,r);n===s&&(a-=e),n.min=eQ(n.min,e,t,a,i),n.max=eQ(n.max,e,t,a,i)}function tQ(n,e,[t,r,i],s,o){QYe(n,e[t],e[r],e[i],e.scale,s,o)}const XYe=["x","scaleX","originX"],JYe=["y","scaleY","originY"];function nQ(n,e,t,r){tQ(n.x,e,XYe,t?t.x:void 0,r?r.x:void 0),tQ(n.y,e,JYe,t?t.y:void 0,r?r.y:void 0)}function rQ(n){return n.translate===0&&n.scale===1}function Tce(n){return rQ(n.x)&&rQ(n.y)}function iQ(n,e){return n.min===e.min&&n.max===e.max}function eGe(n,e){return iQ(n.x,e.x)&&iQ(n.y,e.y)}function sQ(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function Ice(n,e){return sQ(n.x,e.x)&&sQ(n.y,e.y)}function oQ(n){return bc(n.x)/bc(n.y)}function aQ(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}class tGe{constructor(){this.members=[]}add(e){Bj(this.members,e),e.scheduleRender()}remove(e){if(Lj(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(i=>e===i);if(t===0)return!1;let r;for(let i=t;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,t){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function nGe(n,e,t){let r="";const i=n.x.translate/e.x,s=n.y.translate/e.y,o=(t==null?void 0:t.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:m,skewX:w,skewY:y}=t;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),m&&(r+=`rotateY(${m}deg) `),w&&(r+=`skewX(${w}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=n.x.scale*e.x,c=n.y.scale*e.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const tD=["","X","Y","Z"],rGe=1e3;let iGe=0;function nD(n,e,t,r){const{latestValues:i}=e;i[n]&&(t[n]=i[n],e.setStaticValue(n,0),r&&(r[n]=0))}function Nce(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=pce(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:i,layoutId:s}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",gs,!(i||s))}const{parent:r}=n;r&&!r.hasCheckedOptimisedAppear&&Nce(r)}function Rce({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=iGe++,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=()=>
vendor: 4,319 bytes, line 8345
8345{this.projectionUpdateScheduled=!1,this.nodes.forEach(aGe),this.nodes.forEach(dGe),this.nodes.forEach(hGe),this.nodes.forEach(cGe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new VYe)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new jj),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Vae(o)&&!Jqe(o),this.instance=o;const{layoutId:a,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||a)&&(this.isLayoutDirty=!0),n){let d,f=0;const m=()=>this.root.updateBlockedByResize=!1;gs.read(()=>{f=window.innerWidth}),n(o,()=>{const w=window.innerWidth;w!==f&&(f=w,this.root.updateBlockedByResize=!0,d&&d(),d=qYe(m,250),D6.hasAnimatedSinceResize&&(D6.hasAnimatedSinceResize=!1,this.nodes.forEach(uQ)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||wGe,{onLayoutAnimationStart:b,onLayoutAnimationComplete:E}=u.getProps(),T=!this.targetLayout||!Ice(this.targetLayout,w),N=!f&&m;if(this.options.layoutRoot||this.resumeFrom||N||f&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const I={...Jj(y,"layout"),onPlay:b,onComplete:E};(u.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(d,N)}else f||uQ(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}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(),C0(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(fGe),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&&Nce(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:a,layout:c}=this.options;if(a===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(cQ);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(lQ);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(uGe),this.nodes.forEach(sGe),this.nodes.forEach(oGe)):this.nodes.forEach(lQ),this.clearAllSnapshots();const a=hl.now();ta.delta=xg(0,1e3/60,a-ta.timestamp),ta.timestamp=a,ta.isProcessing=!0,H9.update.process(ta),H9.preRender.process(ta),H9.render.process(ta),ta.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tz.read(this.scheduleUpdate))}
vendor: 6,213 bytes, line 8345
8345clearAllSnapshots(){this.nodes.forEach(lGe),this.sharedNodes.forEach(pGe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,gs.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){gs.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!bc(this.snapshot.measuredBox.x)&&!bc(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=zs(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:t(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Tce(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||my(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),yGe(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return zs();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(bGe))){const{scroll:d}=this.root;d&&(L2(a.x,d.offset.x),L2(a.y,d.offset.y))}return a}removeElementScroll(o){var c;const a=zs();if(ku(a,o),(c=this.scroll)!=null&&c.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:m}=d;d!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&ku(a,o),L2(a.x,f.offset.x),L2(a.y,f.offset.y))}return a}applyTransform(o,a=!1){const c=zs();ku(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&$2(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),my(d.latestValues)&&$2(c,d.latestValues)}return my(this.latestValues)&&$2(c,this.latestValues),c}removeTransform(o){const a=zs();ku(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!my(u.latestValues))continue;EL(u.latestValues)&&u.updateSnapshot();const d=zs(),f=u.measurePageBox();ku(d,f),nQ(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return my(this.latestValues)&&nQ(a,this.latestValues),a}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!==ta.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=ta.timestamp,!this.targetDelta&&!this.relativeTarget){const w=this.getClosestProjectingParent();w&&w.layout&&this.animationProgress!==1?(this.relativeParent=w,this.forceRelativeParentToResolveTarget(),this.relativeTarget=zs(),this.relativeTargetOrigin=zs(),HS(this.relativeTargetOrigin,this.layout.layoutBox,w.layout.layoutBox),ku(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=zs(),this.targetWithTransforms=zs()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_Ye(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ku(this.target,this.layout.layoutBox),cce(this.target,this.targetDelta)):ku(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const w=this.getClosestProjectingParent();w&&!!w.resumingFrom==!!this.resumingFrom&&!w.options.layoutScroll&&w.target&&this.animationProgress!==1?(this.relativeParent=w,this.forceRelativeParentToResolveTarget(),this.relativeTarget=zs(),this.relativeTargetOrigin=zs(),HS(this.relativeTargetOrigin,this.target,w.target),ku(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||EL(this.parent.latestValues)||ace(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 y;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&
vendor: 4,166 bytes, line 8345
8345(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===ta.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;ku(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;LKe(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=zs());const{target:w}=o;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(JZ(this.prevProjectionDelta.x,this.projectionDelta.x),JZ(this.prevProjectionDelta.y,this.projectionDelta.y)),WS(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!aQ(this.projectionDelta.x,this.prevProjectionDelta.x)||!aQ(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=U2(),this.projectionDelta=U2(),this.projectionDeltaWithTransform=U2()}setAnimationOrigin(o,a=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=U2();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const m=zs(),w=c?c.source:void 0,y=this.layout?this.layout.source:void 0,b=w!==y,E=this.getStack(),T=!E||E.members.length<=1,N=!!(b&&!T&&this.options.crossfade===!0&&!this.path.some(mGe));this.animationProgress=0;let I;this.mixTargetDelta=H=>{const L=H/1e3;dQ(f.x,o.x,L),dQ(f.y,o.y,L),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(HS(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),gGe(this.relativeTarget,this.relativeTargetOrigin,m,L),I&&eGe(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=zs()),ku(I,this.relativeTarget)),b&&(this.animationValues=d,YYe(d,u,this.latestValues,L,N,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,c,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(C0(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=gs.update(()=>{D6.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=jx(0)),this.currentAnimation=WYe(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(rGe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:d}=o;if(!(!a||!c||!u)){if(this!==o&&this.layout&&u&&Mce(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||zs();const f=bc(this.layout.layoutBox.x);
vendor: 9,455 bytes, line 8345
8345c.x.min=o.target.x.min,c.x.max=c.x.min+f;const m=bc(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+m}ku(a,c),$2(a,d),WS(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new tGe),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&nD("z",o,u,this.animationValues);for(let d=0;d<tD.length;d++)nD(`rotate${tD[d]}`,o,u,this.animationValues),nD(`skew${tD[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,a){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=P6(a==null?void 0:a.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=P6(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!my(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=nGe(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),o.transform=f;const{x:m,y:w}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${w.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 y in EC){if(d[y]===void 0)continue;const{correct:b,applyTo:E,isCSSVariable:T}=EC[y],N=f==="none"?d[y]:b(d[y],u);if(E){const I=E.length;for(let H=0;H<I;H++)o[E[H]]=N}else T?this.options.visualElement.renderState.vars[y]=N:o[y]=N}this.options.layoutId&&(o.pointerEvents=u===this?P6(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(cQ),this.root.sharedNodes.clear()}}}function sGe(n){n.updateLayout()}function oGe(n){var t;const e=((t=n.resumeFrom)==null?void 0:t.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&e&&n.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=n.layout,{animationType:s}=n.options,o=e.source!==n.layout.source;s==="size"?Bu(f=>{const m=o?e.measuredBox[f]:e.layoutBox[f],w=bc(m);m.min=r[f].min,m.max=m.min+w}):Mce(s,e.layoutBox,r)&&Bu(f=>{const m=o?e.measuredBox[f]:e.layoutBox[f],w=bc(r[f]);m.max=m.min+w,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[f].max=n.relativeTarget[f].min+w)});const a=U2();WS(a,r,e.layoutBox);const c=U2();o?WS(c,n.applyTransform(i,!0),e.measuredBox):WS(c,r,e.layoutBox);const u=!Tce(a);let d=!1;if(!n.resumeFrom){const f=n.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:w}=f;if(m&&w){const y=zs();HS(y,e.layoutBox,m.layoutBox);const b=zs();HS(b,r,w.layoutBox),Ice(y,b)||(d=!0),f.options.layoutRoot&&(n.relativeTarget=b,n.relativeTargetOrigin=y,n.relativeParent=f)}}}n.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(n.isLead()){const{onExitComplete:r}=n.options;r&&r()}n.options.transition=void 0}function aGe(n){n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function cGe(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function lGe(n){n.clearSnapshot()}function cQ(n){n.clearMeasurements()}function lQ(n){n.isLayoutDirty=!1}function uGe(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function uQ(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function dGe(n){n.resolveTargetDelta()}function hGe(n){n.calcProjection()}function fGe(n){n.resetSkewAndRotation()}function pGe(n){n.removeLeadSnapshot()}function dQ(n,e,t){n.translate=xs(e.translate,0,t),n.scale=xs(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function hQ(n,e,t,r){n.min=xs(e.min,t.min,r),n.max=xs(e.max,t.max,r)}function gGe(n,e,t,r){hQ(n.x,e.x,t.x,r),hQ(n.y,e.y,t.y,r)}function mGe(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const wGe={duration:.45,ease:[.4,0,.1,1]},fQ=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),pQ=fQ("applewebkit/")&&!fQ("chrome/")?Math.round:Hu;function gQ(n){n.min=pQ(n.min),n.max=pQ(n.max)}function yGe(n){gQ(n.x),gQ(n.y)}function Mce(n,e,t){return n==="position"||n==="preserve-aspect"&&!SYe(oQ(e),oQ(t),.2)}function bGe(n){var e;return n!==n.root&&((e=n.scroll)==null?void 0:e.wasRoot)}const vGe=Rce({attachResizeListener:(n,e)=>AC(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rD={current:void 0},kce=Rce({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!rD.current){const n=new vGe({});n.mount(window),n.setOptions({layoutScroll:!0}),rD.current=n}return rD.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),xGe={pan:{Feature:UYe},drag:{Feature:$Ye,ProjectionNode:kce,MeasureLayout:Sce}};function mQ(n,e,t){const{props:r}=n;n.animationState&&r.whileHover&&n.animationState.setActive("whileHover",t==="Start");const i="onHover"+t,s=r[i];s&&gs.postRender(()=>s(e,I4(e)))}class EGe extends U0{mount(){const{current:e}=this.node;e&&(this.unmount=Yqe(e,(t,r)=>(mQ(this.node,r,"Start"),i=>mQ(this.node,i,"End"))))}unmount(){}}class AGe extends U0{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=_4(AC(this.node.current,"focus",()=>this.onFocus()),AC(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function wQ(n,e,t){const{props:r}=n;if(n.current instanceof HTMLButtonElement&&n.current.disabled)return;n.animationState&&r.whileTap&&n.animationState.setActive("whileTap",t==="Start");const i="onTap"+(t==="End"?"":t),s=r[i];s&&gs.postRender(()=>s(e,I4(e)))}class SGe extends U0{mount(){const{current:e}=this.node;e&&(this.unmount=Xqe(e,(t,r)=>(wQ(this.node,r,"Start"),(i,{success:s})=>wQ(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const NL=new WeakMap,iD=new WeakMap,_Ge=n=>{const e=NL.get(n.target);e&&e(n)},CGe=n=>{n.forEach(_Ge)};function TGe({root:n,...e}){const t=n||document;iD.has(t)||iD.set(t,{});const r=iD.get(t),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(CGe,{root:n,...e})),r[i]}function IGe(n,e,t){const r=TGe(e);return NL.set(n,t),r.observe(n),()=>{NL.delete(n),r.unobserve(n)}}const NGe={some:0,all:1};class RGe extends U0{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:i="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:NGe[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!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(),m=u?d:f;m&&m(c)};return IGe(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(MGe(e,t))&&this.startObserver()}unmount(){}}function MGe({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}
8345const kGe={inView:{Feature:RGe},tap:{Feature:SGe},focus:{Feature:AGe},hover:{Feature:EGe}},OGe={layout:{ProjectionNode:kce,MeasureLayout:Sce}},PGe={...yYe,...kGe,...xGe,...OGe},qp=PKe(PGe,KKe),DGe=()=>{const[n,e]=X.useState(1),[t,r]=X.useState("40.png"),[i,s]=X.useState("dragon"),o=()=>`${Math.floor(Math.random()*25)+40}.png`;X.useEffect(()=>{r(o())},[n,i]);const u=i==="dragon"?[{title:"Chapter 1: The Dragon Awakens",content:["Once upon a time, in the land of Solana, a mighty dragon named YupFun awoke from its slumber. This dragon was no ordinary dragonâit had the power to swap tokens across multiple blockchains with the speed of light! ð","YupFun's scales shimmered with the colors of the rainbow, and its roar could be heard across the entire blockchain. But YupFun had a problemâit was hungry for liquidity! ð½ï¸"]},{title:"Chapter 2: The Quest for Liquidity",content:["YupFun set out on a quest to find the most efficient liquidity pools. It flew across Ethereum, BSC, and even the mysterious lands of Polygon and Arbitrum. Along the way, it encountered other dragons who were also searching for the best swap rates. ð²","With its auto-routing powers, YupFun always found the best prices, leaving the other dragons in awe. 'How does it do it?' they wondered. But YupFun just smiled and said, 'It's all about the algorithms!' ð¤"]},{title:"Chapter 3: The DEX Aggregator Dungeon",content:["YupFun entered the DEX Aggregator Dungeon, where it battled slippage monsters and found the best swap rates. The dragon emerged victorious, with the lowest fees in the land. ð","YupFun roared, 'DEX Aggregators are the future of trading!' ð°"]},{title:"Chapter 4: The Cross-Chain Bridge",content:["YupFun discovered the legendary Cross-Chain Bridge, a magical structure that connected all the blockchains. This bridge allowed tokens to flow freely between Ethereum, Solana, BSC, and more. ð","YupFun crossed the bridge, spreading liquidity wherever it went. The bridge was guarded by a wise old owl who said, 'Only those who understand the power of interoperability shall pass.' ð¦"]},{title:"Chapter 5: The Staking Volcano",content:["YupFun climbed the Staking Volcano, where dragons could stake their tokens to earn rewards. The volcano was filled with molten YUPFUN tokens, and the air was thick with the smell of passive income. ð","YupFun staked its tokens and watched as the rewards poured in. 'Staking is the key to long-term wealth,' the dragon thought. ð°"]},{title:"Chapter 6: The Governance Council",content:["YupFun was invited to the Governance Council, where dragons voted on the future of the YUPFUN ecosystem. The council debated important issues like fee structures, new features, and partnerships. ðï¸","YupFun cast its vote and felt proud to be part of a decentralized community. 'Governance is power,' the dragon declared. ð³ï¸"]},{title:"Chapter 7: The Fee Discount Forest",content:["YupFun wandered into the Fee Discount Forest, where users who held YUPFUN tokens enjoyed reduced transaction fees. The forest was filled with happy traders who saved money on every swap. ð³","YupFun roared with joy, 'Fee discounts make everyone happy!' ð"]},{title:"Chapter 8: The Multi-Chain Desert",content:["YupFun flew over the Multi-Chain Desert, a vast expanse where blockchains like Ethereum, Solana, and BSC coexisted. The dragon marveled at how seamlessly tokens moved between chains. ðï¸","A wise camel said, 'Interoperability is the future,' and YupFun nodded in agreement. ðª"]},{title:"Chapter 9: The NFT Marketplace",content:["YupFun arrived at the NFT Marketplace, where artists and collectors traded unique digital assets using YUPFUN tokens. The dragon was amazed by the creativity and innovation on display. ð¨","YupFun bought a rare NFT and declared, 'This is the future of art!' ð¼ï¸"]},{title:"Chapter 10: The DeFi Metropolis",content:["YupFun reached the DeFi Metropolis, a bustling city where decentralized finance thrived. The dragon saw lending, borrowing, and yield farming happening everywhere. ðï¸","YupFun joined a liquidity pool and said, 'DeFi is the future of finance!' ð¸"]},{title:"Chapter 11: The Mobile App Oasis",content:["YupFun discovered the Mobile App Oasis, where users could access DEX liquidity and cross-chain bridge functionality on their phones. The dragon was amazed by the convenience of trading on the go. ð±","YupFun declared, 'Mobile apps are the future of DeFi!' ð"]},{title:"Chapter 12: The Trading Crypto Jungle",content:["YupFun ventured into the Trading Crypto Jungle, where traders used advanced tools to analyze markets and execute trades. The dragon was impressed by the real-time data and secure wallet integrations. ð´","YupFun said, 'Trading has never been easier!' ð"]},{title:"Chapter 13: The Yield Farming Plains",content:["YupFun flew over the Yield Farming Plains, where farmers staked their tokens to earn high yields. The dragon joined a farm and watched its rewards grow. ð¾","YupFun thought, 'Yield farming is the key to passive income!' ð¹"]},{title:"Chapter 14: The Lending and Borrowing Valley",content:["YupFun explored the Lending and Borrowing Valley, where users could lend their tokens to earn interest or borrow assets for trading. The dragon was fascinated by the flexibility of DeFi. ðï¸","YupFun said, 'Lending and borrowing are the pillars of DeFi!' ð¦"]},{title:"Chapter 15: The Security Fortress",content:["YupFun arrived at the Security Fortress, where advanced encryption and smart contract audits kept users' funds safe. The dragon felt secure knowing its tokens were protected. ð°","YupFun declared, 'Security is the foundation of trust!' ð"]},{title:"Chapter 16: The Community Castle",content:["YupFun visited the Community Castle, where users from all over the world gathered to discu
8345ss the future of YUPFUN. The dragon was inspired by the passion and creativity of the community. ð°","YupFun said, 'The community is the heart of YUPFUN!' â¤ï¸"]},{title:"Chapter 17: The Final Adventure",content:["After many adventures, YupFun returned to Solana, where it was celebrated as a hero. The dragon had brought liquidity, interoperability, and innovation to the blockchain world. ð","But YupFun knew its journey was far from over. With a mighty roar, it declared, 'The future of DeFi is bright, and I will be there to guide it!' ð"]},{title:"Chapter 18: The Tokenomics Temple",content:["YupFun visited the Tokenomics Temple, where the secrets of YUPFUN's utility were revealed. The dragon learned about governance, staking, and fee discounts. ðï¸","YupFun said, 'Tokenomics is the backbone of the ecosystem!' ð¡"]},{title:"Chapter 19: The Roadmap Ruins",content:["YupFun explored the Roadmap Ruins, where ancient scrolls detailed the future plans for the YUPFUN ecosystem. The dragon was excited about the upcoming features. ðºï¸","YupFun declared, 'The roadmap is the path to greatness!' ð"]},{title:"Chapter 20: The Cross-Chain Cavern",content:["YupFun discovered the Cross-Chain Cavern, where tokens flowed freely between blockchains. The dragon marveled at the seamless transfers. ð","YupFun said, 'Cross-chain is the key to interoperability!' ð"]},{title:"Chapter 21: The E-Commerce Empire",content:["YupFun visited the E-Commerce Empire, where merchants and gamers used YUPFUN tokens for payments. The dragon was amazed by the growing adoption. ðï¸","YupFun declared, 'E-commerce and gaming are the future of YUPFUN!' ð®"]},{title:"Chapter 22: The Mobile App Mountain",content:["YupFun climbed the Mobile App Mountain, where users traded on the go with ease. The dragon was impressed by the convenience. ð±","YupFun said, 'Mobile apps are the future of DeFi!' ð"]},{title:"Chapter 23: The Trading Crypto Tower",content:["YupFun entered the Trading Crypto Tower, where traders used advanced tools to maximize profits. The dragon was inspired by the innovation. ð","YupFun declared, 'Trading has never been easier!' ð¹"]},{title:"Chapter 24: The E-Commerce Kingdom",content:["YupFun arrived at the E-Commerce Kingdom, where merchants accepted YUPFUN tokens as payment. The dragon was amazed by the variety of goods and services available, from magical potions to enchanted gadgets. ðï¸","The king of the kingdom declared, 'YUPFUN tokens are the future of commerce!' and awarded YupFun a golden medal for bringing liquidity to the land. ð
"]},{title:"Chapter 25: The Gaming Realm",content:["Next, YupFun ventured into the Gaming Realm, where players used YUPFUN tokens to buy in-game items and unlock special powers. The dragon joined a quest to defeat the evil Slippage Monster, which was causing chaos in the liquidity pools. ð®","With its auto-routing powers, YupFun defeated the monster and restored balance to the realm. The players cheered, 'YupFun is our hero!' ð"]}]:[{title:"Chapter 1: The Legend Begins",content:["Once upon a blockchain, deep in the realm of SolanaLand, there lived a noble dragon named Sir YUP-a-Lot.","He wasn't your average fire-breathing beastâno, he breathed low gas fees and swapped tokens faster than you could say 'Pump it!' ð¨"]},{title:"Chapter 2: The DEX Dungeon Rescue",content:["Every day, Sir YUP-a-Lot soared over the DEX dungeons, rescuing poor traders trapped by high slippage and rugpull sorcery. ð°","His sword? A blazing swap powered by YUPFUN that could cut through even the thickest sandwich attacks! âï¸"]},{title:"Chapter 3: The FeeFiFUD Showdown",content:["One day, the evil villain FeeFiFUD tried to drain the liquidity pool, shouting: 'Your swaps are weak! Your bridge fees are fake!'","But Sir YUP-a-Lot replied: 'My fees are lower than your follower count.' and slashed him with a 0.05% transaction fee. ð¥"]},{title:"Chapter 4: The Meme Economy",content:["The villagers rejoiced, tipping the dragon in memes and shitcoins. Sir YUP-a-Lot collected them all in his 'Degen Bag' ð","'These will moon someday,' he muttered, adding another zero to his collection. ð"]},{title:"Chapter 5: The Cross-Chain Crusade",content:["Sir YUP-a-Lot built a magical bridge connecting all blockchains. 'No more 30-minute ETH transfers!' he declared. ð","Even the Ethereum maxis had to admit it was pretty slick (though they still complained about 'real decentralization'). ð¤·ââï¸"]},{title:"Chapter 6: The Staking Tournament",content:["Knights from all over came to stake their YUP tokens in the great APY tournament. 'Yield so high it'll make your ledger melt!' ð¥","Sir YUP-a-Lot presided over the event, roasting weak hands with his fiery breath. 'Paper hands shall not pass!' ð"]},{title:"Chapter 7: The Final Battle",content:["In the ultimate showdown, Sir YUP-a-Lot faced the dreaded CEX Dragon who hoarded all the liquidity in his centralized lair. ð¦","With one mighty swap, Sir YUP-a-Lot proved that DEXs were the future, shouting: 'Be gone, KYC demon!' ð¡ï¸"]},{title:"Chapter 8: The Everlasting Meme",content:["As Sir YUP-a-Lot flew into the sunset, he left behind one final roar: 'HODL tight, peasants! YUP is just getting started!' ð
","And thus, the legend was born - retold in memes and shitposts across the cryptoverse for generations to come. ð"]}],d=()=>{n<u.length&&e(n+1)},f=()=>{n>1&&e(n-1)},m=()=>{s(w=>w==="dragon"?"sir":"dragon"),e(1)};return S.jsxs("div",{className:"dragon-container",children:[S.jsxs("div",{className:"flex justify-between items-center mb-4",children:[S.jsx("h1",{className:"text-yellow-300 text-2xl sm:text-4xl font-bold text-center",children:i==="dragon"?"ð The Dragon's Adventure ð":"ð¡ï¸ The Tale of Sir YUP-a-Lot ð¡ï¸"}),S.jsxs(qp.button,{onClick:m,whileHover:{scale:1.05},whileTap:{scale:.95},className:"py-1 px-3 text-xs sm:text-sm font-bold rounded-xl bg-purple-600 text-white hover:bg-purple-700 transition-all",children:["Switch to ",i==="dragon"?"Sir YUP-a-Lot":"YUPFUN Dragon"," Story"]})]}),S.jsxs(qp.div,{initial:{opacity:0,y:50}
8345,animate:{opacity:1,y:0},transition:{duration:1},className:"mb-4 sm:mb-8",children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:u[n-1].title}),u[n-1].content.map((w,y)=>S.jsx(qp.p,{initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{duration:.5,delay:y*.2},className:"mb-2 sm:mb-4 text-sm sm:text-base",children:w},y))]}),S.jsx("div",{className:"flex justify-center mb-4 sm:mb-8",children:S.jsx(qp.img,{src:`/images/${t}`,alt:i==="dragon"?"Dragon":"Sir YUP-a-Lot",initial:{scale:0},animate:{scale:1},transition:{duration:.5},className:"w-48 h-48 sm:w-64 sm:h-64 rounded-full border-4 border-yellow-400"})}),S.jsxs("div",{className:"flex justify-between",children:[S.jsxs(qp.button,{onClick:f,disabled:n===1,whileHover:{scale:1.1},whileTap:{scale:.9},className:"py-2 px-4 text-sm sm:text-lg font-bold rounded-xl bg-gray-700 text-gray-400 hover:bg-gray-600 hover:text-white transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[S.jsx("span",{children:"â¬
ï¸"})," Previous Chapter"]}),S.jsxs(qp.button,{onClick:d,disabled:n===u.length,whileHover:{scale:1.1},whileTap:{scale:.9},className:"py-2 px-4 text-sm sm:text-lg font-bold rounded-xl bg-gray-700 text-gray-400 hover:bg-gray-600 hover:text-white transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:["Next Chapter ",S.jsx("span",{children:"â¡ï¸"})]})]}),i==="sir"&&S.jsx("div",{className:"mt-6 p-4 bg-gray-800 rounded-lg border border-yellow-400",children:S.jsx("p",{className:"text-yellow-300 text-center italic",children:'"My APY is higher than your hopium levels!" - Sir YUP-a-Lot'})})]})},BGe=()=>{const n=["https://www.youtube.com/embed/qAbMQTwGqO0","https://www.youtube.com/embed/nXBcf-7Y1Go","https://www.youtube.com/embed/_8LUxsmHVHw","https://www.youtube.com/embed/3GlHUPKdI-g","https://www.youtube.com/embed/osoK6r2nVGc","https://www.youtube.com/embed/Pl3ZBQrWh-Q","https://www.youtube.com/embed/XTEgkzltrZ8","https://www.youtube.com/embed/hFV2jxiTwnU","https://www.youtube.com/embed/qf4IVO3VhBg","https://www.youtube.com/embed/mhCl2JU6lE4","https://www.youtube.com/embed/rfPAxQx7GmU","https://www.youtube.com/embed/xD8uWG_Swrk","https://www.youtube.com/embed/D57CZCOy7I0","https://www.youtube.com/embed/svisFpNvHgE","https://www.youtube.com/embed/cCP6-EawoFs"],[e,t]=X.useState("");X.useEffect(()=>{const u=n[Math.floor(Math.random()*n.length)];t(u)},[]);const[r,i]=X.useState([{id:1,name:"Bitcoin",creationDate:"2009-01-03",marketCap:"$1.2T",category:"Boomer Coin",blockchain:"Bitcoin"},{id:2,name:"Ethereum",creationDate:"2015-07-30",marketCap:"$400B",category:"DeFi Daddy",blockchain:"Ethereum"},{id:3,name:"Solana",creationDate:"2020-03-16",marketCap:"$50B",category:"Speed Demon",blockchain:"Solana"},{id:4,name:"Cardano",creationDate:"2017-09-29",marketCap:"$30B",category:"Academic Coin",blockchain:"Cardano"},{id:5,name:"YUPFUN",creationDate:"2025-02-03",marketCap:"ð Moon Soon",category:"Based Meme Coin",blockchain:"Solana"}]),[s,o]=X.useState({creationDate:"",marketCap:"",category:"",blockchain:""}),a=u=>{const{name:d,value:f}=u.target;o({...s,[d]:f})},c=r.filter(u=>(s.creationDate===""||u.creationDate.includes(s.creationDate))&&(s.marketCap===""||u.marketCap.includes(s.marketCap))&&(s.category===""||u.category.includes(s.category))&&(s.blockchain===""||u.blockchain.includes(s.blockchain)));return S.jsx("div",{className:"dragon-container",children:S.jsxs("div",{className:"p-3 sm:p-6 rounded-2xl shadow-lg max-w-4xl mx-auto text-white",children:[S.jsx("h1",{className:"text-yellow-300 text-xl sm:text-4xl font-bold text-center mb-3 sm:mb-8",children:"ð YUPFUN Token Whitepaper - Wen Moon? ð"}),S.jsx("div",{className:"mb-6 sm:mb-10 aspect-w-16 aspect-h-9",children:e&&S.jsx("iframe",{className:"w-full h-64 sm:h-96 rounded-lg",src:e,title:"YUP.FUN - Anthem song",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),S.jsxs("section",{className:"mb-4 sm:mb-8",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-2 sm:mb-4",children:"1. Introduction"}),S.jsx("p",{className:"mb-2 sm:mb-4 text-xs sm:text-base",children:S.jsx("strong",{children:"YUPFUN: The Based Meme Coin That Actually Does Stuff"})}),S.jsx("p",{className:"mb-2 sm:mb-4 text-xs sm:text-base",children:"Imagine if a meme coin and a DeFi aggregator had a baby, and that baby was raised by a pack of degenerate crypto traders. That's YUPFUN - we meme hard, but we build harder. Our DEX Aggregator & Cross-Chain Bridge lets you swap tokens across chains while you post memes about it."}),S.jsxs("p",{className:"mb-2 sm:mb-4 text-xs sm:text-base",children:["We've got the holy trinity: ",S.jsx("strong",{children:"YUPFUN token, Solana speed, and USDC stability"}),". Plus, we're building an entire ecosystem where you can trade, bridge, shop, and game - all while staying based."]}),S.jsxs("div",{className:"bg-yellow-100 p-3 rounded-lg mt-3",children:[S.jsxs("p",{className:"text-xs sm:text-base text-[#1A1C24] font-semibold",children:[S.jsx("strong",{children:"â ï¸ Warning: This Isn't Your Shitcoin Uncle's Project â ï¸"})," YUPFUN doesn't hold your bags - all swaps happen directly in your wallet. We charge a small fee (0.001â0.015 SOL) because even memes need to pay rent. No rug pulls here - just pure, unadulterated DeFi meets meme magic."]}),S.jsx("p",{className:"text-xs sm:text-base text-[#1A1C24] font-semibold mt-2",children:"â
No custody â
No scams â
Yes memes â
Yes gains"})]})]}),S.jsxs("section",{className:"mb-4 sm:mb-8",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-2 sm:mb-4",children:"2. Key Features (Why We're Based)"}),S.jsxs("ul",{className:"list-disc list-inside mb-2 sm:mb-4 text-xs sm:text-base space-y-1",children:[S.jsxs("li",{children:[S.jsx("strong",{children:"DEX Aggregator:"})," Finds you the best prices so you don't get rekt"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Mobile App:"})," Trade while you poop (we know you do it)"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Cross-Chain Bridge:"})," Move assets between chains like a DeFi ninja"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Multi-Chain Support:"})," We speak all the blockchain languages"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Price Tracking:"})," Watch your bags pump (or dump) in real-time"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Charting Tools:"})," Draw lines and pretend you know TA"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"New Pairs:"})," Find the next 100x before your Twitter feed does"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"E-Commerce & Gaming:"})," Spend your YUPFUN on real stuff (or more crypto)"]})]}),S.jsx("p",{className:"text-xs sm:text-sm italic mt-2",children:"*Disclaimer: Past performance of memes does not guarantee future results. But we're pretty fun."})]}),S.jsxs("section",{className:"mb-4 sm:mb-8",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-2 sm:mb-4",children:"3. Crypto List (Find Your Bags)"}),S.jsxs("div",{className:"mb-4 sm:mb-8",children:[S.jsx("h3",{className:"text-yellow-400 text-md sm:text-xl font-bold mb-2 sm:mb-4",children:"Filters (DYOR Tool)"}),S.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-2 md:grid-cols-4 gap-2 sm:gap-4 mb-4",children:[S.jsx("input",{type:"text",name:"creationDate",placeholder:"Wen Launch?",value:s.creationDate,onChange:a,className:"p-2 rounded-xl bg-gray-700 text-white text-xs sm:text-sm"}),S.jsx("input",{type:"text",name:"marketCap",placeholder:"Market Cap (Wen Lambo?)",value:s.marketCap,onChange:a,className:"p-2 rounded-xl bg-gray-700 text-white text-xs sm:text-sm"}),S.jsx("input",{type:"text",name:"category",placeholder:"Category (Based or Cringe?)",value:s.category,onChange:a,className:"p-2 rounded-xl bg-gray-700 text-white text-xs sm:text-sm"}),S.jsx("input",{type:"text",name:"blockchain",placeholder:"Chain (ETH = Boomer?)",value:s.blockchain,onChange:a,className:"p-2 rounded-xl bg-gray-700 text-white text-xs sm:text-sm"})]})]}),S.jsx("div",{className:"overflow-x-auto",children:S.jsxs("table",{className:"min-w-full bg-gray-800 rounded-xl",children:[S.jsx("thead",{children:S.jsxs("tr",{children:[S.jsx("th",{className:"px-2 py-1 sm:px-4 sm:py-2 text-left text-yellow-400 text-xs sm:text-sm",children:"Name"}),S.jsx("th",{className:"px-2 py-1 sm:px-4 sm:py-2 text-left text-yellow-400 text-xs sm:text-sm",children:"Wen Launch?"}),S.jsx("th",{className:"px-2 py-1 sm:px-4 sm:py-2 text-left text-yellow-400 text-xs sm:text-sm",children:"Market Cap"}),S.jsx("th",{className:"px-2 py-1 sm:px-4 sm:py-2 text-left text-yellow-400 text-xs sm:text-sm",children:"Vibe"}),S.jsx("th",{className:"px-2 py-1 sm:px-4 sm:py-2 text-left text-yellow-400 text-xs sm:text-sm",children:"Chain"})]})}),S.jsx("tbody",{children:c.map(u=>S.jsxs("tr",{className:"border-b border-gray-700",children:[S.jsx("td",{className:"px-2 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm",children:u.name==="YUPFUN"?S.jsxs("span",{className:"font-bold text-yellow-300",children:["ð¥ ",u.name," ð¥"]}):u.name}),S.jsx("td",{className:"px-2 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm",children:u.creationDate}),S.jsx("td",{className:"px-2 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm",children:u.name==="YUPFUN"?"ð To the Moon!":u.marketCap}),S.jsx("td",{className:"px-2 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm",children:u.category}),S.jsx("td",{className:"px-2 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm",children:u.blockchain})]},u.id))})]})})]}),S.jsxs("section",{className:"mb-4 sm:mb-8",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-2 sm:mb-4",children:"4. Tokenomics (Wen Token?)"}),S.jsx("p",{className:"mb-2 sm:mb-4 text-xs sm:text-base",children:"YUPFUN tokens are more than just memes - they're your ticket to governance, staking rewards, and VIP access to our ecosystem. Use them for fee discounts, shopping, gaming, or just flexing in our
8345community. Fees are low (0.001â0.015 SOL) because we're not here to rob you - we're here to make crypto fun again."}),S.jsx("div",{className:"bg-gray-700 p-3 rounded-lg mt-2",children:S.jsx("p",{className:"text-xs sm:text-sm font-mono",children:"1 YUPFUN = 1 YUPFUN (this is financial advice)"})})]}),S.jsxs("section",{className:"mb-4 sm:mb-8",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-2 sm:mb-4",children:"5. Roadmap (Wen Feature?)"}),S.jsx("p",{className:"mb-2 sm:mb-4 text-xs sm:text-base",children:"Here's what's coming (no fake promises like some projects we won't name):"}),S.jsxs("ul",{className:"list-disc list-inside text-xs sm:text-base space-y-1",children:[S.jsx("li",{children:"DEX aggregator that doesn't suck"}),S.jsx("li",{children:"Bridge that won't make you cry"}),S.jsx("li",{children:"Mobile app so you can trade anywhere"}),S.jsx("li",{children:"E-commerce where you can spend your gains"}),S.jsx("li",{children:"Gaming because why not"})]}),S.jsx("p",{className:"text-xs sm:text-sm italic mt-2",children:"*Dates are fake until they're not. We build first, promise later."})]}),S.jsxs("section",{className:"mb-4 sm:mb-8",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-2 sm:mb-4",children:"6. Conclusion (Wen Moon?)"}),S.jsx("p",{className:"mb-2 sm:mb-4 text-xs sm:text-base",children:"YUPFUN is what happens when memes meet actual utility. We're making DeFi fun, accessible, and maybe even profitable. Join us, hold some bags, and let's see where this rocket ship goes."}),S.jsx("div",{className:"bg-yellow-300 text-black p-2 rounded-lg text-center mt-2",children:S.jsx("p",{className:"font-bold text-xs sm:text-sm",children:"ð This is not financial advice, but YUPFUN is pretty fun ð"})})]}),S.jsxs("section",{className:"mb-4 sm:mb-8",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-2 sm:mb-4",children:"7. Contact & Community (Wen Community?)"}),S.jsxs("p",{className:"mb-2 sm:mb-4 text-xs sm:text-base",children:["Join our based community at ",S.jsx("a",{href:"https://yup.fun",className:"text-yellow-500 hover:underline",children:"https://yup.fun"}),". Bring memes, leave FUD."]})]})]})})},LGe=()=>{const n=[{question:"What is slippage and why is it important?",answer:"Slippage is the gap between the expected price of a trade and the price at which it actually gets executed. This happens because of market volatility, and it's crucial to understand because it shields you from unfavorable price swings. For instance, setting a 0.5% slippage means your trade will only go through if the price doesn't move against you by more than 0.5%."},{question:"Why do some transactions fail?",answer:"Transactions can fail for several reasons: not having enough funds to cover the swap and network fees, high price impact, expired quotes due to market movements, or network congestion. We recommend ensuring you have enough SOL for fees and setting an appropriate slippage tolerance."},{question:"What makes our swap service unique?",answer:"Unlock the best trading experience with our platform! We aggregate liquidity from multiple DEXs to guarantee competitive prices, charge ultra-low platform fees capped at 0.001â0.015 SOL, and utilize advanced routing for seamless, optimal trades. Transparency and user satisfaction are at the heart of what we doâensuring you always get the best rates, hassle-free."},{question:"What is 'Price Impact'?",answer:"Price impact indicates how much your trade will influence the token's price in the pool. Larger trades usually result in higher price impacts. To minimize this, we recommend keeping price impact under 1% by trading smaller amounts or choosing pools with greater liquidity."},{question:"How is the exchange rate calculated?",answer:"Exchange rates are determined by the liquidity pools' current state and use automated market maker (AMM) formulas. The rate you see includes the optimal routing through multiple DEXs to get you the best possible price."},{question:"Are there any hidden fees?",answer:"No hidden fees! You only pay the network's transaction fees (in SOL), the standard DEX fees that go to liquidity providers, and our minimal fee of just 0.001â0.015 SOL, which goes to YUPFUN token holders. We don't charge any additional platform or service fees."},{question:"What is 'Minimum Received'?",answer:"Minimum Received is the minimum amount of tokens you're guaranteed to receive from your swap, c
8345alculated based on your slippage tolerance. If the trade would result in receiving less than this amount, the transaction will fail to protect you."},{question:"Why do I need SOL for fees?",answer:"SOL is required to cover transaction fees on the Solana network. These fees are very minimal (typically < 0.00001 SOL) but essential for any transaction. Make sure to keep some SOL in your wallet for these fees."}];return S.jsx("div",{className:"dragon-container",children:S.jsxs("div",{className:"p-4 sm:p-6 rounded-2xl shadow-lg max-w-4xl mx-auto text-white",children:[S.jsx("h1",{className:"text-yellow-300 text-2xl sm:text-4xl font-bold text-center mb-4 sm:mb-8",children:"Frequently Asked Questions"}),S.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6",children:n.map((e,t)=>S.jsx("div",{className:"rounded-xl p-4 sm:p-6 hover:bg-[#3A3D44] transition-colors",children:S.jsxs("div",{className:"flex items-start gap-2 sm:gap-4",children:[S.jsx("div",{className:"flex-shrink-0 w-6 h-6 sm:w-8 sm:h-8 bg-[#7EBAFF]/10 rounded-lg flex items-center justify-center",children:S.jsx("span",{className:"text-[#7EBAFF] font-medium text-xs sm:text-sm",children:(t+1).toString().padStart(2,"0")})}),S.jsxs("div",{children:[S.jsx("h3",{className:"text-white font-medium text-sm sm:text-base mb-1 sm:mb-2",children:e.question}),S.jsx("p",{className:"text-white text-xs sm:text-sm leading-relaxed",children:e.answer})]})]})},t))})]})})},$Ge=()=>S.jsx("div",{className:"dragon-container",children:S.jsxs("div",{className:"p-4 sm:p-6 rounded-2xl shadow-lg max-w-4xl mx-auto text-white",children:[S.jsx("h1",{className:"text-yellow-300 text-2xl sm:text-4xl font-bold text-center mb-4 sm:mb-8",children:"Terms of Service for YUPFUN Token"}),S.jsxs("div",{className:"space-y-6",children:[S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"1. Introduction"}),S.jsxs("p",{className:"text-sm sm:text-base",children:[S.jsx("b",{children:"Welcome to the YUPFUN DEX Aggregator & Cross-Chain Bridge platform!"})," By using our services, you agree to comply with and be bound by the following terms and conditions. Please review them carefully."]}),S.jsxs("div",{className:"bg-yellow-100 p-4 rounded-lg mt-4",children:[S.jsxs("p",{className:"text-sm sm:text-base text-[#1A1C24] font-semibold",children:[S.jsx("strong",{children:"Important Notice: Your Security is Our Priority"})," YUPFUN's swap and bridge services utilize trusted third-party APIs, such as the Jupiter API, without retaining token custody or hosting liquidity pools. All transactions are executed securely and directly within users' wallets. YUPFUN applies a transparent 0.001â0.015 SOL fee on swaps while ensuring that we do not and will never hold user fundsâall funds remain safely in users' wallets."]}),S.jsx("p",{className:"text-sm sm:text-base text-[#1A1C24] font-semibold mt-2",children:"â
No token custody â
No liquidity pools â
Transparent fees â
User-controlled transactions"})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"2. Definitions"}),S.jsxs("ul",{className:"list-disc list-inside text-sm sm:text-base",children:[S.jsxs("li",{children:[S.jsx("strong",{children:"YUPFUN Token:"})," A digital asset integrated within the Solana ecosystem, used for seamless token swaps and cross-chain transactions."]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Platform:"})," The YUPFUN DEX Aggregator & Cross-Chain Bridge, including its e-commerce applications and gaming platforms."]}),S.jsxs("li",{children:[S.jsx("strong",{children:"User:"})," Any individual or entity using the YUPFUN platform."]})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"3. Use of the Platform"}),S.jsxs("ul",{className:"list-disc list-inside text-sm sm:text-base",children:[S.jsx("li",{children:"Users must comply with all applicable laws and regulations when using the platform."}),S.jsx("li",{children:"The platform facilitates token swaps across multiple blockchain networks, including Ethereum, Base, BSC, SUI, Tron, Avalanche, Toncoin, Polygon, and Arbitrum."}),S.jsx("li",{children:"Users are responsible for ensuring the security of their own digital wallets and private keys."})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"4. Fees and Transactions"}),S.jsxs("ul",{className:"list-disc list-inside text-sm sm:text-base",children:[S.jsx("li",{children:"The platform offers the lowest possible fees for token swaps and cross-chain transactions."}
8345),S.jsx("li",{children:"All transactions are final and non-reversible once confirmed on the blockchain."})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"5. Intellectual Property"}),S.jsxs("ul",{className:"list-disc list-inside text-sm sm:text-base",children:[S.jsx("li",{children:"All content, trademarks, and data on the platform are the property of YUPFUN or its licensors."}),S.jsx("li",{children:"Users may not reproduce, distribute, or create derivative works from any content on the platform without prior written consent."})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"6. Limitation of Liability"}),S.jsxs("ul",{className:"list-disc list-inside text-sm sm:text-base",children:[S.jsx("li",{children:"YUPFUN is not liable for any losses or damages arising from the use of the platform, including but not limited to, losses due to technical issues, security breaches, or unauthorized access to user accounts."}),S.jsx("li",{children:"Users acknowledge that the use of the platform is at their own risk."})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"7. Amendments"}),S.jsx("p",{className:"text-sm sm:text-base",children:"YUPFUN reserves the right to amend these terms of service at any time. Users will be notified of any changes via the platform or email."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"8. Governing Law"}),S.jsx("p",{className:"text-sm sm:text-base",children:"These terms of service are governed by and construed in accordance with the laws of the jurisdiction in which YUPFUN operates."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"9. Disclaimer"}),S.jsx("p",{className:"text-sm sm:text-base",children:"YUPFUN swap and bridge use Third Party APIs like Jupiter API, with no token custody or liquidity pools. Instead, users connect their wallets, and all transactions occur within their wallets while your platform charges a 0.001â0.015 SOL fee on swaps. YUPFUN doesn't and never holds user funds; all user funds remain in their wallets."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"10. Limitation of Liability"}),S.jsx("p",{className:"text-sm sm:text-base",children:"YUPFUN shall not be liable for any indirect, incidental, special, consequential, or punitive damages, including but not limited to, loss of profits, data, or use, whether in an action in contract, tort (including but not limited to negligence), or otherwise, arising out of or in any way connected with the use of or inability to use the platform or services."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"11. User Responsibilities"}),S.jsx("p",{className:"text-sm sm:text-base",children:"Users are solely responsible for the security of their wallets and private keys. YUPFUN is not responsible for any loss or damage resulting from the user's failure to secure their wallet or private keys."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"12. Contact Information"}),S.jsxs("p",{className:"text-sm sm:text-base",children:["For any questions or concerns regarding these terms of service, please contact us at"," ",S.jsx("a",{href:"mailto:[email protected]",className:"text-[#7EBAFF] hover:underline",children:"[email protected]"}),"."]})]})]})]})}),UGe=()=>S.jsx("div",{className:"dragon-container",children:S.jsxs("div",{className:"p-4 sm:p-6 rounded-2xl shadow-lg max-w-4xl mx-auto text-white",children:[S.jsx("h1",{className:"text-yellow-300 text-2xl sm:text-4xl font-bold text-center mb-4 sm:mb-8",children:"Privacy Policy for YUPFUN Token"}),S.jsxs("div",{className:"space-y-6",children:[S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"1. Introduction"}),S.jsxs("p",{className:"text-sm sm:text-base",children:[S.jsx("b",{children:"Welcome to YUPFUN DEX Aggregator & Cross-Chain Bridge!"}
vendor: 4,539 bytes, line 8345
8345)," This Privacy Policy explains how we collect, use, disclose, and protect your information. By using our services, you acknowledge and agree to the terms outlined in this Privacy Policy."]}),S.jsxs("div",{className:"bg-yellow-100 p-4 rounded-lg mt-4",children:[S.jsxs("p",{className:"text-sm sm:text-base text-[#1A1C24] font-semibold",children:[S.jsx("strong",{children:"Important Notice: Your Security is Our Priority:"})," YUPFUN's swap and bridge services utilize trusted third-party APIs, such as the Jupiter API, without retaining token custody or hosting liquidity pools. All transactions are executed securely and directly within users' wallets. YUPFUN applies a transparent 0.001â0.015 SOL fee on swaps while ensuring that we do not and will never hold user fundsâall funds remain safely in users' wallets."]}),S.jsx("p",{className:"text-sm sm:text-base text-[#1A1C24] font-semibold mt-2",children:"â
No token custody â
No liquidity pools â
Transparent fees â
User-controlled transactions"})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"2. Information We Collect"}),S.jsxs("ul",{className:"list-disc list-inside text-sm sm:text-base",children:[S.jsxs("li",{children:[S.jsx("strong",{children:"Personal Information:"})," When you register on our platform or use our services, we may collect personal information such as your name, email address, and contact details."]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Transaction Information:"})," We collect information about the transactions you perform on our platform, including token swaps and cross-chain transfers."]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Technical Information:"})," We collect technical information such as your IP address, device type, and browser settings when you access our platform."]})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"3. Use of Information"}),S.jsxs("ul",{className:"list-disc list-inside text-sm sm:text-base",children:[S.jsx("li",{children:"We use the information collected to provide, maintain, and improve our services, including facilitating token swaps and cross-chain transactions."}),S.jsx("li",{children:"We may use your contact information to send you updates, promotional materials, and other communications related to our platform."}),S.jsx("li",{children:"We use technical information to monitor and improve the performance of our platform and to ensure the security of your transactions."})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"4. Sharing of Information"}),S.jsxs("ul",{className:"list-disc list-inside text-sm sm:text-base",children:[S.jsx("li",{children:"We do not sell, trade, or otherwise transfer your personal information to third parties without your consent, except as described in this Privacy Policy."}),S.jsx("li",{children:"We may share your information with trusted service providers who assist us in operating our platform and providing our services, subject to confidentiality agreements."}),S.jsx("li",{children:"We may disclose your information to comply with legal obligations or to protect our rights, property, or safety."})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"5. Security"}),S.jsx("p",{className:"text-sm sm:text-base",children:"We implement a variety of security measures to protect your personal information and transaction data. However, no method of transmission over the internet or electronic storage is completely secure, and we cannot guarantee absolute security."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"6. Your Rights"}),S.jsxs("ul",{className:"list-disc list-inside text-sm sm:text-base",children:[S.jsx("li",{children:"You have the right to access, correct, or delete your personal information. You may also request the restriction of processing or object to the processing of your personal information."}),S.jsxs("li",{children:["To exercise your rights, please contact us at"," ",S.jsx("a",{href:"mailto:[email protected]",className:"text-[#7EBAFF] hover:underline",children:"[email protected]"}),"."]})]})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"7.
8345Cookies"}),S.jsx("p",{className:"text-sm sm:text-base",children:"Our platform uses cookies to enhance your user experience. You can control the use of cookies through your browser settings."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"8. Changes to This Privacy Policy"}),S.jsx("p",{className:"text-sm sm:text-base",children:"We may update this Privacy Policy from time to time. Any changes will be posted on this page, and we will notify you of any significant changes by email or through the platform."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"9. Disclaimer"}),S.jsx("p",{className:"text-sm sm:text-base",children:"YUPFUN swap and bridge use Third Party APIs like Jupiter API, with no token custody or liquidity pools. Instead, users connect their wallets, and all transactions occur within their wallets while your platform charges a 0.001â0.015 SOL fee on swaps. YUPFUN doesn't and never holds user funds; all user funds remain in their wallets."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"10. Limitation of Liability"}),S.jsx("p",{className:"text-sm sm:text-base",children:"YUPFUN shall not be liable for any indirect, incidental, special, consequential, or punitive damages, including but not limited to, loss of profits, data, or use, whether in an action in contract, tort (including but not limited to negligence), or otherwise, arising out of or in any way connected with the use of or inability to use the platform or services."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"11. User Responsibilities"}),S.jsx("p",{className:"text-sm sm:text-base",children:"Users are solely responsible for the security of their wallets and private keys. YUPFUN is not responsible for any loss or damage resulting from the user's failure to secure their wallet or private keys."})]}),S.jsxs("section",{children:[S.jsx("h2",{className:"text-yellow-400 text-xl sm:text-2xl font-bold mb-2 sm:mb-4",children:"12. Contact Information"}),S.jsxs("p",{className:"text-sm sm:text-base",children:["If you have any questions or concerns about this Privacy Policy, please contact us at"," ",S.jsx("a",{href:"mailto:[email protected]",className:"text-[#7EBAFF] hover:underline",children:"[email protected]"}),"."]})]})]})]})});var sD,yQ;function jGe(){if(yQ)return sD;yQ=1;function n(a){return a&&typeof a=="object"&&"default"in a?a.default:a}var e=TC(),t=n(e);function r(a,c,u){return c in a?Object.defineProperty(a,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):a[c]=u,a}function i(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c}var s=!!(typeof window<"u"&&window.document&&window.document.createElement);function o(a,c,u){if(typeof a!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof c!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof u<"u"&&typeof u!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function d(f){return f.displayName||f.name||"Component"}return function(m){if(typeof m!="function")throw new Error("Expected WrappedComponent to be a React component.");var w=[],y;function b(){y=a(w.map(function(T){return T.props})),E.canUseDOM?c(y):u&&(y=u(y))}var E=function(T){i(N,T);function N(){return T.apply(this,arguments)||this}N.peek=function(){return y},N.rewind=function(){if(N.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var L=y;return y=void 0,w=[],L};var I=N.prototype;return I.UNSAFE_componentWillMount=function(){w.push(this),b()},I.componentDidUpdate=function(){b()},I.componentWillUnmount=function(){var L=w.indexOf(this);w.splice(L,1),b()},I.render=function(){return t.createElement(m,this.props)},N}(e.PureComponent);return r(E,"displayName","SideEffect("+d(m)+")"),r(E,"canUseDOM",s),E}}return sD=o,sD}var zGe=jGe();const FGe=xo(zGe);var oD,bQ;function WGe(){if(bQ)return oD;bQ=1;var n=typeof Element<"u",e=typeof Map=="function",t=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function i(s,o){if(s===o)return!0;
8345if(s&&o&&typeof s=="object"&&typeof o=="object"){if(s.constructor!==o.constructor)return!1;var a,c,u;if(Array.isArray(s)){if(a=s.length,a!=o.length)return!1;for(c=a;c--!==0;)if(!i(s[c],o[c]))return!1;return!0}var d;if(e&&s instanceof Map&&o instanceof Map){if(s.size!==o.size)return!1;for(d=s.entries();!(c=d.next()).done;)if(!o.has(c.value[0]))return!1;for(d=s.entries();!(c=d.next()).done;)if(!i(c.value[1],o.get(c.value[0])))return!1;return!0}if(t&&s instanceof Set&&o instanceof Set){if(s.size!==o.size)return!1;for(d=s.entries();!(c=d.next()).done;)if(!o.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(s)&&ArrayBuffer.isView(o)){if(a=s.length,a!=o.length)return!1;for(c=a;c--!==0;)if(s[c]!==o[c])return!1;return!0}if(s.constructor===RegExp)return s.source===o.source&&s.flags===o.flags;if(s.valueOf!==Object.prototype.valueOf&&typeof s.valueOf=="function"&&typeof o.valueOf=="function")return s.valueOf()===o.valueOf();if(s.toString!==Object.prototype.toString&&typeof s.toString=="function"&&typeof o.toString=="function")return s.toString()===o.toString();if(u=Object.keys(s),a=u.length,a!==Object.keys(o).length)return!1;for(c=a;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,u[c]))return!1;if(n&&s instanceof Element)return!1;for(c=a;c--!==0;)if(!((u[c]==="_owner"||u[c]==="__v"||u[c]==="__o")&&s.$$typeof)&&!i(s[u[c]],o[u[c]]))return!1;return!0}return s!==s&&o!==o}return oD=function(o,a){try{return i(o,a)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},oD}var HGe=WGe();const VGe=xo(HGe);/* 8346object-assign 8347(c) Sindre Sorhus 8348@license MIT
8349*/var aD,vQ;function qGe(){if(vQ)return aD;vQ=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(o).map(function(d){return o[d]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return aD=i()?Object.assign:function(s,o){for(var a,c=r(s),u,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var f in a)e.call(a,f)&&(c[f]=a[f]);if(n){u=n(a);for(var m=0;m<u.length;m++)t.call(a,u[m])&&(c[u[m]]=a[u[m]])}}return c},aD}var KGe=qGe();const YGe=xo(KGe);var t1={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},cr={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys(cr).map(function(n){return cr[n]});var ds={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},E8={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},SC={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},GGe=Object.keys(E8).reduce(function(n,e){return n[E8[e]]=e,n},{}),ZGe=[cr.NOSCRIPT,cr.SCRIPT,cr.STYLE],Yd="data-react-helmet",QGe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},XGe=function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")},JGe=function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),Jc=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},eZe=function(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)},xQ=function(n,e){var t={};for(var r in n)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},tZe=function(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n},RL=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},nZe=function(e){var t=rx(e,cr.TITLE),r=rx(e,SC.TITLE_TEMPLATE);if(r&&t)return r.replace(/%s/g,function(){return Array.isArray(t)?t.join(""):t});var i=rx(e,SC.DEFAULT_TITLE);return t||i||void 0},rZe=function(e){return rx(e,SC.ON_CHANGE_CLIENT_STATE)||function(){}},cD=function(e,t){return t.filter(function(r){return typeof r[e]<"u"}).map(function(r){return r[e]}).reduce(function(r,i){return Jc({},r,i)},{})},iZe=function(e,t){return t.filter(function(r){return typeof r[cr.BASE]<"u"}).map(function(r){return r[cr.BASE]}).reverse().reduce(function(r,i){if(!r.length)for(var s=Object.keys(i),o=0;o<s.length;o++){var a=s[o],c=a.toLowerCase();if(e.indexOf(c)!==-1&&i[c])return r.concat(i)}return r},[])},VA=function(e,t,r){var i={};return r.filter(function(s){return Array.isArray(s[e])?!0:(typeof s[e]<"u"&&cZe("Helmet: "+e+' should be of type "Array". Instead found type "'+QGe(s[e])+'"'),!1)}).map(function(s){return s[e]}).reverse().reduce(function(s,o){var a={};o.filter(function(m){for(var w=void 0,y=Object.keys(m),b=0;b<y.length;b++){var E=y[b],T=E.toLowerCase();t.indexOf(T)!==-1&&!(w===ds.REL&&m[w].toLowerCase()==="canonical")&&!(T===ds.REL&&m[T].toLowerCase()==="stylesheet")&&(w=T),t.indexOf(E)!==-1&&(E===ds.INNER_HTML||E===ds.CSS_TEXT||E===ds.ITEM_PROP)&&(w=E)}if(!w||!m[w])return!1;var N=m[w].toLowerCase();return i[w]||(i[w]={}),a[w]||(a[w]={}),i[w][N]?!1:(a[w][N]=!0,!0)}
8349).reverse().forEach(function(m){return s.push(m)});for(var c=Object.keys(a),u=0;u<c.length;u++){var d=c[u],f=YGe({},i[d],a[d]);i[d]=f}return s},[]).reverse()},rx=function(e,t){for(var r=e.length-1;r>=0;r--){var i=e[r];if(i.hasOwnProperty(t))return i[t]}return null},sZe=function(e){return{baseTag:iZe([ds.HREF,ds.TARGET],e),bodyAttributes:cD(t1.BODY,e),defer:rx(e,SC.DEFER),encode:rx(e,SC.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:cD(t1.HTML,e),linkTags:VA(cr.LINK,[ds.REL,ds.HREF],e),metaTags:VA(cr.META,[ds.NAME,ds.CHARSET,ds.HTTPEQUIV,ds.PROPERTY,ds.ITEM_PROP],e),noscriptTags:VA(cr.NOSCRIPT,[ds.INNER_HTML],e),onChangeClientState:rZe(e),scriptTags:VA(cr.SCRIPT,[ds.SRC,ds.INNER_HTML],e),styleTags:VA(cr.STYLE,[ds.CSS_TEXT],e),title:nZe(e),titleAttributes:cD(t1.TITLE,e)}},ML=function(){var n=Date.now();return function(e){var t=Date.now();t-n>16?(n=t,e(t)):setTimeout(function(){ML(e)},0)}}(),EQ=function(e){return clearTimeout(e)},oZe=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||ML:globalThis.requestAnimationFrame||ML,aZe=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||EQ:globalThis.cancelAnimationFrame||EQ,cZe=function(e){return console&&typeof console.warn=="function"&&console.warn(e)},qA=null,lZe=function(e){qA&&aZe(qA),e.defer?qA=oZe(function(){AQ(e,function(){qA=null})}):(AQ(e),qA=null)},AQ=function(e,t){var r=e.baseTag,i=e.bodyAttributes,s=e.htmlAttributes,o=e.linkTags,a=e.metaTags,c=e.noscriptTags,u=e.onChangeClientState,d=e.scriptTags,f=e.styleTags,m=e.title,w=e.titleAttributes;kL(cr.BODY,i),kL(cr.HTML,s),uZe(m,w);var y={baseTag:g2(cr.BASE,r),linkTags:g2(cr.LINK,o),metaTags:g2(cr.META,a),noscriptTags:g2(cr.NOSCRIPT,c),scriptTags:g2(cr.SCRIPT,d),styleTags:g2(cr.STYLE,f)},b={},E={};Object.keys(y).forEach(function(T){var N=y[T],I=N.newTags,H=N.oldTags;I.length&&(b[T]=I),H.length&&(E[T]=y[T].oldTags)}),t&&t(),u(e,b,E)},Oce=function(e){return Array.isArray(e)?e.join(""):e},uZe=function(e,t){typeof e<"u"&&document.title!==e&&(document.title=Oce(e)),kL(cr.TITLE,t)},kL=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var i=r.getAttribute(Yd),s=i?i.split(","):[],o=[].concat(s),a=Object.keys(t),c=0;c<a.length;c++){var u=a[c],d=t[u]||"";r.getAttribute(u)!==d&&r.setAttribute(u,d),s.indexOf(u)===-1&&s.push(u);var f=o.indexOf(u);f!==-1&&o.splice(f,1)}for(var m=o.length-1;m>=0;m--)r.removeAttribute(o[m]);s.length===o.length?r.removeAttribute(Yd):r.getAttribute(Yd)!==a.join(",")&&r.setAttribute(Yd,a.join(","))}},g2=function(e,t){var r=document.head||document.querySelector(cr.HEAD),i=r.querySelectorAll(e+"["+Yd+"]"),s=Array.prototype.slice.call(i),o=[],a=void 0;return t&&t.length&&t.forEach(function(c){var u=document.createElement(e);for(var d in c)if(c.hasOwnProperty(d))if(d===ds.INNER_HTML)u.innerHTML=c.innerHTML;else if(d===ds.CSS_TEXT)u.styleSheet?u.styleSheet.cssText=c.cssText:u.appendChild(document.createTextNode(c.cssText));else{var f=typeof c[d]>"u"?"":c[d];u.setAttribute(d,f)}u.setAttribute(Yd,"true"),s.some(function(m,w){return a=w,u.isEqualNode(m)})?s.splice(a,1):o.push(u)}),s.forEach(function(c){return c.parentNode.removeChild(c)}),o.forEach(function(c){return r.appendChild(c)}),{oldTags:s,newTags:o}},Pce=function(e){return Object.keys(e).reduce(function(t,r){var i=typeof e[r]<"u"?r+'="'+e[r]+'"':""+r;return t?t+" "+i:i},"")},dZe=function(e,t,r,i){var s=Pce(r),o=Oce(t);return s?"<"+e+" "+Yd+'="true" '+s+">"+RL(o,i)+"</"+e+">":"<"+e+" "+Yd+'="true">'+RL(o,i)+"</"+e+">"},hZe=function(e,t,r){return t.reduce(function(i,s){var o=Object.keys(s).filter(function(u){return!(u===ds.INNER_HTML||u===ds.CSS_TEXT)}).reduce(function(u,d){var f=typeof s[d]>"u"?d:d+'="'+RL(s[d],r)+'"';return u?u+" "+f:f},""),a=s.innerHTML||s.cssText||"",c=ZGe.indexOf(e)===-1;return i+"<"+e+" "+Yd+'="true" '+o+(c?"/>":">"+a+"</"+e+">")},"")},Dce=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(r,i){return r[E8[i]||i]=e[i],r},t)},fZe=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(r,i){return r[GGe[i]||i]=e[i],r},t)},pZe=function(e,t,r){var i,s=(i={key:t},i[Yd]=!0,i),o=Dce(r,s);return[Qn.createElement(cr.TITLE,o,t)]},gZe=function(e,t){return t.map(function(r,i){var s,o=(s={key:i},s[Yd]=!0,s);return Object.keys(r).forEach(function(a){var c=E8[a]||a;if(c===ds.INNER_HTML||c===ds.CSS_TEXT){var u=r.innerHTML||r.cssText;o.dangerouslySetInnerHTML={__html:u}}else o[c]=r[a]}),Qn.createElement(e,o)})},Up=function(e,t,r){switch(e){case cr.TITLE:return{toComponent:function(){return pZe(e,t.title,t.titleAttributes)},toString:function(){return dZe(e,t.title,t.titleAttributes,r)}};case t1.BODY:case t1.HTML:return{toComponent:function(){return Dce(t)},toString:function(){return Pce(t)}};default:return{toComponent:function(){return gZe(e,t)},toString:function(){return hZe(e,t,r)}}}},Bce=function(e){var t=e.baseTag,r=e.bodyAttributes,i=e.encode,s=e.htmlAttributes,o=e.linkTags,a=e.metaTags,c=e.noscriptTags,u=e.scriptTags,d=e.styleTags,f=e.title,m=f===void 0?"":f,w=e.titleAttributes;return{base:Up(cr.BASE,t,i),bodyAttributes:Up(t1.BODY,r,i),htmlAttributes:Up(t1.HTML,s,i),link:Up(cr.LINK,o,i),meta:Up(cr.META,a,i),noscript:Up(cr.NOSCRIPT,c,i),script:Up(cr.SCRIPT,u,i),style:Up(cr.STYLE,d,i),title:Up(cr.TITLE,{title:m,titleAttributes:w},i)}},mZe=function(e){var t,r;return r=t=function(i){eZe(s,i);function s(){return XGe(this,s),tZe(this,i.apply(this,arguments))}return s.prototype.shouldComponentUpdate=function(a){return!VGe(this.props,a)},s.prototype.mapNestedChildrenToProps=function(a,c){if(!c)return null;
8349switch(a.type){case cr.SCRIPT:case cr.NOSCRIPT:return{innerHTML:c};case cr.STYLE:return{cssText:c}}throw new Error("<"+a.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},s.prototype.flattenArrayTypeChildren=function(a){var c,u=a.child,d=a.arrayTypeChildren,f=a.newChildProps,m=a.nestedChildren;return Jc({},d,(c={},c[u.type]=[].concat(d[u.type]||[],[Jc({},f,this.mapNestedChildrenToProps(u,m))]),c))},s.prototype.mapObjectTypeChildren=function(a){var c,u,d=a.child,f=a.newProps,m=a.newChildProps,w=a.nestedChildren;switch(d.type){case cr.TITLE:return Jc({},f,(c={},c[d.type]=w,c.titleAttributes=Jc({},m),c));case cr.BODY:return Jc({},f,{bodyAttributes:Jc({},m)});case cr.HTML:return Jc({},f,{htmlAttributes:Jc({},m)})}return Jc({},f,(u={},u[d.type]=Jc({},m),u))},s.prototype.mapArrayTypeChildrenToProps=function(a,c){var u=Jc({},c);return Object.keys(a).forEach(function(d){var f;u=Jc({},u,(f={},f[d]=a[d],f))}),u},s.prototype.warnOnInvalidChildren=function(a,c){return!0},s.prototype.mapChildrenToProps=function(a,c){var u=this,d={};return Qn.Children.forEach(a,function(f){if(!(!f||!f.props)){var m=f.props,w=m.children,y=xQ(m,["children"]),b=fZe(y);
8349switch(u.warnOnInvalidChildren(f,w),f.type){case cr.LINK:case cr.META:case cr.NOSCRIPT:case cr.SCRIPT:case cr.STYLE:d=u.flattenArrayTypeChildren({child:f,arrayTypeChildren:d,newChildProps:b,nestedChildren:w});break;default:c=u.mapObjectTypeChildren({child:f,newProps:c,newChildProps:b,nestedChildren:w});break}}}),c=this.mapArrayTypeChildrenToProps(d,c),c},s.prototype.render=function(){var a=this.props,c=a.children,u=xQ(a,["children"]),d=Jc({},u);return c&&(d=this.mapChildrenToProps(c,d)),Qn.createElement(e,d)},JGe(s,null,[{key:"canUseDOM",set:function(a){e.canUseDOM=a}}]),s}(Qn.Component),t.propTypes={base:bi.object,bodyAttributes:bi.object,children:bi.oneOfType([bi.arrayOf(bi.node),bi.node]),defaultTitle:bi.string,defer:bi.bool,encodeSpecialCharacters:bi.bool,htmlAttributes:bi.object,link:bi.arrayOf(bi.object),meta:bi.arrayOf(bi.object),noscript:bi.arrayOf(bi.object),onChangeClientState:bi.func,script:bi.arrayOf(bi.object),style:bi.arrayOf(bi.object),title:bi.string,titleAttributes:bi.object,titleTemplate:bi.string},t.defaultProps={defer:!0,encodeSpecialCharacters:!0},t.peek=e.peek,t.rewind=function(){var i=e.rewind();return i||(i=Bce({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),i},r},wZe=function(){return null},yZe=FGe(sZe,lZe,Bce)(wZe),A8=mZe(yZe);A8.renderStatic=A8.rewind;globalThis.Buffer=Ot;const bZe=()=>{const n=X.useRef(!1),[e,t]=X.useState(null),r=[{name:"Swap",link:"https://yup.fun",icon:S.jsx(Nj,{className:"mr-2"})},{name:"Bridge",link:"https://yupfun.io/bridge",icon:S.jsx(kj,{className:"mr-2"})},{name:"Why YUPFUN?",link:"https://yup.fun/unique-value",icon:S.jsx(Ij,{className:"mr-2"})},{name:"Roadmap",link:"https://yup.fun/roadmap",icon:S.jsx(Rj,{className:"mr-2"})},{name:"Meme",link:"https://yup.fun/meme",icon:S.jsx(Mj,{className:"mr-2"})}];return X.useEffect(()=>{let i;const s="mayan-widget-script-buy",o=()=>{if(!(!window.MayanSwap||n.current))try{window.MayanSwap.init("mayan-widget-container",{appIdentity:{name:"YUP! Swap",icon:"/cryptos/yupfun-logo.png",uri:"https://yup.fun"},rpcs:{solana:"https://lb.drpc.org/ogrpc?network=solana&dkey=Al8w_HEX0EMKqmxQ82P-PDPHCCZgEqcR8JjeKjrWkQAY"},sourceChains:["ethereum","bsc","base","polygon","arbitrum","avalanche"],destinationChains:["solana"],tokens:{to:{solana:["4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump"]}},solanaReferrerAddress:"5S4bV6LwHyfme8349Xu4x7K46RzGTPfdt5hkZhtuaPXe",evmReferrerAddress:"0x0B090E9bF5524952eed6f1FB8e62BAB0B4aBD7b5",referrerBps:45}),n.current=!0,t(null)}catch(c){t("Failed to initialize widget: "+c.message),console.error("Widget initialization error:",c)}};return(()=>{if(window.MayanSwap){o();return}const c=document.getElementById(s);if(c){c.onload=o;return}i=document.createElement("script"),i.id=s,i.src="https://cdn.mayan.finance/mayan_widget_v_1_2_3.js",i.integrity="sha256-bzm7o12gBcf2Ny9W4wRDocfnTVUYqz5s2zZPxQWUJgs=",i.crossOrigin="anonymous",i.async=!0,i.onload=()=>{o()},i.onerror=()=>{t("Failed to load Mayan widget script"),console.error("Failed to load Mayan widget script")},document.body.appendChild(i)})(),()=>{i&&document.body.removeChild(i),n.current=!1}},[]),S.jsxs("div",{className:"min-h-screen",children:[S.jsxs(A8,{children:[S.jsx("title",{children:"Buy YUPFUN Token | Low Fees & Instant Access"}),S.jsx("meta",{name:"description",content:"Buy YUPFUN tokens instantly on Solana. No signups, just low fees and secure wallet-based purchases."}),S.jsx("meta",{property:"og:title",content:"Buy YUPFUN Token | Low Fees & Instant Access"}),S.jsx("meta",{property:"og:description",content:"Get YUPFUN tokens now using Solana and more. Easy, fast, and direct to wallet."}),S.jsx("meta",{property:"og:image",content:"https://yup.fun/images/yupfun-preview.png"}),S.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),S.jsx("meta",{name:"twitter:title",content:"Buy YUPFUN Token"}),S.jsx("meta",{name:"twitter:description",content:"Buy YUPFUN with low fees â fast, wallet-first DeFi experience."}),S.jsx("meta",{name:"twitter:image",content:"https://yup.fun/images/yupfun-preview.png"})]}),S.jsx("header",{className:"w-full dragon-container-full px-4 md:px-6 py-4 border-b border-[#2C2F36]",children:S.jsxs("div",{className:"max-w-7xl mx-auto flex justify-between items-center",children:[S.jsx("div",{className:"flex items-center",children:S.jsx(Oo,{to:"https://yup.fun",className:"text-xl md:text-2xl font-bold text-[#7EBAFF] hover:text-[#6BA8FF] transition-colors duration-200",children:S.jsx("div",{className:"flex items-center",children:S.jsx("img",{src:"/images/YUPFUN-logo.png",alt:"YUPFUN Logo",className:"h-10 md:h-12",onError:i=>{i.target.onerror=null,i.target.src="/logos/default-logo.png"}})})})}),S.jsx("div",{className:"hidden lg:flex flex-1 justify-center items-center space-x-6 mx-4",children:r.map((i,s)=>S.jsxs(Oo,{to:i.link,className:`flex items-center ${i.name==="Bridge YUPFUN"?"text-[#7EBAFF] font-medium":"text-white hover:text-[#7EBAFF]"} transition-colors duration-200`,children:[i.icon,i.name]},s))}),S.jsx("div",{className:"flex items-center space-x-4",children:S.jsx("div",{className:"lg:hidden",children:S.jsxs(Wu,{as:"div",className:"relative inline-block text-left",children:[S.jsx("div",{children:S.jsx(Wu.Button,{className:"text-white hover:text-[#7EBAFF] transition-colors duration-200",children:"Menu"})}),S.jsx(Cj,{as:X.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:S.jsx(Wu.Items,{className:"absolute right-0 mt-2 w-56 origin-top-right bg-[#1A1C24] divide-y divide-[#2C2F36] rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-50",children:S.jsx("div",{className:"px-1 py-1",children:r.map((i,s)=>S.jsx(Wu.Item,{children:({active:o})=>S.jsxs(Oo,{to:i.link,className:`${o?"bg-[#2C2F36] text-[#7EBAFF]":"text-white"} group flex rounded-md items-center w-full px-2 py-2 text-sm`,children:[i.icon,i.name]})}
8349,s))})})})]})})})]})}),S.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-4",children:[S.jsx("div",{className:"mb-4 w-full max-w-2xl",children:S.jsxs("div",{className:"dragon-container-full rounded-xl p-4",children:[S.jsx("h1",{className:"text-xl font-bold text-[#7EBAFF]",children:"ð YUP! It's Fun. It's YUPFUN. ð No custody. Just fast, low-fee swaps."}),S.jsx(Oj,{className:"justify-center mt-2"})]})}),e&&S.jsx("div",{className:"text-red-500 mb-4",children:e}),S.jsx("div",{id:"mayan-widget-container"})]})]})};globalThis.Buffer=Ot;const vZe=()=>{const n=X.useRef(!1),[e,t]=X.useState(null),r=[{name:"Swap",link:"https://yup.fun",icon:S.jsx(Nj,{className:"mr-2"})},{name:"Bridge",link:"https://yupfun.io/bridge",icon:S.jsx(kj,{className:"mr-2"})},{name:"Why YUPFUN?",link:"https://yup.fun/unique-value",icon:S.jsx(Ij,{className:"mr-2"})},{name:"Roadmap",link:"https://yup.fun/roadmap",icon:S.jsx(Rj,{className:"mr-2"})},{name:"Meme",link:"https://yup.fun/meme",icon:S.jsx(Mj,{className:"mr-2"})}];return X.useEffect(()=>{let i;const s="mayan-widget-script-bridge",o=()=>{if(!(!window.MayanSwap||n.current))try{window.MayanSwap.init("mayan-widget-container",{appIdentity:{name:"YUP! Swap",icon:"/cryptos/yupfun-logo.png",uri:"https://yup.fun"},rpcs:{solana:"https://lb.drpc.org/ogrpc?network=solana&dkey=Al8w_HEX0EMKqmxQ82P-PDPHCCZgEqcR8JjeKjrWkQAY"},sourceChains:["ethereum","bsc","base","polygon","arbitrum","avalanche","solana"],destinationChains:["solana","ethereum","bsc","base","polygon","arbitrum","avalanche"],solanaReferrerAddress:"5S4bV6LwHyfme8349Xu4x7K46RzGTPfdt5hkZhtuaPXe",evmReferrerAddress:"0x0B090E9bF5524952eed6f1FB8e62BAB0B4aBD7b5",referrerBps:45}),n.current=!0,t(null)}catch(c){t("Failed to initialize widget: "+c.message),console.error("Widget initialization error:",c)}};return(()=>{if(window.MayanSwap){o();return}const c=document.getElementById(s);if(c){c.onload=o;return}i=document.createElement("script"),i.id=s,i.src="https://cdn.mayan.finance/mayan_widget_v_1_2_3.js",i.integrity="sha256-bzm7o12gBcf2Ny9W4wRDocfnTVUYqz5s2zZPxQWUJgs=",i.crossOrigin="anonymous",i.async=!0,i.onload=()=>{o()},i.onerror=()=>{t("Failed to load Mayan widget script"),console.error("Failed to load Mayan widget script")},document.body.appendChild(i)})(),()=>{i&&document.body.removeChild(i),n.current=!1}},[]),S.jsxs("div",{className:"min-h-screen",children:[S.jsxs(A8,{children:[S.jsx("title",{children:"Bridge Tokens | YUPFUN"}),S.jsx("meta",{name:"description",content:"Bridge your tokens across Solana, Ethereum, BSC, and more with low fees and full control on YUPFUN."}),S.jsx("meta",{property:"og:title",content:"Bridge Tokens | YUPFUN"}),S.jsx("meta",{property:"og:description",content:"Cross-chain bridging with no custody risk â powered by YUPFUN."}),S.jsx("meta",{property:"og:image",content:"https://yup.fun/images/yupfun-preview.png"}),S.jsx("meta",{property:"og:url",content:"https://yup.fun/bridge"}),S.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),S.jsx("meta",{name:"twitter:title",content:"Bridge Tokens | YUPFUN"}),S.jsx("meta",{name:"twitter:description",content:"Bridge crypto easily on YUPFUN with fast, low-fee transactions."}),S.jsx("meta",{name:"twitter:image",content:"https://yup.fun/images/yupfun-preview.png"})]}),S.jsx("header",{className:"w-full dragon-container-full px-4 md:px-6 py-4 border-b border-[#2C2F36]",children:S.jsxs("div",{className:"max-w-7xl mx-auto flex justify-between items-center",children:[S.jsx("div",{className:"flex items-center",children:S.jsx(Oo,{to:"https://yup.fun",className:"text-xl md:text-2xl font-bold text-[#7EBAFF] hover:text-[#6BA8FF] transition-colors duration-200",children:S.jsx("div",{className:"flex items-center",children:S.jsx("img",{src:"/images/YUPFUN-logo.png",alt:"YUPFUN Logo",className:"h-10 md:h-12",onError:i=>{i.target.onerror=null,i.target.src="/logos/default-logo.png"}})})})}),S.jsx("div",{className:"hidden lg:flex flex-1 justify-center items-center space-x-6 mx-4",children:r.map((i,s)=>S.jsxs(Oo,{to:i.link,className:`flex items-center ${i.name==="Bridge"?"text-[#7EBAFF] font-medium":"text-white hover:text-[#7EBAFF]"} transition-colors duration-200`,children:[i.icon,i.name]},s))}),S.jsx("div",{className:"flex items-center space-x-4",children:S.jsx("div",{className:"lg:hidden",children:S.jsxs(Wu,{as:"div",className:"relative inline-block text-left",children:[S.jsx("div",{children:S.jsx(Wu.Button,{className:"text-white hover:text-[#7EBAFF] transition-colors duration-200",children:"Menu"})}),S.jsx(Cj,{as:X.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:S.jsx(Wu.Items,{className:"absolute right-0 mt-2 w-56 origin-top-right bg-[#1A1C24] divide-y divide-[#2C2F36] rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-50",children:S.jsx("div",{className:"px-1 py-1",children:r.map((i,s)=>S.jsx(Wu.Item,{children:({active:o})=>S.jsxs(Oo,{to:i.link,className:`${o?"bg-[#2C2F36] text-[#7EBAFF]":"text-white"} group flex rounded-md items-center w-full px-2 py-2 text-sm`,children:[i.icon,i.name]})}
8349,s))})})})]})})})]})}),S.jsxs("div",{className:"flex flex-col items-center justify-center py-8 px-4",children:[S.jsx("div",{className:"mb-4 w-full max-w-2xl",children:S.jsxs("div",{className:"dragon-container-full rounded-xl p-4",children:[S.jsx("h1",{className:"text-xl font-bold text-[#7EBAFF]",children:"ð YUP! It's Fun. It's YUPFUN. ð No custody. Just fast, low-fee swaps."}),S.jsx(Oj,{className:"justify-center mt-2"})]})}),e&&S.jsx("div",{className:"text-red-500 mb-4",children:e}),S.jsx("div",{id:"mayan-widget-container"})]})]})},xZe=()=>{const n=["https://www.youtube.com/embed/qAbMQTwGqO0","https://www.youtube.com/embed/nXBcf-7Y1Go","https://www.youtube.com/embed/_8LUxsmHVHw","https://www.youtube.com/embed/3GlHUPKdI-g","https://www.youtube.com/embed/osoK6r2nVGc","https://www.youtube.com/embed/Pl3ZBQrWh-Q","https://www.youtube.com/embed/XTEgkzltrZ8","https://www.youtube.com/embed/hFV2jxiTwnU","https://www.youtube.com/embed/qf4IVO3VhBg","https://www.youtube.com/embed/mhCl2JU6lE4","https://www.youtube.com/embed/rfPAxQx7GmU","https://www.youtube.com/embed/xD8uWG_Swrk","https://www.youtube.com/embed/D57CZCOy7I0","https://www.youtube.com/embed/svisFpNvHgE","https://www.youtube.com/embed/cCP6-EawoFs"],[e,t]=X.useState("");return X.useEffect(()=>{const r=n[Math.floor(Math.random()*n.length)];t(r)},[]),S.jsx("div",{className:"dragon-container",children:S.jsxs("div",{className:"p-3 sm:p-6 rounded-2xl shadow-lg max-w-4xl mx-auto text-white",children:[S.jsx("h1",{className:"text-yellow-300 text-xl sm:text-4xl font-bold text-center mb-3 sm:mb-8",children:"About YUPFUN â Where DeFi Meets Meme Magic ð¦ð"}),S.jsx("div",{className:"mb-6 sm:mb-10 aspect-w-16 aspect-h-9",children:e&&S.jsx("iframe",{className:"w-full h-64 sm:h-96 rounded-lg",src:e,title:"YUP.FUN - Anthem song",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),S.jsx("section",{className:"mb-6 sm:mb-10",children:S.jsxs("div",{className:"space-y-4",children:[S.jsxs("p",{className:"text-xs sm:text-base",children:[S.jsx("strong",{children:"WAGMI, fren."})," YUPFUN is where degenerate trading strategies meet based DeFi fundamentals. We're the lovechild of a DEX aggregator and a meme coin that forgot to stay in its lane. Built on Solana (because speed matters when you're chasing pumps) and packing YUPFUN Token, USDC, and SOL support."]}
8349),S.jsx("div",{className:"bg-yellow-100 p-3 rounded-lg",children:S.jsxs("p",{className:"text-[#1A1C24] text-xs sm:text-sm font-bold",children:["ð¨ NO RUG ZONE ð¨",S.jsx("br",{}),"⢠No custody ⢠No pools ⢠Just pure wallet-to-wallet chad energy",S.jsx("br",{}),"⢠Fees so low they're basically a meme (0.001â0.015 SOL)",S.jsx("br",{}),'⢠Cross-chain swaps smoother than your best "gm" tweet']})}),S.jsxs("p",{className:"text-xs sm:text-base",children:[S.jsx("strong",{children:"But wait... there's more alpha:"}),S.jsx("br",{}),"We're building an entire ecosystem where you can:",S.jsx("br",{}),"⢠Swap like a degen ð¤",S.jsx("br",{}),"⢠Bridge like a ninja ð¥·",S.jsx("br",{}),"⢠Shop with your bags ðï¸",S.jsx("br",{}),"⢠Game with your gains ð®",S.jsx("br",{}),"⢠Flex your YUPFUN like a true crypto Chad ðª"]})]})}),S.jsxs("section",{className:"mb-6 sm:mb-10",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-3 sm:mb-5",children:"Why YUPFUN? (As If You Needed Reasons)"}),S.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4",children:[S.jsxs("div",{className:"p-3 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-md font-bold mb-1",children:"ð Not Your Keys? Not Your Problem"}),S.jsx("p",{className:"text-xs sm:text-sm",children:"We literally can't rug you even if we wanted to (we don't)"})]}),S.jsxs("div",{className:"p-3 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-md font-bold mb-1",children:"ð¸ Fees So Low It's Suspicious"}),S.jsx("p",{className:"text-xs sm:text-sm",children:"0.001â0.015 SOL - cheaper than your last failed trade"})]}),S.jsxs("div",{className:"p-3 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-md font-bold mb-1",children:"ð§ââï¸ API-Powered Black Magic"}),S.jsx("p",{className:"text-xs sm:text-sm",children:"Gets you best prices without selling your soul"})]})]}),S.jsx("div",{className:"bg-gray-700 p-3 rounded-lg mb-4",children:S.jsxs("p",{className:"text-xs sm:text-sm italic",children:[`"I tried YUPFUN and now my wife's boyfriend lets me use the good gaming chair"`,S.jsx("br",{}),"- Some Based Anon, probably"]})}),S.jsxs("p",{className:"text-xs sm:text-base mb-4",children:["Whether you're:",S.jsx("br",{}),"⢠A degen chasing 100x ð",S.jsx("br",{}),"⢠A normie just apeing in ð¦",S.jsx("br",{}),"⢠Here for the memes (we don't blame you) ð¤¡",S.jsx("br",{}),S.jsx("strong",{children:"YUPFUN is your VIP pass to Based DeFi."})]}),S.jsxs("div",{className:"text-center mt-6",children:[S.jsx("a",{href:"https://yup.fun",className:"bg-yellow-400 hover:bg-yellow-300 text-black font-bold py-3 px-6 rounded-full text-sm sm:text-base inline-block",children:"ð Join the YUPFUN Revolution ð"}),S.jsx("p",{className:"text-xs mt-2",children:"(Warning: May cause excessive excitement about DeFi)"})]})]})]})})},EZe=()=>S.jsxs("div",{className:"dragon-container max-w-2xl mx-auto p-6 bg-gray-900 rounded-lg shadow-lg",children:[S.jsx("h3",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-4",children:"ð How to Swap Like a Based Degen (Solana Edition) â¡"}),S.jsx("div",{className:"bg-yellow-100 p-3 rounded-lg mb-4",children:S.jsx("p",{className:"text-[#1A1C24] text-sm font-bold",children:"ð PRO TIP: Swapping is just fancy gambling with extra steps"})}),S.jsxs("ol",{className:"list-decimal list-inside space-y-3 text-gray-200 text-base leading-relaxed",children:[S.jsxs("li",{children:[S.jsx("strong",{children:"Launch YUP.fun"})," on your phone (where else would you degen from?)"]}),S.jsx("li",{children:'Tap "Connect Wallet" - this is where the magic begins'}),S.jsx("li",{children:"Select your wallet app (Phantom, Solflare, etc.)"}),S.jsxs("li",{className:"text-yellow-300",children:["If it doesn't auto-open: ",S.jsx("span",{className:"text-gray-400",children:"Skill issue"})]}),S.jsxs("li",{children:["For wallet noobs: Open your wallet's browser and type"," ",S.jsx("span",{className:"font-mono text-yellow-400",children:"yup.fun"})," like it's 1999"]}),S.jsx("li",{children:"Return to YUP.fun and connect again (persistence pays in crypto)"}),S.jsxs("li",{children:[S.jsx("strong",{children:"Boom!"})," You're ready to swap like a true degen"]})]}),S.jsxs("div",{className:"bg-gray-800 p-4 rounded-lg mt-6 border border-yellow-400",children:[S.jsx("h4",{className:"text-yellow-300 text-md font-bold mb-2",children:"ð Pro Degen Tips:"}),S.jsxs("ul",{className:"list-disc list-inside text-gray-200 space-y-1",children:[S.jsx("li",{children:"Slippage is like crypto Tinder - set it too low and you'll get no matches"}),S.jsx("li",{children:"Always check price impact (unless you like donating to LPs)"}),S.jsx("li",{children:"SOL fees are so low you'll think it's a bug"}),S.jsx("li",{children:"New tokens = either 100x or rug (no in-between)"})]})]}),S.jsxs("div",{className:"text-center mt-6",children:[S.jsx("p",{className:"text-yellow-400 text-lg font-bold",children:"Happy Swapping! May your bags be heavy! ð°"}),S.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"(Results not guaranteed - this is crypto after all)"})]})]}),AZe=()=>S.jsxs("div",{className:"dragon-container max-w-2xl mx-auto p-6 bg-gray-900 rounded-lg shadow-lg",children:[S.jsx("h1",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-4",children:"ð How to Bridge Like a Chad (Cross-Chain Wizardry) ð§ââï¸"}),S.jsx("div",{className:"bg-yellow-100 p-3 rounded-lg mb-4",children:S.jsx("p",{className:"text-[#1A1C24] text-sm font-bold",children:"ð¨ PRO TIP: Bridging is like teleporting your bags - just safer (and cooler)"})}),S.jsx("h2",{className:"text-yellow-300 text-md sm:text-xl font-bold mt-4 mb-2",children:"1. Enter the YUPFUN Portal"}),S.jsx("ul",{className:"custom-list text-gray-200",children:S.jsxs("li",{children:["Navigate to ",S.jsx("a",{href:"https://yupfun.io",target:"_blank",className:"text-yellow-400 hover:underline",children:"https://yupfun.io"})," (not financial advice)"]})}),S.jsx("h2",{className:"text-yellow-300 text-md sm:text-xl font-bold mt-4 mb-2",children:"2. Connect Your Wallet (No Rug Zone)"}),S.jsxs("ul",{className:"custom-list text-gray-200",children:[S.jsx("li",{children:`Click "Connect Wallet" - this won't steal your NFTs (probably)`}),S.jsx("li",{children:"Pick your poison: MetaMask, WalletConnect, etc."}),S.jsx("li",{children:"Sign that tx like you mean it"})]}),S.jsx("h2",{className:"text-yellow-300 text-md sm:text-xl font-bold mt-4 mb-2",children:"3. Choose Your Chains (Multiverse Mode)"}),S.jsxs("ul",{className:"custom-list text-gray-200",children:[S.jsx("li",{children:'"From" = Where your bags currently live'}),S.jsx("li",{children:'"To" = Where you want them to moon'}),S.jsx("li",{children:"Pro tip: ETH is for boomers, SOL is for speed demons"})]}),S.jsx("h2",{className:"text-yellow-300 text-md sm:text-xl font-bold mt-4 mb-2",children:"4. Pick Your Poison (Token Selection)"}),S.jsxs("ul",{className:"custom-list text-gray-200",children:[S.jsx("li",{children:"Select token to bridge (not your marriage)"}),S.jsx("li",{children:"Enter amount (leave some for gas unless you like getting rekt)"})]}),S.jsx("h2",{className:"text-yellow-300 text-md sm:text-xl font-bold mt-4 mb-2",children:"5. Approve the Sacrifice (Smart Contract Stuff)"}),S.jsxs("ul",{className:"custom-list text-gray-200",children:[S.jsx("li",{children:'Click "Approve" - this lets the bridge do its magic'}),S.jsx("li",{children:"Confirm in wallet (don't worry, we can't steal your seed phrase)"})]}),S.jsx("h2",{className:"text-yellow-300 text-md sm:text-xl font-bold mt-4 mb-2",children:"6. Initiate the Teleport (Bridging)"}),S.jsxs("ul",{className:"custom-list text-gray-200",children:[S.jsx("li",{children:'Hit "Bridge" like the degen you are'}),S.jsx("li",{children:"Approve again (yes, crypto loves making you click buttons)"})]}),S.jsx("h2",{className:"text-yellow-300 text-md sm:text-xl font-bold mt-4 mb-2",children:"7. Wait for Chain Magic (Patience, Padawan)"}),S.jsxs("ul",{className:"custom-list text-gray-200",children:[S.jsx("li",{children:"This isn't Amazon Prime - bridges take time"}),S.jsx("li",{children:"Track your tx like you track your ex's wallet"})]}),S.jsx("h2",{className:"text-yellow-300 text-md sm:text-xl font-bold mt-4 mb-2",children:"8. Verify Your Bags Landed (Diamond Hands Check)"}),S.jsxs("ul",{className:"custom-list text-gray-200",children:[S.jsx("li",{children:"Switch wallet to destination chain"}),S.jsx("li",{children:"Check balance - if zero, try not to panic (yet)"})]}),S.jsxs("div",{className:"bg-gray-800 p-4 rounded-lg mt-6 border border-yellow-400",children:[S.jsx("h2",{className:"text-yellow-300 text-md sm:text-xl font-bold mb-2",children:"â ï¸ Critical Degen Knowledge â ï¸"}),S.jsxs("ul",{className:"custom-list text-gray-200",children:[S.jsxs("li",{children:[S.jsx("strong",{children:"Gas Fees:"})," Like toll roads, but more annoying"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Network Congestion:"})," When everyone tries to exit at once"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Security:"})," Only use official YUPFUN - scammers love noobs"]}),S.jsxs("li",{children:[S.jsx("strong",{children:"Bridge Risk:"})," Not your keys? Not your coins (but we don't hold them anyway)"]})]})]}),S.jsxs("div",{className:"text-center mt-6",children:[S.jsx("p",{className:"text-yellow-400 text-lg font-bold",children:"Congrats! You're now a cross-chain degen! ðð"}),S.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"(This achievement unlocks: Bragging rights on Crypto Twitter)"})]})]}),SZe=()=>{const n=["https://www.youtube.com/embed/qAbMQTwGqO0","https://www.youtube.com/embed/nXBcf-7Y1Go","https://www.youtube.com/embed/_8LUxsmHVHw","https://www.youtube.com/embed/3GlHUPKdI-g","https://www.youtube.com/embed/osoK6r2nVGc","https://www.youtube.com/embed/Pl3ZBQrWh-Q","https://www.youtube.com/embed/XTEgkzltrZ8","https://www.youtube.com/embed/hFV2jxiTwnU","https://www.youtube.com/embed/qf4IVO3VhBg","https://www.youtube.com/embed/mhCl2JU6lE4","https://www.youtube.com/embed/rfPAxQx7GmU","https://www.youtube.com/embed/xD8uWG_Swrk","https://www.youtube.com/embed/D57CZCOy7I0","https://www.youtube.com/embed/svisFpNvHgE","https://www.youtube.com/embed/cCP6-EawoFs"],[e,t]=X.useState("");return X.useEffect(()=>{const r=n[Math.floor(Math.random()*n.length)];t(r)},[]),S.jsx("div",{className:"dragon-container",children:S.jsxs("div",{className:"p-3 sm:p-6 rounded-2xl shadow-lg max-w-4xl mx-auto text-white",children:[S.jsx("h1",{className:"text-yellow-300 text-xl sm:text-4xl font-bold text-center mb-3 sm:mb-8 animate-pulse",children:"ð YUPFUN Roadmap ð - Meme Magic In Progress! ð"}),S.jsx("div",{className:"mb-6 sm:mb-10 aspect-w-16 aspect-h-9",children:e&&S.jsx("iframe",{className:"w-full h-64 sm:h-96 rounded-lg",src:e,title:"YUP.FUN - Anthem song",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),S.jsx("section",{className:"mb-6 sm:mb-10",children:S.jsxs("div",{className:"space-y-4",children:[S.jsxs("p",{className:"text-xs sm:text-base",children:[S.jsx("strong",{children:"Our journey from meme coin to full-fledged memeconomy!"})," YUPFUN is building",S.jsx("span",{className:"text-yellow-300 font-bold",children:" dank utility"})," while keeping the",S.jsx("span",{className:"text-yellow-300 font-bold",children:" memetastic vibes"})," alive. Buckle up, fren - here's our based blueprint:"]}),S.jsx("div",{className:"bg-yellow-100 p-3 rounded-lg border-2 border-purple-500 transform hover:scale-[1.01] transition-transform",children:S.jsxs("p",{className:"text-[#1A1C24] text-xs sm:text-sm font-bold",children:["ð¦ MEME WARNING: THIS ROADMAP IS AS DYNAMIC AS YOUR FAVORITE SHITCOIN CHART ð",S.jsx("br",{}),"⢠Phase-based development with chad milestones",S.jsx("br",{}),"⢠Combining memes with alpha DeFi utility",S.jsx("br",{}),"⢠Community-driven moon missions",S.jsx("br",{}),"⢠Subject to change based on market vibes and community votes",S.jsx("br",{}),"⢠Not financial advice (we're just memeing here)"]})})]})}),S.jsxs("div",{className:"space-y-8",children:[S.jsxs("div",{className:"rounded-2xl p-4 sm:p-6 shadow-lg border-2 border-green-400 bg-gradient-to-br",children:[S.jsxs("div",{className:"flex items-center mb-3",children:[S.jsx("div",{className:"bg-green-500 text-white rounded-full w-6 h-6 sm:w-8 sm:h-8 flex items-center justify-center mr-3 animate-bounce",children:"â"}),S.jsx("h2",{className:"text-green-400 text-lg sm:text-2xl font-bold",children:"Phase 1: Meme Genesis (LFG!)"})]}),S.jsxs("ul",{className:"space-y-2 pl-9 sm:pl-12",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"YUPFUN Token yeeted onto Solana"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð§ "}),S.jsx("span",{children:"Dank meme branding that made normies FOMO"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"Listed on all the degen DEXs (Raydium, Meteora, etc)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"Liquidity locked like a Chad (DexScreener verified)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð¦"}),S.jsx("span",{children:"Market cap went brrr to $100K+"})]})]})]}),S.jsxs("div",{className:"rounded-2xl p-4 sm:p-6 shadow-lg border-2 border-yellow-400 bg-gradient-to-br transform hover:scale-[1.01] transition-transform",children:[S.jsxs("div",{className:"flex items-center mb-3",children:[S.jsx("div",{className:"bg-[#7EBAFF] text-[#1A1C24] rounded-full w-6 h-6 sm:w-8 sm:h-8 flex items-center justify-center mr-3 font-bold animate-pulse",children:"WAGMI"}),S.jsx("h2",{className:"text-yellow-300 text-lg sm:text-2xl font-bold",children:"ð¥ Phase 2: Utility Go Brrr (Current Phase)"})]}),S.jsxs("ul",{className:"space-y-2 pl-6 sm:pl-8",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ðª"}),S.jsx("span",{children:"CEX listings incoming (MEXC, KuCoin, etc) - wen Binance?"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð§©"}),S.jsx("span",{children:"Dank dApps dropping soon (games, tipping bots, faucets)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð¬"}),S.jsx("span",{children:"Shill2Earn: Get paid in $YUPFUN for memeing"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"DragonNation: WAGMI YUPFUNðð - Where $YUPFUN holders rise from fire to fortune"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð°"}),S.jsx("span",{children:"155 early Dragon legends, next 10,000 are coming"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð®"}),S.jsx("span",{children:"P2E meme games that'll make you quit your job"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"CoinMarketCap listing (wen moon?)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"Whale alerts so you can ride their waves"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð¦"}),S.jsx("span",{children:"10K+ degens holding (10M MC or we riot)"})]})]})]}),S.jsxs("div",{className:"rounded-2xl p-4 sm:p-6 shadow-lg border-2 border-teal-400 bg-gradient-to-br transform hover:scale
8349-[1.01] transition-transform",children:[S.jsxs("div",{className:"flex items-center mb-3",children:[S.jsx("div",{className:"bg-teal-500 text-white rounded-full w-6 h-6 sm:w-8 sm:h-8 flex items-center justify-center mr-3 font-bold animate-pulse",children:"ð¼"}),S.jsx("h2",{className:"text-teal-300 text-lg sm:text-2xl font-bold",children:"ð Phase 2.5: Business Applications (Building Empire)"})]}),S.jsx("h3",{className:"text-teal-200 text-md sm:text-xl font-bold mt-4 mb-2",children:"DeFi & Trading"}),S.jsxs("ul",{className:"space-y-2 pl-6 sm:pl-8 mb-4",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð¤"}),S.jsx("span",{children:"DEX Market Maker-as-a-Service: Automate liquidity & spread strategies for new tokens"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"Cross-Chain Bridge + Fee Layer: Aggregator bridge with fee dashboard & analytics"})]})]}),S.jsx("h3",{className:"text-teal-200 text-md sm:text-xl font-bold mt-4 mb-2",children:"ð® GameFi & Entertainment"}),S.jsxs("ul",{className:"space-y-2 pl-6 sm:pl-8 mb-4",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"Crypto-Powered Social Card Games: Asian card games with YUPFUN/SOL payments"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"âï¸"}),S.jsx("span",{children:"Meme Battle Royale: Stake-to-play with prize pools (meme + gambling = virality)"})]})]}),S.jsx("h3",{className:"text-teal-200 text-md sm:text-xl font-bold mt-4 mb-2",children:"ð Data & Analytics"}),S.jsxs("ul",{className:"space-y-2 pl-6 sm:pl-8 mb-4",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"On-Chain Screener/Explorer: Dashboards, alerts, and token analytics"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"CEX + DEX Arbitrage Scanner: Real-time arbitrage signals with subscription model"})]})]}),S.jsx("h3",{className:"text-teal-200 text-md sm:text-xl font-bold mt-4 mb-2",children:"ð Web3 E-Commerce"}),S.jsxs("ul",{className:"space-y-2 pl-6 sm:pl-8 mb-4",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ðï¸"}),S.jsx("span",{children:"Crypto Checkout Plugin: Shopify/WooCommerce plugin for Solana tokens"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð«"}),S.jsx("span",{children:"NFT Membership Club: Perks, discounts, and exclusive drops for holders"})]})]}),S.jsx("h3",{className:"text-teal-200 text-md sm:text-xl font-bold mt-4 mb-2",children:"ð¤ AI + Web3 Hybrids"}),S.jsxs("ul",{className:"space-y-2 pl-6 sm:pl-8",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"AI-Powered Smart Contract Auditor: Automated scanning for meme-token teams"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð¨"}),S.jsx("span",{children:'AI-Generated Meme NFT Minting: One-click "generate + mint" meme NFTs'})]})]})]}),S.jsxs("div",{className:"rounded-2xl p-4 sm:p-6 shadow-lg border-2 border-blue-400 bg-gradient-to-br",children:[S.jsx("h2",{className:"text-blue-300 text-lg sm:text-2xl font-bold mb-3",children:"ð Phase 3: Mainstream FOMO Incoming"}),S.jsxs("ul",{className:"space-y-2 pl-6 sm:pl-8",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ðª"}),S.jsx("span",{children:"Tier 1 CEX listings (OKX, Kraken, wen Binance?)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ðº"}),S.jsx("span",{children:"Influencers shilling us (paid in memes and $YUPFUN)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð§ "}),S.jsx("span",{children:'"Build on YUPFUN" - dev grants for based builders'})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð ï¸"}),S.jsx("span",{children:"AI meme generator (infinite meme machine)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð¤"}),S.jsx("span",{children:"Meme alliances - teaming up with other based projects"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð¦"}),S.jsx("span",{children:"50M MC or we're not based enough"})]})]})]}),S.jsxs("div",{className:"rounded-2xl p-4 sm:p-6 shadow-lg border-2 border-purple-400 bg-gradient-to-br",children:[S.jsx("h2",{className:"text-purple-300 text-lg sm:text-2xl font-bold mb-3",children:"Phase 4: Multichain Domination"}),S.jsxs("ul",{className:"space-y-2 pl-9 sm:pl-12",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"Wrapped $YUPFUN on all chains (even that one)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"Wormhole bridging (teleporting memes across chains)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð§ "}),S.jsx("span",{children:"Meme-powered marketing (spreading like a virus)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð§"}),S.jsx("span",{children:"More DEX liquidity (PancakeSwap, Uniswap, etc)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð¤"}),S.jsx("span",{children:"Market maker bots go brrr (volume ð)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð²"}),S.jsx("span",{children:"Cross-chain wallet (one wallet to rule them all)"})]})]})]}),S.jsxs("div",{className:"rounded-2xl p-4 sm:p-6 shadow-lg border-2 border-pink-400 bg-gradient-to-br",children:[S.jsx("h2",{className:"text-pink-300 text-lg sm:text-2xl font-bold mb-3",children:"ð§ Phase 5: Meme Singularity"}),S.jsxs("ul",{className:"space-y-2 pl-6 sm:pl-8",children:[S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ðï¸"}),S.jsx("span",{children:"YUPDAO - community takes the wheel (oh god)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"Meme battles with prize pools (degeneracy peaks)"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð°"}),S.jsx("span",{children:"$1B Market Cap or we're not trying hard enough"})]}),S.jsxs("li",{className:"flex items-start text-sm sm:text-base",children:[S.jsx("span",{className:"mr-2",children:"ð"}),S.jsx("span",{children:"YUPFUN Layer-2 (because why the hell not)"})]})]})]})]}),S.jsx("div",{className:"mt-6 p-4 rounded-lg border border-red-400",children:S.jsxs("p",{className:"text-xs sm:text-sm text-center",children:[S.jsx("strong",{children:"â ï¸ ROADMAP SUBJECT TO CHANGE â ï¸"}),S.jsx("br",{}),"This roadmap is as fluid as crypto markets. We'll adapt based on community vibes, market conditions,",S.jsx("br",{}),"and whatever memes are trending. Stay tuned for updates, fren!"]})}),S.jsxs("section",{className:"text-center mt-8 sm:mt-12",children:[S.jsx("div",{className:"bg-gradient-to-r from-yellow-400 to-pink-500 text-black p-4 rounded-lg mb-4 transform hover:scale-[1.02] transition-transform",children:S.jsxs("p",{className:"font-bold text-sm sm:text-base",children:["ð THIS ISN'T JUST A TOKEN - IT'S A MEME MOVEMENT! ð",S.jsx("br",{}),"WAGMI or NGMI - your choice, fren"]})}),S.jsx(Oo,{to:"https://yup.fun",className:"bg-gradient-to-r from-yellow-400 to-yellow-600 hover:from-yellow-300 hover:to-yellow-500 text-black font-bold py-3 px-6 rounded-full text-sm sm:text-base inline-block transform hover:scale-105 transition-transform",children:"ð JOIN THE MEME REVOLUTION ð"}),S.jsx("p",{className:"text-xs mt-2",children:"(Seriously though, this is gonna be memetastic)"})]})]})})};function Fi(n){var e=n.width,t=n.height;if(e<0)throw new Error("Negative width is not allowed for Size");if(t<0)throw new Error("Negative height is not allowed for Size");return{width:e,height:t}}function n1(n,e){return n.width===e.width&&n.height===e.height}var _Ze=function(){function n(e){var t=this;this._resolutionListener=function(){return t._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=e,this._installResolutionListener()}return n.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(n.prototype,"value",{get:function(){return this._window.devicePixelRatio}
8349,enumerable:!1,configurable:!0}),n.prototype.subscribe=function(e){var t=this,r={next:e};return this._observers.push(r),{unsubscribe:function(){t._observers=t._observers.filter(function(i){return i!==r})}}},n.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var e=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(e,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},n.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},n.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},n.prototype._onResolutionChanged=function(){var e=this;this._observers.forEach(function(t){return t.next(e._window.devicePixelRatio)}),this._reinstallResolutionListener()},n}();function CZe(n){return new _Ze(n)}var TZe=function(){function n(e,t,r){var i;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=e,this._canvasElementClientSize=Fi({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=t??function(s){return s},this._allowResizeObserver=(i=r==null?void 0:r.allowResizeObserver)!==null&&i!==void 0?i:!0,this._chooseAndInitObserver()}return n.prototype.dispose=function(){var e,t;if(this._canvasElement===null)throw new Error("Object is disposed");(e=this._canvasElementResizeObserver)===null||e===void 0||e.disconnect(),this._canvasElementResizeObserver=null,(t=this._devicePixelRatioObservable)===null||t===void 0||t.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(n.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bitmapSize",{get:function(){return Fi({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),n.prototype.resizeCanvasElement=function(e){this._canvasElementClientSize=Fi(e),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},n.prototype.subscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners.push(e)},n.prototype.unsubscribeBitmapSizeChanged=function(e){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(t){return t!==e})},Object.defineProperty(n.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),n.prototype.subscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners.push(e)},n.prototype.unsubscribeSuggestedBitmapSizeChanged=function(e){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(t){return t!==e})},n.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var e=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(e),this._emitSuggestedBitmapSizeChanged(e,this._suggestedBitmapSize)}},n.prototype._resizeBitmap=function(e){var t=this.bitmapSize;n1(t,e)||(this.canvasElement.width=e.width,this.canvasElement.height=e.height,this._emitBitmapSizeChanged(t,e))},n.prototype._emitBitmapSizeChanged=function(e,t){var r=this;this._bitmapSizeChangedListeners.forEach(function(i){return i.call(r,e,t)})},n.prototype._suggestNewBitmapSize=function(e){var t=this._suggestedBitmapSize,r=Fi(this._transformBitmapSize(e,this._canvasElementClientSize)),i=n1(this.bitmapSize,r)?null:r;t===null&&i===null||t!==null&&i!==null&&n1(t,i)||(this._suggestedBitmapSize=i,this._emitSuggestedBitmapSizeChanged(t,i))},n.prototype._emitSuggestedBitmapSizeChanged=function(e,t){var r=this;
8349this._suggestedBitmapSizeChangedListeners.forEach(function(i){return i.call(r,e,t)})},n.prototype._chooseAndInitObserver=function(){var e=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}NZe().then(function(t){return t?e._initResizeObserver():e._initDevicePixelRatioObservable()})},n.prototype._initDevicePixelRatioObservable=function(){var e=this;if(this._canvasElement!==null){var t=SQ(this._canvasElement);if(t===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=CZe(t),this._devicePixelRatioObservable.subscribe(function(){return e._invalidateBitmapSize()}),this._invalidateBitmapSize()}},n.prototype._invalidateBitmapSize=function(){var e,t;if(this._canvasElement!==null){var r=SQ(this._canvasElement);if(r!==null){var i=(t=(e=this._devicePixelRatioObservable)===null||e===void 0?void 0:e.value)!==null&&t!==void 0?t:r.devicePixelRatio,s=this._canvasElement.getClientRects(),o=s[0]!==void 0?RZe(s[0],i):Fi({width:this._canvasElementClientSize.width*i,height:this._canvasElementClientSize.height*i});this._suggestNewBitmapSize(o)}}},n.prototype._initResizeObserver=function(){var e=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(t){var r=t.find(function(o){return o.target===e._canvasElement});if(!(!r||!r.devicePixelContentBoxSize||!r.devicePixelContentBoxSize[0])){var i=r.devicePixelContentBoxSize[0],s=Fi({width:i.inlineSize,height:i.blockSize});e._suggestNewBitmapSize(s)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},n}();function IZe(n,e){return new TZe(n,e.transform,e.options)}function SQ(n){return n.ownerDocument.defaultView}function NZe(){return new Promise(function(n){var e=new ResizeObserver(function(t){n(t.every(function(r){return"devicePixelContentBoxSize"in r})),e.disconnect()});e.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function RZe(n,e){return Fi({width:Math.round(n.left*e+n.width*e)-Math.round(n.left*e),height:Math.round(n.top*e+n.height*e)-Math.round(n.top*e)})}var MZe=function(){function n(e,t,r){if(t.width===0||t.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=t,r.width===0||r.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=r,this._context=e}return n.prototype.useMediaCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),e({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},n.prototype.useBitmapCoordinateSpace=function(e){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),e({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(n.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),n}();function D1(n,e){var t=n.canvasElementClientSize;if(t.width===0||t.height===0)return null;var r=n.bitmapSize;if(r.width===0||r.height===0)return null;var i=n.canvasElement.getContext("2d",e);return i===null?null:new MZe(i,t,r)}/*! 8350 * @license 8351 * TradingView Lightweight Charts⢠v5.0.8 8352 * Copyright (c) 2025 TradingView, Inc. 8353 * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 8354 */const Lce={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};var _Q,CQ;function _C(n,e){const t={0:[],1:[n.lineWidth,n.lineWidth],2:[2*n.lineWidth,2*n.lineWidth],3:[6*n.lineWidth,6*n.lineWidth],4:[n.lineWidth,4*n.lineWidth]}[e];
8354n.setLineDash(t)}function $ce(n,e,t,r){n.beginPath();const i=n.lineWidth%2?.5:0;n.moveTo(t,e+i),n.lineTo(r,e+i),n.stroke()}function oa(n,e){if(!n)throw new Error("Assertion failed"+(e?": "+e:""))}function ml(n){if(n===void 0)throw new Error("Value is undefined");return n}function Pt(n){if(n===null)throw new Error("Value is null");return n}function r0(n){return Pt(ml(n))}(function(n){n[n.Simple=0]="Simple",n[n.WithSteps=1]="WithSteps",n[n.Curved=2]="Curved"})(_Q||(_Q={})),function(n){n[n.Solid=0]="Solid",n[n.Dotted=1]="Dotted",n[n.Dashed=2]="Dashed",n[n.LargeDashed=3]="LargeDashed",n[n.SparseDotted=4]="SparseDotted"}(CQ||(CQ={}));class Zs{constructor(){this.t=[]}i(e,t,r){const i={h:e,l:t,o:r===!0};this.t.push(i)}_(e){const t=this.t.findIndex(r=>e===r.h);t>-1&&this.t.splice(t,1)}u(e){this.t=this.t.filter(t=>t.l!==e)}p(e,t,r){const i=[...this.t];this.t=this.t.filter(s=>!s.o),i.forEach(s=>s.h(e,t,r))}v(){return this.t.length>0}m(){this.t=[]}}function tu(n,...e){for(const t of e)for(const r in t)t[r]!==void 0&&Object.prototype.hasOwnProperty.call(t,r)&&!["__proto__","constructor","prototype"].includes(r)&&(typeof t[r]!="object"||n[r]===void 0||Array.isArray(t[r])?n[r]=t[r]:tu(n[r],t[r]));return n}function Fx(n){return typeof n=="number"&&isFinite(n)}function CC(n){return typeof n=="number"&&n%1==0}function N4(n){return typeof n=="string"}function QI(n){return typeof n=="boolean"}function tg(n){const e=n;if(!e||typeof e!="object")return e;let t,r,i;for(r in t=Array.isArray(e)?[]:{},e)e.hasOwnProperty(r)&&(i=e[r],t[r]=i&&typeof i=="object"?tg(i):i);return t}function kZe(n){return n!==null}function OZe(n){return n===null?void 0:n}const Uce="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function S8(n,e,t){return e===void 0&&(e=Uce),`${t=t!==void 0?`${t} `:""}${n}px ${e}`}class PZe{constructor(e){this.M={S:1,C:5,P:NaN,k:"",T:"",R:"",D:"",V:0,I:0,B:0,A:0,L:0},this.O=e}N(){const e=this.M,t=this.F(),r=this.W();return e.P===t&&e.T===r||(e.P=t,e.T=r,e.k=S8(t,r),e.A=2.5/12*t,e.V=e.A,e.I=t/12*e.C,e.B=t/12*e.C,e.L=0),e.R=this.H(),e.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}}function lD(n){return n<0?0:n>255?255:Math.round(n)||0}function TQ(n){return .199*n[0]+.687*n[1]+.114*n[2]}class DZe{constructor(e,t){this.q=new Map,this.Y=e,t&&(this.q=t)}j(e,t){if(e==="transparent")return e;const r=this.K(e),i=r[3];return`rgba(${r[0]}, ${r[1]}, ${r[2]}, ${t*i})`}X(e){const t=this.K(e);return{Z:`rgb(${t[0]}, ${t[1]}, ${t[2]})`,G:TQ(t)>160?"black":"white"}}J(e){return TQ(this.K(e))}tt(e,t,r){const[i,s,o,a]=this.K(e),[c,u,d,f]=this.K(t),m=[lD(i+r*(c-i)),lD(s+r*(u-s)),lD(o+r*(d-o)),(w=a+r*(f-a),w<=0||w>1?Math.min(Math.max(w,0),1):Math.round(1e4*w)/1e4)];var w;return`rgba(${m[0]}, ${m[1]}, ${m[2]}, ${m[3]})`}K(e){const t=this.q.get(e);if(t)return t;const r=function(o){const a=document.createElement("div");a.style.display="none",document.body.appendChild(a),a.style.color=o;const c=window.getComputedStyle(a).color;return document.body.removeChild(a),c}(e),i=r.match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!i){if(this.Y.length)for(const o of this.Y){const a=o(e);if(a)return this.q.set(e,a),a}throw new Error(`Failed to parse color: ${e}`)}const s=[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),i[4]?parseFloat(i[4]):1];return this.q.set(e,s),s}}class BZe{constructor(){this.it=[]}st(e){this.it=e}nt(e,t,r){this.it.forEach(i=>{i.nt(e,t,r)})}}class R4{nt(e,t,r){e.useBitmapCoordinateSpace(i=>this.et(i,t,r))}}class LZe extends R4{constructor(){super(...arguments),this.rt=null}ht(e){this.rt=e}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:r}){if(this.rt===null||this.rt.lt===null)return;const i=this.rt.lt,s=this.rt,o=Math.max(1,Math.floor(t))%2/2,a=c=>{e.beginPath();for(let u=i.to-1;u>=i.from;--u){const d=s.ot[u],f=Math.round(d._t*t)+o,m=d.ut*r,w=c*r+o;e.moveTo(f,m),e.arc(f,m,w,0,2*Math.PI)}e.fill()};s.ct>0&&(e.fillStyle=s.dt,a(s.ft+s.ct)),e.fillStyle=s.vt,a(s.ft)}}function $Ze(){return{ot:[{_t:0,ut:0,wt:0,gt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}const UZe={from:0,to:1};
vendor: 12,825 bytes, line 8354
8354class jZe{constructor(e,t,r){this.Mt=new BZe,this.bt=[],this.St=[],this.xt=!0,this.O=e,this.Ct=t,this.Pt=r,this.Mt.st(this.bt)}kt(e){this.yt(),this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.Mt}yt(){const e=this.Pt.Dt();e.length!==this.bt.length&&(this.St=e.map($Ze),this.bt=this.St.map(t=>{const r=new LZe;return r.ht(t),r}),this.Mt.st(this.bt))}Rt(){const e=this.Ct.N().mode===2||!this.Ct.Vt(),t=this.Pt.It(),r=this.Ct.Bt(),i=this.O.Et();this.yt(),t.forEach((s,o)=>{const a=this.St[o],c=s.At(r),u=s.zt();!e&&c!==null&&s.Vt()&&u!==null?(a.vt=c.Lt,a.ft=c.ft,a.ct=c.Ot,a.ot[0].gt=c.gt,a.ot[0].ut=s.Ft().Nt(c.gt,u.Wt),a.dt=c.Ht??this.O.Ut(a.ot[0].ut/s.Ft().$t()),a.ot[0].wt=r,a.ot[0]._t=i.qt(r),a.lt=UZe):a.lt=null})}}class zZe extends R4{constructor(e){super(),this.Yt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:r,verticalPixelRatio:i}){if(this.Yt===null)return;const s=this.Yt.jt.Vt,o=this.Yt.Kt.Vt;if(!s&&!o)return;const a=Math.round(this.Yt._t*r),c=Math.round(this.Yt.ut*i);e.lineCap="butt",s&&a>=0&&(e.lineWidth=Math.floor(this.Yt.jt.ct*r),e.strokeStyle=this.Yt.jt.R,e.fillStyle=this.Yt.jt.R,_C(e,this.Yt.jt.Xt),function(u,d,f,m){u.beginPath();const w=u.lineWidth%2?.5:0;u.moveTo(d+w,f),u.lineTo(d+w,m),u.stroke()}(e,a,0,t.height)),o&&c>=0&&(e.lineWidth=Math.floor(this.Yt.Kt.ct*i),e.strokeStyle=this.Yt.Kt.R,e.fillStyle=this.Yt.Kt.R,_C(e,this.Yt.Kt.Xt),$ce(e,c,0,t.width))}}class FZe{constructor(e,t){this.xt=!0,this.Zt={jt:{ct:1,Xt:0,R:"",Vt:!1},Kt:{ct:1,Xt:0,R:"",Vt:!1},_t:0,ut:0},this.Gt=new zZe(this.Zt),this.Jt=e,this.Pt=t}kt(){this.xt=!0}Tt(e){return this.xt&&(this.Rt(),this.xt=!1),this.Gt}Rt(){const e=this.Jt.Vt(),t=this.Pt.Qt().N().crosshair,r=this.Zt;if(t.mode===2)return r.Kt.Vt=!1,void(r.jt.Vt=!1);r.Kt.Vt=e&&this.Jt.ti(this.Pt),r.jt.Vt=e&&this.Jt.ii(),r.Kt.ct=t.horzLine.width,r.Kt.Xt=t.horzLine.style,r.Kt.R=t.horzLine.color,r.jt.ct=t.vertLine.width,r.jt.Xt=t.vertLine.style,r.jt.R=t.vertLine.color,r._t=this.Jt.si(),r.ut=this.Jt.ni()}}function eM(n,e,t,r,i,s){n.save(),n.globalCompositeOperation="copy",n.fillStyle=s,n.fillRect(e,t,r,i),n.restore()}function IQ(n,e,t,r,i,s){n.beginPath(),n.roundRect?n.roundRect(e,t,r,i,s):(n.lineTo(e+r-s[1],t),s[1]!==0&&n.arcTo(e+r,t,e+r,t+s[1],s[1]),n.lineTo(e+r,t+i-s[2]),s[2]!==0&&n.arcTo(e+r,t+i,e+r-s[2],t+i,s[2]),n.lineTo(e+s[3],t+i),s[3]!==0&&n.arcTo(e,t+i,e,t+i-s[3],s[3]),n.lineTo(e,t+s[0]),s[0]!==0&&n.arcTo(e,t,e+s[0],t,s[0]))}function NQ(n,e,t,r,i,s,o=0,a=[0,0,0,0],c=""){if(n.save(),!o||!c||c===s)return IQ(n,e,t,r,i,a),n.fillStyle=s,n.fill(),void n.restore();const u=o/2;var d;IQ(n,e+u,t+u,r-o,i-o,(d=-u,a.map(f=>f===0?f:f+d))),s!=="transparent"&&(n.fillStyle=s,n.fill()),c!=="transparent"&&(n.lineWidth=o,n.strokeStyle=c,n.closePath(),n.stroke()),n.restore()}function jce(n,e,t,r,i,s,o){n.save(),n.globalCompositeOperation="copy";const a=n.createLinearGradient(0,0,0,i);a.addColorStop(0,s),a.addColorStop(1,o),n.fillStyle=a,n.fillRect(e,t,r,i),n.restore()}class RQ{constructor(e,t){this.ht(e,t)}ht(e,t){this.Yt=e,this.ei=t}$t(e,t){return this.Yt.Vt?e.P+e.A+e.V:0}nt(e,t,r,i){if(!this.Yt.Vt||this.Yt.ri.length===0)return;const s=this.Yt.R,o=this.ei.Z,a=e.useBitmapCoordinateSpace(c=>{const u=c.context;u.font=t.k;const d=this.hi(c,t,r,i),f=d.ai;return d.li?NQ(u,f.oi,f._i,f.ui,f.ci,o,f.di,[f.ft,0,0,f.ft],o):NQ(u,f.fi,f._i,f.ui,f.ci,o,f.di,[0,f.ft,f.ft,0],o),this.Yt.pi&&(u.fillStyle=s,u.fillRect(f.fi,f.mi,f.wi-f.fi,f.gi)),this.Yt.Mi&&(u.fillStyle=t.D,u.fillRect(d.li?f.bi-f.di:0,f._i,f.di,f.Si-f._i)),d});e.useMediaCoordinateSpace(({context:c})=>{const u=a.xi;c.font=t.k,c.textAlign=a.li?"right":"left",c.textBaseline="middle",c.fillStyle=s,c.fillText(this.Yt.ri,u.Ci,(u._i+u.Si)/2+u.Pi)})}hi(e,t,r,i){const{context:s,bitmapSize:o,mediaSize:a,horizontalPixelRatio:c,verticalPixelRatio:u}=e,d=this.Yt.pi||!this.Yt.ki?t.C:0,f=this.Yt.yi?t.S:0,m=t.A+this.ei.Ti,w=t.V+this.ei.Ri,y=t.I,b=t.B,E=this.Yt.ri,T=t.P,N=r.Di(s,E),I=Math.ceil(r.Vi(s,E)),H=T+m+w,L=t.S+y+b+I+d,U=Math.max(1,Math.floor(u));let K=Math.round(H*u);K%2!=U%2&&(K+=1);const Y=f>0?Math.max(1,Math.floor(f*c)):0,k=Math.round(L*c),j=Math.round(d*c),V=this.ei.Ii??this.ei.Bi,W=Math.round(V*u)-Math.floor(.5*u),$=Math.floor(W+U/2-K/2),A=$+K,_=i==="right",R=_?a.width-f:f,P=_?o.width-Y:Y;let q,F,z;return _?(q=P-k,F=P-j,z=R-d-y-f):(q=P+k,F=P+j,z=R+d+y),{li:_,ai:{_i:$,mi:W,Si:A,ui:k,ci:K,ft:2*c,di:Y,oi:q,fi:P,wi:F,gi:U,bi:o.width},xi:{_i:$/u,Si:A/u,Ci:z,Pi:N}}}}class tM{constructor(e){this.Ei={Bi:0,Z:"#000",Ri:0,Ti:0},this.Ai={ri:"",Vt:!1,pi:!0,ki:!1,Ht:"",R:"#FFF",Mi:!1,yi:!1},this.zi={ri:"",Vt:!1,pi:!1,ki:!0,Ht:"",R:"#FFF",Mi:!0,yi:!0},this.xt=!0,this.Li=new(e||RQ)(this.Ai,this.Ei),this.Oi=new(e||RQ)(this.zi,this.Ei)}ri(){return this.Ni(),this.Ai.ri}Bi(){return this.Ni(),this.Ei.Bi}kt(){this.xt=!0}$t(e,t=!1){return Math.max(this.Li.$t(e,t),this.Oi.$t(e,t))}Fi(){return this.Ei.Ii||0}Wi(e){this.Ei.Ii=e}Hi(){return this.Ni(),this.Ai.Vt||this.zi.Vt}Ui(){return this.Ni(),this.Ai.Vt}Tt(e){return this.Ni(),this.Ai.pi=this.Ai.pi&&e.N().ticksVisible,this.zi.pi=this.zi.pi&&e.N().ticksVisible,this.Li.ht(this.Ai,this.Ei),this.Oi.ht(this.zi,this.Ei),this.Li}$i(){return this.Ni(),this.Li.ht(this.Ai,this.Ei),this.Oi.ht(this.zi,this.Ei),this.Oi}Ni(){this.xt&&(this.Ai.pi=!0,this.zi.pi=!1,this.qi(this.Ai,this.zi,this.Ei))}}class WZe extends tM{constructor(e,t,r){super(),this.Jt=e,this.Yi=t,this.ji=r}qi(e,t,r){if(e.Vt=!1,this.Jt.N().mode===2)return;const i=this.Jt.N().horzLine;if(!i.labelVisible)return;const s=this.Yi.zt();if(!this.Jt.Vt()||this.Yi.Ki()||s===null)return;const o=this.Yi.Xi().X(i.labelBackgroundColor);r.Z=o.Z,e.R=o.G;const a=2/12*this.Yi.P();r.Ti=a,r.Ri=a;const c=this.ji(this.Yi);r.Bi=c.Bi,e.ri=this.Yi.Zi(c.gt,s),e.Vt=!0}}const HZe=/[1-9]/g;class zce{constructor(){this.Yt=null}ht(e){this.Yt=e}nt(e,t){if(this.Yt===null||this.Yt.Vt===!1||this.Yt.ri.length===0)return;const r=e.useMediaCoordinateSpace(({context:m})=>(m.font=t.k,Math.round(t.Gi.Vi(m,Pt(this.Yt).ri,HZe))));if(r<=0)return;const i=t.Ji,s=r+2*i,o=s/2,a=this.Yt.Qi;let c=this.Yt.Bi,u=Math.floor(c-o)+.5;u<0?(c+=Math.abs(0-u),u=Math.floor(c-o)+.5):u+s>a&&(c-=Math.abs(a-(u+s)),u=Math.floor(c-o)+.5);const d=u+s,f=Math.ceil(0+t.S+t.C+t.A+t.P+t.V);e.useBitmapCoordinateSpace(({context:m,horizontalPixelRatio:w,verticalPixelRatio:y})=>{const b=Pt(this.Yt);m.fillStyle=b.Z;const E=Math.round(u*w),T=Math.round(0*y),N=Math.round(d*w),I=Math.round(f*y),H=Math.round(2*w);if(m.beginPath(),m.moveTo(E,T),m.lineTo(E,I-H),m.arcTo(E,I,E+H,I,H),m.lineTo(N-H,I),m.arcTo(N,I,N,I-H,H),m.lineTo(N,T),m.fill(),b.pi){const L=Math.round(b.Bi*w),U=T,K=Math.round((U+t.C)*y);m.fillStyle=b.R;const Y=Math.max(1,Math.floor(w)),k=Math.floor(.5*w);m.fillRect(L-k,U,Y,K-U)}}),e.useMediaCoordinateSpace(({context:m})=>{const w=Pt(this.Yt),y=0+t.S+t.C+t.A+t.P/2;m.font=t.k,m.textAlign="left",m.textBaseline="middle",m.fillStyle=w.R;const b=t.Gi.Di(m,"Apr0");m.translate(u+i,y+b),m.fillText(w.ri,0,0)})}}class VZe{constructor(e,t,r){this.xt=!0,this.Gt=new zce,this.Zt={Vt:!1,Z:"#4c525e",R:"white",ri:"",Qi:0,Bi:NaN,pi:!0},this.Ct=e,this.ts=t,this.ji=r}kt(){this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.Gt.ht(this.Zt),this.Gt}Rt(){const e=this.Zt;if(e.Vt=!1,this.Ct.N().mode===2)return;const t=this.Ct.N().vertLine;if(!t.labelVisible)return;const r=this.ts.Et();if(r.Ki())return;e.Qi=r.Qi();const i=this.ji();if(i===null)return;e.Bi=i.Bi;const s=r.ss(this.Ct.Bt());e.ri=r.ns(Pt(s)),e.Vt=!0;const o=this.ts.Xi().X(t.labelBackgroundColor);e.Z=o.Z,e.R=o.G,e.pi=r.N().ticksVisible}}class Fce{constructor(){this.es=null,this.rs=0}hs(){return this.rs}ls(e){this.rs=e}Ft(){return this.es}_s(e){this.es=e}us(e){return[]}cs(){return[]}Vt(){return!0}}var OL;(function(n){n[n.Normal=0]="Normal",n[n.Magnet=1]="Magnet",n[n.Hidden=2]="Hidden",n[n.MagnetOHLC=3]="MagnetOHLC"})(OL||(OL={}));class qZe extends Fce{constructor(e,t){super(),this.Pt=null,this.ds=NaN,this.fs=0,this.ps=!1,this.vs=new Map,this.ws=!1,this.gs=new WeakMap,this.Ms=new WeakMap,this.bs=NaN,this.Ss=NaN,this.xs=NaN,this.Cs=NaN,this.ts=e,this.Ps=t,this.ks=((i,s)=>o=>{const a=s(),c=i();if(o===Pt(this.Pt).ys())return{gt:c,Bi:a};{const u=Pt(o.zt());return{gt:o.Ts(a,u),Bi:a}}})(()=>this.ds,()=>this.Ss);const r=((i,s)=>()=>{const o=this.ts.Et().Rs(i()),a=s();return o&&Number.isFinite(a)?{wt:o,Bi:a}:null})(()=>this.fs,()=>this.si());this.Ds=new VZe(this,e,r)}N(){return this.Ps}Vs(e,t){this.xs=e,this.Cs=t}Is(){this.xs=NaN,this.Cs=NaN}Bs(){return this.xs}Es(){return this.Cs}As(e,t,r){this.ws||(this.ws=!0),this.ps=!0,this.zs(e,t,r)}Bt(){return this.fs}si(){return this.bs}ni(){return this.Ss}Vt(){return this.ps}Ls(){this.ps=!1,this.Os(),this.ds=NaN,this.bs=NaN,this.Ss=NaN,this.Pt=null,this.Is(),this.Ns()}Fs(e){let t=this.gs.get(e);t||(t=new FZe(this,e),this.gs.set(e,t));let r=this.Ms.get(e);return r||(r=new jZe(this.ts,this,e),this.Ms.set(e,r)),[t,r]}ti(e){return e===this.Pt&&this.Ps.horzLine.visible}ii(){return this.Ps.vertLine.visible}Ws(e,t){this.ps&&this.Pt===e||this.vs.clear();const r=[];return this.Pt===e&&r.push(this.Hs(this.vs,t,this.ks)),r}cs(){return this.ps?[this.Ds]:[]}Us(){return this.Pt}Ns(){this.ts.$s().forEach(e=>{var t,r;(t=this.gs.get(e))==null||t.kt(),(r=this.Ms.get(e))==null||r.kt()}),this.vs.forEach(e=>e.kt()),this.Ds.kt()}qs(e){return e&&!e.ys().Ki()?e.ys():null}zs(e,t,r){this.Ys(e,t,r)&&this.Ns()}Ys(e,t,r){const i=this.bs,s=this.Ss,o=this.ds,a=this.fs,c=this.Pt,u=this.qs(r);this.fs=e,this.bs=isNaN(e)?NaN:this.ts.Et().qt(e),this.Pt=r;const d=u!==null?u.zt():null;return u!==null&&d!==null?(this.ds=t,this.Ss=u.Nt(t,d)):(this.ds=NaN,this.Ss=NaN),i!==this.bs||s!==this.Ss||a!==this.fs||o!==this.ds||c!==this.Pt}Os(){const e=this.ts.js().map(r=>r.Xs().Ks()).filter(kZe),t=e.length===0?null:Math.max(...e);this.fs=t!==null?t:NaN}Hs(e,t,r){let i=e.get(t);return i===void 0&&(i=new WZe(this,t,r),e.set(t,i)),i}}function nM(n){return n==="left"||n==="right"}class Zo{constructor(e){this.Zs=new Map,this.Gs=[],this.Js=e}Qs(e,t){const r=function(i,s){return i===void 0?s:{tn:Math.max(i.tn,s.tn),sn:i.sn||s.sn}}(this.Zs.get(e),t);this.Zs.set(e,r)}nn(){return this.Js}en(e){const t=this.Zs.get(e);return t===void 0?{tn:this.Js}:{tn:Math.max(this.Js,t.tn),sn:t.sn}}rn(){this.hn(),this.Gs=[{an:0}]}ln(e){this.hn(),this.Gs=[{an:1,Wt:e}]}_n(e){this.un(),this.Gs.push({an:5,Wt:e})}hn(){this.un(),this.Gs.push({an:6})}cn(){this.hn(),this.Gs=[{an:4}]}dn(e){this.hn(),this.Gs.push({an:2,Wt:e})}fn(e){this.hn(),this.Gs.push({an:3,Wt:e})}pn(){return this.Gs}vn(e){for(const t of e.Gs)this.mn(t);this.Js=Math.max(this.Js,e.Js),e.Zs.forEach((t,r)=>{this.Qs(r,t)})}static wn(){return new Zo(2)}static gn(){return new Zo(3)}mn(e){switch(e.an){case 0:this.rn();break;case 1:this.ln(e.Wt);break;case 2:this.dn(e.Wt);break;case 3:this.fn(e.Wt);break;case 4:this.cn();break;case 5:this._n(e.Wt);break;case 6:this.un()}}un(){const e=this.Gs.findIndex(t=>t.an===5);e!==-1&&this.Gs.splice(e,1)}}class Wce{formatTickmarks(e){return e.map(t=>this.format(t))}}const MQ=".";function ng(n,e){if(!Fx(n))return"n/a";if(!CC(e))throw new TypeError("invalid length");if(e<0||e>16)throw new TypeError("invalid length");return e===0?n.toString():("0000000000000000"+n.toString()).slice(-e)}class rM extends Wce{constructor(e,t){if(super(),t||(t=1),Fx(e)&&CC(e)||(e=100),e<0)throw new TypeError("invalid base");this.Yi=e,this.Mn=t,this.bn()}format(e){const t=e<0?"â":"";return e=Math.abs(e),t+this.Sn(e)}bn(){if(this.xn=0,this.Yi>0&&this.Mn>0){let e=this.Yi;for(;e>1;)e/=10,this.xn++}}Sn(e){const t=this.Yi/this.Mn;let r=Math.floor(e),i="";const s=this.xn!==void 0?this.xn:NaN;if(t>1){let o=+(Math.round(e*t)-r*t).toFixed(this.xn);o>=t&&(o-=t,r+=1),i=MQ+ng(+o.toFixed(this.xn)*this.Mn,s)}else r=Math.round(r*t)/t,s>0&&(i=MQ+ng(0,s));return r.toFixed(0)+i}}class Hce extends rM{constructor(e=100){super(e)}format(e){return`${super.format(e)}%`}}class KZe extends Wce{constructor(e){super(),this.Cn=e}format(e){let t="";return e<0&&(t="-",e=-e),e<995?t+this.Pn(e):e<999995?t+this.Pn(e/1e3)+"K":e<999999995?(e=1e3*Math.round(e/1e3),t+this.Pn(e/1e6)+"M"):(e=1e6*Math.round(e/1e6),t+this.Pn(e/1e9)+"B")}Pn(e){let t;const r=Math.pow(10,this.Cn);return t=(e=Math.round(e*r)/r)>=1e-15&&e<1?e.toFixed(this.Cn).replace(/\.?0+$/,""):String(e),t.replace(/(\.[1-9]*)0+$/,(i,s)=>s)}}const YZe=/[2-9]/g;class _8{constructor(e=50){this.kn=0,this.yn=1,this.Tn=1,this.Rn={},this.Dn=new Map,this.Vn=e}In(){this.kn=0,this.Dn.clear(),this.yn=1,this.Tn=1,this.Rn={}}Vi(e,t,r){return this.Bn(e,t,r).width}Di(e,t,r){const i=this.Bn(e,t,r);return((i.actualBoundingBoxAscent||0)-(i.actualBoundingBoxDescent||0))/2}Bn(e,t,r){const i=r||YZe,s=String(t).replace(i,"0");if(this.Dn.has(s))return ml(this.Dn.get(s)).En;if(this.kn===this.Vn){const a=this.Rn[this.Tn];delete this.Rn[this.Tn],this.Dn.delete(a),this.Tn++,this.kn--}e.save(),e.textBaseline="middle";const o=e.measureText(s);
8354return e.restore(),o.width===0&&t.length||(this.Dn.set(s,{En:o,An:this.yn}),this.Rn[this.yn]=s,this.kn++,this.yn++),o}}class GZe{constructor(e){this.zn=null,this.M=null,this.Ln="right",this.On=e}Nn(e,t,r){this.zn=e,this.M=t,this.Ln=r}nt(e){this.M!==null&&this.zn!==null&&this.zn.nt(e,this.M,this.On,this.Ln)}}class Vce{constructor(e,t,r){this.Fn=e,this.On=new _8(50),this.Wn=t,this.O=r,this.F=-1,this.Gt=new GZe(this.On)}Tt(){const e=this.O.Hn(this.Wn);if(e===null)return null;const t=e.Un(this.Wn)?e.$n():this.Wn.Ft();if(t===null)return null;const r=e.qn(t);if(r==="overlay")return null;const i=this.O.Yn();return i.P!==this.F&&(this.F=i.P,this.On.In()),this.Gt.Nn(this.Fn.$i(),i,r),this.Gt}}class ZZe extends R4{constructor(){super(...arguments),this.Yt=null}ht(e){this.Yt=e}jn(e,t){var o;if(!((o=this.Yt)!=null&&o.Vt))return null;const{ut:r,ct:i,Kn:s}=this.Yt;return t>=r-i-7&&t<=r+i+7?{Xn:this.Yt,Kn:s}:null}et({context:e,bitmapSize:t,horizontalPixelRatio:r,verticalPixelRatio:i}){if(this.Yt===null||this.Yt.Vt===!1)return;const s=Math.round(this.Yt.ut*i);s<0||s>t.height||(e.lineCap="butt",e.strokeStyle=this.Yt.R,e.lineWidth=Math.floor(this.Yt.ct*r),_C(e,this.Yt.Xt),$ce(e,s,0,t.width))}}class hz{constructor(e){this.Zn={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,Xt:0,Vt:!1},this.Gn=new ZZe,this.xt=!0,this.Jn=e,this.Qn=e.Qt(),this.Gn.ht(this.Zn)}kt(){this.xt=!0}Tt(){return this.Jn.Vt()?(this.xt&&(this.te(),this.xt=!1),this.Gn):null}}class QZe extends hz{constructor(e){super(e)}te(){this.Zn.Vt=!1;const e=this.Jn.Ft(),t=e.ie().ie;if(t!==2&&t!==3)return;const r=this.Jn.N();if(!r.baseLineVisible||!this.Jn.Vt())return;const i=this.Jn.zt();i!==null&&(this.Zn.Vt=!0,this.Zn.ut=e.Nt(i.Wt,i.Wt),this.Zn.R=r.baseLineColor,this.Zn.ct=r.baseLineWidth,this.Zn.Xt=r.baseLineStyle)}}class XZe extends R4{constructor(){super(...arguments),this.Yt=null}ht(e){this.Yt=e}se(){return this.Yt}et({context:e,horizontalPixelRatio:t,verticalPixelRatio:r}){const i=this.Yt;if(i===null)return;const s=Math.max(1,Math.floor(t)),o=s%2/2,a=Math.round(i.ne.x*t)+o,c=i.ne.y*r;e.fillStyle=i.ee,e.beginPath();const u=Math.max(2,1.5*i.re)*t;e.arc(a,c,u,0,2*Math.PI,!1),e.fill(),e.fillStyle=i.he,e.beginPath(),e.arc(a,c,i.ft*t,0,2*Math.PI,!1),e.fill(),e.lineWidth=s,e.strokeStyle=i.ae,e.beginPath(),e.arc(a,c,i.ft*t+s/2,0,2*Math.PI,!1),e.stroke()}}const JZe=[{le:0,oe:.25,_e:4,ue:10,ce:.25,de:0,fe:.4,pe:.8},{le:.25,oe:.525,_e:10,ue:14,ce:0,de:0,fe:.8,pe:0},{le:.525,oe:1,_e:14,ue:14,ce:0,de:0,fe:0,pe:0}];class eQe{constructor(e){this.Gt=new XZe,this.xt=!0,this.ve=!0,this.me=performance.now(),this.we=this.me-1,this.ge=e}Me(){this.we=this.me-1,this.kt()}be(){if(this.kt(),this.ge.N().lastPriceAnimation===2){const e=performance.now(),t=this.we-e;if(t>0)return void(t<650&&(this.we+=2600));this.me=e,this.we=e+2600}}kt(){this.xt=!0}Se(){this.ve=!0}Vt(){return this.ge.N().lastPriceAnimation!==0}xe(){switch(this.ge.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.we}}Tt(){return this.xt?(this.Rt(),this.xt=!1,this.ve=!1):this.ve&&(this.Ce(),this.ve=!1),this.Gt}Rt(){this.Gt.ht(null);const e=this.ge.Qt().Et(),t=e.Pe(),r=this.ge.zt();if(t===null||r===null)return;const i=this.ge.ke(!0);if(i.ye||!t.Te(i.Re))return;const s={x:e.qt(i.Re),y:this.ge.Ft().Nt(i.gt,r.Wt)},o=i.R,a=this.ge.N().lineWidth,c=this.De(this.Ve(),o);this.Gt.ht({ee:o,re:a,he:c.he,ae:c.ae,ft:c.ft,ne:s})}Ce(){const e=this.Gt.se();if(e!==null){const t=this.De(this.Ve(),e.ee);e.he=t.he,e.ae=t.ae,e.ft=t.ft}}Ve(){return this.xe()?performance.now()-this.me:2599}Ie(e,t,r,i){const s=r+(i-r)*t;return this.ge.Qt().Xi().j(e,s)}De(e,t){const r=e%2600/2600;let i;for(const u of JZe)if(r>=u.le&&r<=u.oe){i=u;break}oa(i!==void 0,"Last price animation internal logic error");const s=(r-i.le)/(i.oe-i.le);return{he:this.Ie(t,s,i.ce,i.de),ae:this.Ie(t,s,i.fe,i.pe),ft:(o=s,a=i._e,c=i.ue,a+(c-a)*o)};var o,a,c}}class tQe extends hz{constructor(e){super(e)}te(){const e=this.Zn;e.Vt=!1;const t=this.Jn.N();if(!t.priceLineVisible||!this.Jn.Vt())return;const r=this.Jn.ke(t.priceLineSource===0);r.ye||(e.Vt=!0,e.ut=r.Bi,e.R=this.Jn.Be(r.R),e.ct=t.priceLineWidth,e.Xt=t.priceLineStyle)}
8354}class nQe extends tM{constructor(e){super(),this.Jt=e}qi(e,t,r){e.Vt=!1,t.Vt=!1;const i=this.Jt;if(!i.Vt())return;const s=i.N(),o=s.lastValueVisible,a=i.Ee()!=="",c=s.seriesLastValueMode===0,u=i.ke(!1);if(u.ye)return;o&&(e.ri=this.Ae(u,o,c),e.Vt=e.ri.length!==0),(a||c)&&(t.ri=this.ze(u,o,a,c),t.Vt=t.ri.length>0);const d=i.Be(u.R),f=this.Jt.Qt().Xi().X(d);r.Z=f.Z,r.Bi=u.Bi,t.Ht=i.Qt().Ut(u.Bi/i.Ft().$t()),e.Ht=d,e.R=f.G,t.R=f.G}ze(e,t,r,i){let s="";const o=this.Jt.Ee();return r&&o.length!==0&&(s+=`${o} `),t&&i&&(s+=this.Jt.Ft().Le()?e.Oe:e.Ne),s.trim()}Ae(e,t,r){return t?r?this.Jt.Ft().Le()?e.Ne:e.Oe:e.ri:""}}function kQ(n,e,t,r){const i=Number.isFinite(e),s=Number.isFinite(t);return i&&s?n(e,t):i||s?i?e:t:r}class Ec{constructor(e,t){this.Fe=e,this.We=t}He(e){return e!==null&&this.Fe===e.Fe&&this.We===e.We}Ue(){return new Ec(this.Fe,this.We)}$e(){return this.Fe}qe(){return this.We}Ye(){return this.We-this.Fe}Ki(){return this.We===this.Fe||Number.isNaN(this.We)||Number.isNaN(this.Fe)}vn(e){return e===null?this:new Ec(kQ(Math.min,this.$e(),e.$e(),-1/0),kQ(Math.max,this.qe(),e.qe(),1/0))}je(e){if(!Fx(e)||this.We-this.Fe===0)return;const t=.5*(this.We+this.Fe);let r=this.We-t,i=this.Fe-t;r*=e,i*=e,this.We=t+r,this.Fe=t+i}Ke(e){Fx(e)&&(this.We+=e,this.Fe+=e)}Xe(){return{minValue:this.Fe,maxValue:this.We}}static Ze(e){return e===null?null:new Ec(e.minValue,e.maxValue)}}class C8{constructor(e,t){this.Ge=e,this.Je=t||null}Qe(){return this.Ge}tr(){return this.Je}Xe(){return{priceRange:this.Ge===null?null:this.Ge.Xe(),margins:this.Je||void 0}}static Ze(e){return e===null?null:new C8(Ec.Ze(e.priceRange),e.margins)}}class rQe extends hz{constructor(e,t){super(e),this.ir=t}te(){const e=this.Zn;e.Vt=!1;const t=this.ir.N();if(!this.Jn.Vt()||!t.lineVisible)return;const r=this.ir.sr();r!==null&&(e.Vt=!0,e.ut=r,e.R=t.color,e.ct=t.lineWidth,e.Xt=t.lineStyle,e.Kn=this.ir.N().id)}}class iQe extends tM{constructor(e,t){super(),this.ge=e,this.ir=t}qi(e,t,r){e.Vt=!1,t.Vt=!1;const i=this.ir.N(),s=i.axisLabelVisible,o=i.title!=="",a=this.ge;if(!s||!a.Vt())return;const c=this.ir.sr();if(c===null)return;o&&(t.ri=i.title,t.Vt=!0),t.Ht=a.Qt().Ut(c/a.Ft().$t()),e.ri=this.nr(i.price),e.Vt=!0;const u=this.ge.Qt().Xi().X(i.axisLabelColor||i.color);r.Z=u.Z;const d=i.axisLabelTextColor||u.G;e.R=d,t.R=d,r.Bi=c}nr(e){const t=this.ge.zt();return t===null?"":this.ge.Ft().Zi(e,t.Wt)}}class sQe{constructor(e,t){this.ge=e,this.Ps=t,this.er=new rQe(e,this),this.Fn=new iQe(e,this),this.rr=new Vce(this.Fn,e,e.Qt())}hr(e){tu(this.Ps,e),this.kt(),this.ge.Qt().ar()}N(){return this.Ps}lr(){return this.er}_r(){return this.rr}ur(){return this.Fn}kt(){this.er.kt(),this.Fn.kt()}sr(){const e=this.ge,t=e.Ft();if(e.Qt().Et().Ki()||t.Ki())return null;const r=e.zt();return r===null?null:t.Nt(this.Ps.price,r.Wt)}}class oQe extends Fce{constructor(e){super(),this.ts=e}Qt(){return this.ts}}const aQe={Bar:(n,e,t,r)=>{const i=e.upColor,s=e.downColor,o=Pt(n(t,r)),a=r0(o.Wt[0])<=r0(o.Wt[3]);return{cr:o.R??(a?i:s)}},Candlestick:(n,e,t,r)=>{const i=e.upColor,s=e.downColor,o=e.borderUpColor,a=e.borderDownColor,c=e.wickUpColor,u=e.wickDownColor,d=Pt(n(t,r)),f=r0(d.Wt[0])<=r0(d.Wt[3]);return{cr:d.R??(f?i:s),dr:d.Ht??(f?o:a),pr:d.vr??(f?c:u)}},Custom:(n,e,t,r)=>({cr:Pt(n(t,r)).R??e.color}),Area:(n,e,t,r)=>{const i=Pt(n(t,r));return{cr:i.vt??e.lineColor,vt:i.vt??e.lineColor,mr:i.mr??e.topColor,wr:i.wr??e.bottomColor}},Baseline:(n,e,t,r)=>{const i=Pt(n(t,r));return{cr:i.Wt[3]>=e.baseValue.price?e.topLineColor:e.bottomLineColor,gr:i.gr??e.topLineColor,Mr:i.Mr??e.bottomLineColor,br:i.br??e.topFillColor1,Sr:i.Sr??e.topFillColor2,Cr:i.Cr??e.bottomFillColor1,Pr:i.Pr??e.bottomFillColor2}},Line:(n,e,t,r)=>{const i=Pt(n(t,r));return{cr:i.R??e.color,vt:i.R??e.color}},Histogram:(n,e,t,r)=>({cr:Pt(n(t,r)).R??e.color})};class cQe{constructor(e){this.kr=(t,r)=>r!==void 0?r.Wt:this.ge.Xs().yr(t),this.ge=e,this.Tr=aQe[e.Rr()]}Dr(e,t){return this.Tr(this.kr,this.ge.N(),e,t)}}function qce(n,e,t,r,i=0,s=e.length){let o=s-i;for(;0<o;){const a=o>>1,c=i+a;r(e[c],t)===n?(i=c+1,o-=a+1):o=a}return i}const Wx=qce.bind(null,!0),Kce=qce.bind(null,!1);var OQ;(function(n){n[n.NearestLeft=-1]="NearestLeft",n[n.None=0]="None",n[n.NearestRight=1]="NearestRight"})(OQ||(OQ={}));const zm=30;class lQe{constructor(){this.Vr=[],this.Ir=new Map,this.Br=new Map,this.Er=[]}Ar(){return this.zr()>0?this.Vr[this.Vr.length-1]:null}Lr(){return this.zr()>0?this.Or(0):null}Ks(){return this.zr()>0?this.Or(this.Vr.length-1):null}zr(){return this.Vr.length}Ki(){return this.zr()===0}Te(e){return this.Nr(e,0)!==null}yr(e){return this.Fr(e)}Fr(e,t=0){const r=this.Nr(e,t);return r===null?null:{...this.Wr(r),Re:this.Or(r)}}Hr(){return this.Vr}Ur(e,t,r){if(this.Ki())return null;let i=null;for(const s of r)i=XI(i,this.$r(e,t,s));return i}ht(e){this.Br.clear(),this.Ir.clear(),this.Vr=e,this.Er=e.map(t=>t.Re)}qr(){return this.Er}Or(e){return this.Vr[e].Re}Wr(e){return this.Vr[e]}Nr(e,t){const r=this.Yr(e);if(r===null&&t!==0)switch(t){case-1:return this.jr(e);case 1:return this.Kr(e);default:throw new TypeError("Unknown search mode")}return r}jr(e){let t=this.Xr(e);return t>0&&(t-=1),t!==this.Vr.length&&this.Or(t)<e?t:null}Kr(e){const t=this.Zr(e);return t!==this.Vr.length&&e<this.Or(t)?t:null}Yr(e){const t=this.Xr(e);return t===this.Vr.length||e<this.Vr[t].Re?null:t}Xr(e){return Wx(this.Vr,e,(t,r)=>t.Re<r)}Zr(e){return Kce(this.Vr,e,(t,r)=>t.Re>r)}
8354Gr(e,t,r){let i=null;for(let s=e;s<t;s++){const o=this.Vr[s].Wt[r];Number.isNaN(o)||(i===null?i={Jr:o,Qr:o}:(o<i.Jr&&(i.Jr=o),o>i.Qr&&(i.Qr=o)))}return i}$r(e,t,r){if(this.Ki())return null;let i=null;const s=Pt(this.Lr()),o=Pt(this.Ks()),a=Math.max(e,s),c=Math.min(t,o),u=Math.ceil(a/zm)*zm,d=Math.max(u,Math.floor(c/zm)*zm);{const m=this.Xr(a),w=this.Zr(Math.min(c,u,t));i=XI(i,this.Gr(m,w,r))}let f=this.Ir.get(r);f===void 0&&(f=new Map,this.Ir.set(r,f));for(let m=Math.max(u+1,a);m<d;m+=zm){const w=Math.floor(m/zm);let y=f.get(w);if(y===void 0){const b=this.Xr(w*zm),E=this.Zr((w+1)*zm-1);y=this.Gr(b,E,r),f.set(w,y)}i=XI(i,y)}{const m=this.Xr(d),w=this.Zr(c);i=XI(i,this.Gr(m,w,r))}return i}}function XI(n,e){return n===null?e:e===null?n:{Jr:Math.min(n.Jr,e.Jr),Qr:Math.max(n.Qr,e.Qr)}}class uQe{constructor(e){this.th=e}nt(e,t,r){this.th.draw(e)}ih(e,t,r){var i,s;(s=(i=this.th).drawBackground)==null||s.call(i,e)}}class dQe{constructor(e){this.Dn=null,this.sh=e}Tt(){var r;const e=this.sh.renderer();if(e===null)return null;if(((r=this.Dn)==null?void 0:r.nh)===e)return this.Dn.eh;const t=new uQe(e);return this.Dn={nh:e,eh:t},t}rh(){var e,t;return((t=(e=this.sh).zOrder)==null?void 0:t.call(e))??"normal"}}class Yce{constructor(e){this.hh=null,this.ah=e}oh(){return this.ah}Ns(){var e,t;(t=(e=this.ah).updateAllViews)==null||t.call(e)}Fs(){var r,i,s;const e=((i=(r=this.ah).paneViews)==null?void 0:i.call(r))??[];if(((s=this.hh)==null?void 0:s.nh)===e)return this.hh.eh;const t=e.map(o=>new dQe(o));return this.hh={nh:e,eh:t},t}jn(e,t){var r,i;return((i=(r=this.ah).hitTest)==null?void 0:i.call(r,e,t))??null}}let hQe=class extends Yce{us(){return[]}};class fQe{constructor(e){this.th=e}nt(e,t,r){this.th.draw(e)}ih(e,t,r){var i,s;(s=(i=this.th).drawBackground)==null||s.call(i,e)}}class PQ{constructor(e){this.Dn=null,this.sh=e}Tt(){var r;const e=this.sh.renderer();if(e===null)return null;if(((r=this.Dn)==null?void 0:r.nh)===e)return this.Dn.eh;const t=new fQe(e);return this.Dn={nh:e,eh:t},t}rh(){var e,t;return((t=(e=this.sh).zOrder)==null?void 0:t.call(e))??"normal"}}function Gce(n){var e,t,r;return{ri:n.text(),Bi:n.coordinate(),Ii:(e=n.fixedCoordinate)==null?void 0:e.call(n),R:n.textColor(),Z:n.backColor(),Vt:((t=n.visible)==null?void 0:t.call(n))??!0,pi:((r=n.tickVisible)==null?void 0:r.call(n))??!0}}class pQe{constructor(e,t){this.Gt=new zce,this._h=e,this.uh=t}Tt(){return this.Gt.ht({Qi:this.uh.Qi(),...Gce(this._h)}),this.Gt}}class gQe extends tM{constructor(e,t){super(),this._h=e,this.Yi=t}qi(e,t,r){const i=Gce(this._h);r.Z=i.Z,e.R=i.R;const s=2/12*this.Yi.P();r.Ti=s,r.Ri=s,r.Bi=i.Bi,r.Ii=i.Ii,e.ri=i.ri,e.Vt=i.Vt,e.pi=i.pi}}class mQe extends Yce{constructor(e,t){super(e),this.dh=null,this.fh=null,this.ph=null,this.mh=null,this.ge=t}cs(){var i,s,o;const e=((s=(i=this.ah).timeAxisViews)==null?void 0:s.call(i))??[];if(((o=this.dh)==null?void 0:o.nh)===e)return this.dh.eh;const t=this.ge.Qt().Et(),r=e.map(a=>new pQe(a,t));return this.dh={nh:e,eh:r},r}Ws(){var i,s,o;const e=((s=(i=this.ah).priceAxisViews)==null?void 0:s.call(i))??[];if(((o=this.fh)==null?void 0:o.nh)===e)return this.fh.eh;const t=this.ge.Ft(),r=e.map(a=>new gQe(a,t));return this.fh={nh:e,eh:r},r}wh(){var r,i,s;const e=((i=(r=this.ah).priceAxisPaneViews)==null?void 0:i.call(r))??[];if(((s=this.ph)==null?void 0:s.nh)===e)return this.ph.eh;const t=e.map(o=>new PQ(o));return this.ph={nh:e,eh:t},t}gh(){var r,i,s;const e=((i=(r=this.ah).timeAxisPaneViews)==null?void 0:i.call(r))??[];if(((s=this.mh)==null?void 0:s.nh)===e)return this.mh.eh;const t=e.map(o=>new PQ(o));return this.mh={nh:e,eh:t},t}Mh(e,t){var r,i;return((i=(r=this.ah).autoscaleInfo)==null?void 0:i.call(r,e,t))??null}}function uD(n,e,t,r){n.forEach(i=>{e(i).forEach(s=>{s.rh()===t&&r.push(s)})})}function dD(n){return n.Fs()}function wQe(n){return n.wh()}function yQe(n){return n.gh()}const bQe=["Area","Line","Baseline"];class iM extends oQe{constructor(e,t,r,i,s){super(e),this.Yt=new lQe,this.er=new tQe(this),this.bh=[],this.Sh=new QZe(this),this.xh=null,this.Ch=null,this.Ph=null,this.kh=[],this.Ps=r,this.yh=t;const o=new nQe(this);this.vs=[o],this.rr=new Vce(o,this,e),bQe.includes(this.yh)&&(this.xh=new eQe(this)),this.Th(),this.sh=i(this,this.Qt(),s)}m(){this.Ph!==null&&clearTimeout(this.Ph)}Be(e){return this.Ps.priceLineColor||e}ke(e){const t={ye:!0},r=this.Ft();if(this.Qt().Et().Ki()||r.Ki()||this.Yt.Ki())return t;const i=this.Qt().Et().Pe(),s=this.zt();if(i===null||s===null)return t;let o,a;if(e){const f=this.Yt.Ar();if(f===null)return t;o=f,a=f.Re}else{const f=this.Yt.Fr(i.bi(),-1);if(f===null||(o=this.Yt.yr(f.Re),o===null))return t;a=f.Re}const c=o.Wt[3],u=this.Rh().Dr(a,{Wt:o}),d=r.Nt(c,s.Wt);return{ye:!1,gt:c,ri:r.Zi(c,s.Wt),Oe:r.Dh(c),Ne:r.Vh(c,s.Wt),R:u.cr,Bi:d,Re:a}}Rh(){return this.Ch!==null||(this.Ch=new cQe(this)),this.Ch}N(){return this.Ps}hr(e){const t=e.priceScaleId;t!==void 0&&t!==this.Ps.priceScaleId&&this.Qt().Ih(this,t),tu(this.Ps,e),e.priceFormat!==void 0&&(this.Th(),this.Qt().Bh()),this.Qt().Eh(this),this.Qt().Ah(),this.sh.kt("options")}ht(e,t){this.Yt.ht(e),this.sh.kt("data"),this.xh!==null&&(t&&t.zh?this.xh.be():e.length===0&&this.xh.Me());const r=this.Qt().Hn(this);this.Qt().Lh(r),this.Qt().Eh(this),this.Qt().Ah(),this.Qt().ar()}Oh(e){const t=new sQe(this,e);return this.bh.push(t),this.Qt().Eh(this),t}
8354Nh(e){const t=this.bh.indexOf(e);t!==-1&&this.bh.splice(t,1),this.Qt().Eh(this)}Fh(){return this.bh}Rr(){return this.yh}zt(){const e=this.Wh();return e===null?null:{Wt:e.Wt[3],Hh:e.wt}}Wh(){const e=this.Qt().Et().Pe();if(e===null)return null;const t=e.Uh();return this.Yt.Fr(t,1)}Xs(){return this.Yt}$h(e){const t=this.Yt.yr(e);return t===null?null:this.yh==="Bar"||this.yh==="Candlestick"||this.yh==="Custom"?{qh:t.Wt[0],Yh:t.Wt[1],jh:t.Wt[2],Kh:t.Wt[3]}:t.Wt[3]}Xh(e){const t=[];uD(this.kh,dD,"top",t);const r=this.xh;return r!==null&&r.Vt()&&(this.Ph===null&&r.xe()&&(this.Ph=setTimeout(()=>{this.Ph=null,this.Qt().Zh()},0)),r.Se(),t.unshift(r)),t}Fs(){const e=[];this.Gh()||e.push(this.Sh),e.push(this.sh,this.er);const t=this.bh.map(r=>r.lr());return e.push(...t),uD(this.kh,dD,"normal",e),e}Jh(){return this.Qh(dD,"bottom")}ta(e){return this.Qh(wQe,e)}ia(e){return this.Qh(yQe,e)}sa(e,t){return this.kh.map(r=>r.jn(e,t)).filter(r=>r!==null)}us(){return[this.rr,...this.bh.map(e=>e._r())]}Ws(e,t){if(t!==this.es&&!this.Gh())return[];const r=[...this.vs];for(const i of this.bh)r.push(i.ur());return this.kh.forEach(i=>{r.push(...i.Ws())}),r}cs(){const e=[];return this.kh.forEach(t=>{e.push(...t.cs())}),e}Mh(e,t){if(this.Ps.autoscaleInfoProvider!==void 0){const r=this.Ps.autoscaleInfoProvider(()=>{const i=this.na(e,t);return i===null?null:i.Xe()});return C8.Ze(r)}return this.na(e,t)}ea(){return this.Ps.priceFormat.minMove}ra(){return this.ha}Ns(){var e;this.sh.kt();for(const t of this.vs)t.kt();for(const t of this.bh)t.kt();this.er.kt(),this.Sh.kt(),(e=this.xh)==null||e.kt(),this.kh.forEach(t=>t.Ns())}Ft(){return Pt(super.Ft())}At(e){if(!((this.yh==="Line"||this.yh==="Area"||this.yh==="Baseline")&&this.Ps.crosshairMarkerVisible))return null;const t=this.Yt.yr(e);return t===null?null:{gt:t.Wt[3],ft:this.aa(),Ht:this.la(),Ot:this.oa(),Lt:this._a(e)}}Ee(){return this.Ps.title}Vt(){return this.Ps.visible}ua(e){this.kh.push(new mQe(e,this))}ca(e){this.kh=this.kh.filter(t=>t.oh()!==e)}da(){if(this.yh==="Custom")return e=>this.sh.fa(e)}pa(){if(this.yh==="Custom")return e=>this.sh.va(e)}ma(){return this.Yt.qr()}Gh(){return!nM(this.Ft().wa())}na(e,t){if(!CC(e)||!CC(t)||this.Yt.Ki())return null;const r=this.yh==="Line"||this.yh==="Area"||this.yh==="Baseline"||this.yh==="Histogram"?[3]:[2,1],i=this.Yt.Ur(e,t,r);let s=i!==null?new Ec(i.Jr,i.Qr):null,o=null;if(this.Rr()==="Histogram"){const a=this.Ps.base,c=new Ec(a,a);s=s!==null?s.vn(c):c}return this.kh.forEach(a=>{const c=a.Mh(e,t);if(c!=null&&c.priceRange){const u=new Ec(c.priceRange.minValue,c.priceRange.maxValue);s=s!==null?s.vn(u):u}c!=null&&c.margins&&(o=c.margins)}),new C8(s,o)}aa(){switch(this.yh){case"Line":case"Area":case"Baseline":return this.Ps.crosshairMarkerRadius}return 0}la(){switch(this.yh){case"Line":case"Area":case"Baseline":{const e=this.Ps.crosshairMarkerBorderColor;if(e.length!==0)return e}}return null}oa(){switch(this.yh){case"Line":case"Area":case"Baseline":return this.Ps.crosshairMarkerBorderWidth}return 0}_a(e){switch(this.yh){case"Line":case"Area":case"Baseline":{const t=this.Ps.crosshairMarkerBackgroundColor;if(t.length!==0)return t}}return this.Rh().Dr(e).cr}Th(){switch(this.Ps.priceFormat.type){case"custom":{const e=this.Ps.priceFormat.formatter;this.ha={format:e,formatTickmarks:this.Ps.priceFormat.tickmarksFormatter??(t=>t.map(e))};break}case"volume":this.ha=new KZe(this.Ps.priceFormat.precision);break;case"percent":this.ha=new Hce(this.Ps.priceFormat.precision);break;default:{const e=Math.pow(10,this.Ps.priceFormat.precision);this.ha=new rM(e,this.Ps.priceFormat.minMove*e)}}this.es!==null&&this.es.ga()}Qh(e,t){const r=[];return uD(this.kh,e,t,r),r}}const vQe=[3],xQe=[0,1,2,3];class EQe{constructor(e){this.Ps=e}Ma(e,t,r){let i=e;if(this.Ps.mode===0)return i;const s=r.ys(),o=s.zt();if(o===null)return i;const a=s.Nt(e,o),c=r.ba().filter(d=>d instanceof iM).reduce((d,f)=>{if(r.Un(f)||!f.Vt())return d;const m=f.Ft(),w=f.Xs();if(m.Ki()||!w.Te(t))return d;const y=w.yr(t);if(y===null)return d;const b=r0(f.zt()),E=this.Ps.mode===3?xQe:vQe;return d.concat(E.map(T=>m.Nt(y.Wt[T],b.Wt)))},[]);if(c.length===0)return i;c.sort((d,f)=>
vendor: 2,902 bytes, line 8354
8354Math.abs(d-a)-Math.abs(f-a));const u=c[0];return i=s.Ts(u,o),i}}function VS(n,e,t){return Math.min(Math.max(n,e),t)}function JI(n,e,t){return e-n<=t}class AQe extends R4{constructor(){super(...arguments),this.Yt=null}ht(e){this.Yt=e}et({context:e,bitmapSize:t,horizontalPixelRatio:r,verticalPixelRatio:i}){if(this.Yt===null)return;const s=Math.max(1,Math.floor(r));e.lineWidth=s,function(o,a){o.save(),o.lineWidth%2&&o.translate(.5,.5),a(),o.restore()}(e,()=>{const o=Pt(this.Yt);if(o.Sa){e.strokeStyle=o.xa,_C(e,o.Ca),e.beginPath();for(const a of o.Pa){const c=Math.round(a.ka*r);e.moveTo(c,-s),e.lineTo(c,t.height+s)}e.stroke()}if(o.ya){e.strokeStyle=o.Ta,_C(e,o.Ra),e.beginPath();for(const a of o.Da){const c=Math.round(a.ka*i);e.moveTo(-s,c),e.lineTo(t.width+s,c)}e.stroke()}})}}class SQe{constructor(e){this.Gt=new AQe,this.xt=!0,this.Pt=e}kt(){this.xt=!0}Tt(){if(this.xt){const e=this.Pt.Qt().N().grid,t={ya:e.horzLines.visible,Sa:e.vertLines.visible,Ta:e.horzLines.color,xa:e.vertLines.color,Ra:e.horzLines.style,Ca:e.vertLines.style,Da:this.Pt.ys().Va(),Pa:(this.Pt.Qt().Et().Va()||[]).map(r=>({ka:r.coord}))};this.Gt.ht(t),this.xt=!1}return this.Gt}}class _Qe{constructor(e){this.sh=new SQe(e)}lr(){return this.sh}}const hD={Ia:4,Ba:1e-4};function j2(n,e){const t=100*(n-e)/e;return e<0?-t:t}function CQe(n,e){const t=j2(n.$e(),e),r=j2(n.qe(),e);return new Ec(t,r)}function qS(n,e){const t=100*(n-e)/e+100;return e<0?-t:t}function TQe(n,e){const t=qS(n.$e(),e),r=qS(n.qe(),e);return new Ec(t,r)}function T8(n,e){const t=Math.abs(n);if(t<1e-15)return 0;const r=Math.log10(t+e.Ba)+e.Ia;return n<0?-r:r}function KS(n,e){const t=Math.abs(n);if(t<1e-15)return 0;const r=Math.pow(10,t-e.Ia)-e.Ba;return n<0?-r:r}function KA(n,e){if(n===null)return null;const t=T8(n.$e(),e),r=T8(n.qe(),e);return new Ec(t,r)}function cS(n,e){if(n===null)return null;const t=KS(n.$e(),e),r=KS(n.qe(),e);return new Ec(t,r)}function fD(n){if(n===null)return hD;const e=Math.abs(n.qe()-n.$e());if(e>=1||e<1e-15)return hD;const t=Math.ceil(Math.abs(Math.log10(e))),r=hD.Ia+t;return{Ia:r,Ba:1/Math.pow(10,r)}}class pD{constructor(e,t){if(this.Ea=e,this.Aa=t,function(r){if(r<0)return!1;for(let i=r;i>1;i/=10)if(i%10!=0)return!1;return!0}(this.Ea))this.za=[2,2.5,2];else{this.za=[];for(let r=this.Ea;r!==1;){if(r%2==0)this.za.push(2),r/=2;else{if(r%5!=0)throw new Error("unexpected base");this.za.push(2,2.5),r/=5}if(this.za.length>100)throw new Error("something wrong with base")}}}La(e,t,r){const i=this.Ea===0?0:1/this.Ea;let s=Math.pow(10,Math.max(0,Math.ceil(Math.log10(e-t)))),o=0,a=this.Aa[0];for(;;){const f=JI(s,i,1e-14)&&s>i+1e-14,m=JI(s,r*a,1e-14),w=JI(s,1,1e-14);if(!(f&&m&&w))break;s/=a,a=this.Aa[++o%this.Aa.length]}if(s<=i+1e-14&&(s=i),s=Math.max(1,s),this.za.length>0&&(c=s,u=1,d=1e-14,Math.abs(c-u)<d))for(o=0,a=this.za[0];JI(s,r*a,1e-14)&&s>i+1e-14;)s/=a,a=this.za[++o%this.za.length];var c,u,d;return s}}
8354class DQ{constructor(e,t,r,i){this.Oa=[],this.Yi=e,this.Ea=t,this.Na=r,this.Fa=i}La(e,t){if(e<t)throw new Error("high < low");const r=this.Yi.$t(),i=(e-t)*this.Wa()/r,s=new pD(this.Ea,[2,2.5,2]),o=new pD(this.Ea,[2,2,2.5]),a=new pD(this.Ea,[2.5,2,2]),c=[];return c.push(s.La(e,t,i),o.La(e,t,i),a.La(e,t,i)),function(u){if(u.length<1)throw Error("array is empty");let d=u[0];for(let f=1;f<u.length;++f)u[f]<d&&(d=u[f]);return d}(c)}Ha(){const e=this.Yi,t=e.zt();if(t===null)return void(this.Oa=[]);const r=e.$t(),i=this.Na(r-1,t),s=this.Na(0,t),o=this.Yi.N().entireTextOnly?this.Ua()/2:0,a=o,c=r-1-o,u=Math.max(i,s),d=Math.min(i,s);if(u===d)return void(this.Oa=[]);const f=this.La(u,d);if(this.$a(t,f,u,d,a,c),e.qa()&&this.Ya(f,d,u)){const y=this.Yi.ja();this.Ka(t,f,a,c,y,2*y)}const m=this.Oa.map(y=>y.Xa),w=this.Yi.Za(m);for(let y=0;y<this.Oa.length;y++)this.Oa[y].Ga=w[y]}Va(){return this.Oa}Ua(){return this.Yi.P()}Wa(){return Math.ceil(2.5*this.Ua())}$a(e,t,r,i,s,o){const a=this.Oa,c=this.Yi;let u=r%t;u+=u<0?t:0;const d=r>=i?1:-1;let f=null,m=0;for(let w=r-u;w>i;w-=t){const y=this.Fa(w,e,!0);f!==null&&Math.abs(y-f)<this.Wa()||y<s||y>o||(m<a.length?(a[m].ka=y,a[m].Ga=c.Ja(w),a[m].Xa=w):a.push({ka:y,Ga:c.Ja(w),Xa:w}),m++,f=y,c.Qa()&&(t=this.La(w*d,i)))}a.length=m}Ka(e,t,r,i,s,o){const a=this.Oa,c=this.tl(e,r,s,o),u=this.tl(e,i,-o,-s),d=this.Fa(0,e,!0)-this.Fa(t,e,!0);a.length>0&&a[0].ka-c.ka<d/2&&a.shift(),a.length>0&&u.ka-a[a.length-1].ka<d/2&&a.pop(),a.unshift(c),a.push(u)}tl(e,t,r,i){const s=(r+i)/2,o=this.Na(t+r,e),a=this.Na(t+i,e),c=Math.min(o,a),u=Math.max(o,a),d=Math.max(.1,this.La(u,c)),f=this.Na(t+s,e),m=f-f%d,w=this.Fa(m,e,!0);return{Ga:this.Yi.Ja(m),ka:w,Xa:m}}Ya(e,t,r){let i=r0(this.Yi.Qe());return this.Yi.Qa()&&(i=cS(i,this.Yi.il())),i.$e()-t<e&&r-i.qe()<e}}function Zce(n){return n.slice().sort((e,t)=>Pt(e.hs())-Pt(t.hs()))}var BQ;(function(n){n[n.Normal=0]="Normal",n[n.Logarithmic=1]="Logarithmic",n[n.Percentage=2]="Percentage",n[n.IndexedTo100=3]="IndexedTo100"})(BQ||(BQ={}));const LQ=new Hce,$Q=new rM(100,1);class IQe{constructor(e,t,r,i,s){this.sl=0,this.nl=null,this.Ge=null,this.el=null,this.rl={hl:!1,al:null},this.ll=!1,this.ol=0,this._l=0,this.ul=new Zs,this.cl=new Zs,this.dl=[],this.fl=null,this.pl=null,this.vl=null,this.ml=null,this.wl=null,this.ha=$Q,this.gl=fD(null),this.Ml=e,this.Ps=t,this.bl=r,this.Sl=i,this.xl=s,this.Cl=new DQ(this,100,this.Pl.bind(this),this.kl.bind(this))}wa(){return this.Ml}N(){return this.Ps}hr(e){if(tu(this.Ps,e),this.ga(),e.mode!==void 0&&this.yl({ie:e.mode}),e.scaleMargins!==void 0){const t=ml(e.scaleMargins.top),r=ml(e.scaleMargins.bottom);if(t<0||t>1)throw new Error(`Invalid top margin - expect value between 0 and 1, given=${t}`);if(r<0||r>1)throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${r}`);if(t+r>1)throw new Error(`Invalid margins - sum of margins must be less than 1, given=${t+r}`);this.Tl(),this.vl=null}}Rl(){return this.Ps.autoScale}Dl(){return this.ll}Qa(){return this.Ps.mode===1}Le(){return this.Ps.mode===2}Vl(){return this.Ps.mode===3}il(){return this.gl}ie(){return{sn:this.Ps.autoScale,Il:this.Ps.invertScale,ie:this.Ps.mode}}yl(e){const t=this.ie();let r=null;e.sn!==void 0&&(this.Ps.autoScale=e.sn),e.ie!==void 0&&(this.Ps.mode=e.ie,e.ie!==2&&e.ie!==3||(this.Ps.autoScale=!0),this.rl.hl=!1),t.ie===1&&e.ie!==t.ie&&(function(s,o){if(s===null)return!1;const a=KS(s.$e(),o),c=KS(s.qe(),o);return isFinite(a)&&isFinite(c)}(this.Ge,this.gl)?(r=cS(this.Ge,this.gl),r!==null&&this.Bl(r)):this.Ps.autoScale=!0),e.ie===1&&e.ie!==t.ie&&(r=KA(this.Ge,this.gl),r!==null&&this.Bl(r));const i=t.ie!==this.Ps.mode;i&&(t.ie===2||this.Le())&&this.ga(),i&&(t.ie===3||this.Vl())&&this.ga(),e.Il!==void 0&&t.Il!==e.Il&&(this.Ps.invertScale=e.Il,this.El()),this.cl.p(t,this.ie())}Al(){return this.cl}P(){return this.bl.fontSize}$t(){return this.sl}zl(e){this.sl!==e&&(this.sl=e,this.Tl(),this.vl=null)}Ll(){if(this.nl)return this.nl;const e=this.$t()-this.Ol()-this.Nl();return this.nl=e,e}Qe(){return this.Fl(),this.Ge}Bl(e,t){const r=this.Ge;(t||r===null&&e!==null||r!==null&&!r.He(e))&&(this.vl=null,this.Ge=e)}Wl(e){this.Bl(e),this.Hl(e!==null)}Ki(){return this.Fl(),this.sl===0||!this.Ge||this.Ge.Ki()}Ul(e){return this.Il()?e:this.$t()-1-e}Nt(e,t){return this.Le()?e=j2(e,t):this.Vl()&&(e=qS(e,t)),this.kl(e,t)}$l(e,t,r){this.Fl();const i=this.Nl(),s=Pt(this.Qe()),o=s.$e(),a=s.qe(),c=this.Ll()-1,u=this.Il(),d=c/(a-o),f=r===void 0?0:r.from,m=r===void 0?e.length:r.to,w=this.ql();for(let y=f;y<m;y++){const b=e[y],E=b.gt;if(isNaN(E))continue;let T=E;w!==null&&(T=w(b.gt,t));const N=i+d*(T-o),I=u?N:this.sl-1-N;b.ut=I}}Yl(e,t,r){this.Fl();const i=this.Nl(),s=Pt(this.Qe()),o=s.$e(),a=s.qe(),c=this.Ll()-1,u=this.Il(),d=c/(a-o),f=r===void 0?0:r.from,m=r===void 0?e.length:r.to,w=this.ql();for(let y=f;y<m;y++){const b=e[y];let E=b.qh,T=b.Yh,N=b.jh,I=b.Kh;w!==null&&(E=w(b.qh,t),T=w(b.Yh,t),N=w(b.jh,t),I=w(b.Kh,t));let H=i+d*(E-o),L=u?H:this.sl-1-H;b.jl=L,H=i+d*(T-o),L=u?H:this.sl-1-H,b.Kl=L,H=i+d*(N-o),L=u?H:this.sl-1-H,b.Xl=L,H=i+d*(I-o),L=u?H:this.sl-1-H,b.Zl=L}}Ts(e,t){const r=this.Pl(e,t);return this.Gl(r,t)}Gl(e,t){let r=e;return this.Le()?r=function(i,s){return s<0&&(i=-i),i/100*s+s}(r,t):this.Vl()&&(r=function(i,s){return i-=100,s<0&&(i=-i),i/100*s+s}(r,t)),r}ba(){return this.dl}Dt(){return this.pl||(this.pl=Zce(this.dl)),this.pl}Jl(e){this.dl.indexOf(e)===-1&&(this.dl.push(e),this.ga(),this.Ql())}io(e){const t=this.dl.indexOf(e);if(t===-1)throw new Error("source is not attached to scale");this.dl.splice(t,1),this.dl.length===0&&(this.yl({sn:!0}),this.Bl(null)),this.ga(),this.Ql()}zt(){let e=null;for(const t of this.dl){const r=t.zt();r!==null&&(e===null||r.Hh<e.Hh)&&(e=r)}return e===null?null:e.Wt}Il(){return this.Ps.invertScale}Va(){const e=this.zt()===null;if(this.vl!==null&&(e||this.vl.so===e))return this.vl.Va;this.Cl.Ha();const t=this.Cl.Va();return this.vl={Va:t,so:e},this.ul.p(),t}no(){return this.ul}eo(e){this.Le()||this.Vl()||this.ml===null&&this.el===null&&(this.Ki()||(this.ml=this.sl-e,this.el=Pt(this.Qe()).Ue()))}ro(e){if(this.Le()||this.Vl()||this.ml===null)return;this.yl({sn:!1}),(e=this.sl-e)<0&&(e=0);let t=(this.ml+.2*(this.sl-1))/(e+.2*(this.sl-1));const r=Pt(this.el).Ue();
8354t=Math.max(t,.1),r.je(t),this.Bl(r)}ho(){this.Le()||this.Vl()||(this.ml=null,this.el=null)}ao(e){this.Rl()||this.wl===null&&this.el===null&&(this.Ki()||(this.wl=e,this.el=Pt(this.Qe()).Ue()))}lo(e){if(this.Rl()||this.wl===null)return;const t=Pt(this.Qe()).Ye()/(this.Ll()-1);let r=e-this.wl;this.Il()&&(r*=-1);const i=r*t,s=Pt(this.el).Ue();s.Ke(i),this.Bl(s,!0),this.vl=null}oo(){this.Rl()||this.wl!==null&&(this.wl=null,this.el=null)}ra(){return this.ha||this.ga(),this.ha}Zi(e,t){switch(this.Ps.mode){case 2:return this._o(j2(e,t));case 3:return this.ra().format(qS(e,t));default:return this.nr(e)}}Ja(e){switch(this.Ps.mode){case 2:return this._o(e);case 3:return this.ra().format(e);default:return this.nr(e)}}Za(e){switch(this.Ps.mode){case 2:return this.uo(e);case 3:return this.ra().formatTickmarks(e);default:return this.co(e)}}Dh(e){return this.nr(e,Pt(this.fl).ra())}Vh(e,t){return e=j2(e,t),this._o(e,LQ)}do(){return this.dl}fo(e){this.rl={al:e,hl:!1}}Ns(){this.dl.forEach(e=>e.Ns())}qa(){return this.Ps.ensureEdgeTickMarksVisible&&this.Rl()}ja(){return this.P()/2}ga(){this.vl=null;let e=1/0;this.fl=null;for(const r of this.dl)r.hs()<e&&(e=r.hs(),this.fl=r);let t=100;this.fl!==null&&(t=Math.round(1/this.fl.ea())),this.ha=$Q,this.Le()?(this.ha=LQ,t=100):this.Vl()?(this.ha=new rM(100,1),t=100):this.fl!==null&&(this.ha=this.fl.ra()),this.Cl=new DQ(this,t,this.Pl.bind(this),this.kl.bind(this)),this.Cl.Ha()}Ql(){this.pl=null}Xi(){return this.xl}Hl(e){this.ll=e}Ol(){return this.Il()?this.Ps.scaleMargins.bottom*this.$t()+this._l:this.Ps.scaleMargins.top*this.$t()+this.ol}Nl(){return this.Il()?this.Ps.scaleMargins.top*this.$t()+this.ol:this.Ps.scaleMargins.bottom*this.$t()+this._l}Fl(){this.rl.hl||(this.rl.hl=!0,this.po())}Tl(){this.nl=null}kl(e,t){if(this.Fl(),this.Ki())return 0;e=this.Qa()&&e?T8(e,this.gl):e;const r=Pt(this.Qe()),i=this.Nl()+(this.Ll()-1)*(e-r.$e())/r.Ye();return this.Ul(i)}Pl(e,t){if(this.Fl(),this.Ki())return 0;const r=this.Ul(e),i=Pt(this.Qe()),s=i.$e()+i.Ye()*((r-this.Nl())/(this.Ll()-1));return this.Qa()?KS(s,this.gl):s}El(){this.vl=null,this.Cl.Ha()}po(){if(this.Dl()&&!this.Rl())return;const e=this.rl.al;if(e===null)return;let t=null;const r=this.do();let i=0,s=0;for(const c of r){if(!c.Vt())continue;const u=c.zt();if(u===null)continue;const d=c.Mh(e.Uh(),e.bi());let f=d&&d.Qe();if(f!==null){switch(this.Ps.mode){case 1:f=KA(f,this.gl);break;case 2:f=CQe(f,u.Wt);break;case 3:f=TQe(f,u.Wt)}if(t=t===null?f:t.vn(Pt(f)),d!==null){const m=d.tr();m!==null&&(i=Math.max(i,m.above),s=Math.max(s,m.below))}}}if(this.qa()&&(i=Math.max(i,this.ja()),s=Math.max(s,this.ja())),i===this.ol&&s===this._l||(this.ol=i,this._l=s,this.vl=null,this.Tl()),t!==null){if(t.$e()===t.qe()){const c=this.fl,u=5*(c===null||this.Le()||this.Vl()?1:c.ea());this.Qa()&&(t=cS(t,this.gl)),t=new Ec(t.$e()-u,t.qe()+u),this.Qa()&&(t=KA(t,this.gl))}if(this.Qa()){const c=cS(t,this.gl),u=fD(c);if(o=u,a=this.gl,o.Ia!==a.Ia||o.Ba!==a.Ba){const d=this.el!==null?cS(this.el,this.gl):null;this.gl=u,t=KA(c,u),d!==null&&(this.el=KA(d,u))}}this.Bl(t)}else this.Ge===null&&(this.Bl(new Ec(-.5,.5)),this.gl=fD(null));var o,a}ql(){return this.Le()?j2:this.Vl()?qS:this.Qa()?e=>T8(e,this.gl):null}vo(e,t,r){return t===void 0?(r===void 0&&(r=this.ra()),r.format(e)):t(e)}mo(e,t,r){return t===void 0?(r===void 0&&(r=this.ra()),r.formatTickmarks(e)):t(e)}nr(e,t){return this.vo(e,this.Sl.priceFormatter,t)}co(e,t){const r=this.Sl.priceFormatter;return this.mo(e,this.Sl.tickmarksPriceFormatter??(r?i=>i.map(r):void 0),t)}_o(e,t){return this.vo(e,this.Sl.percentageFormatter,t)}uo(e,t){const r=this.Sl.percentageFormatter;return this.mo(e,this.Sl.tickmarksPercentageFormatter??(r?i=>i.map(r):void 0),t)}}function UQ(n){return n instanceof iM}class jQ{constructor(e,t){this.dl=[],this.wo=new Map,this.sl=0,this.Mo=0,this.bo=1,this.pl=null,this.So=!1,this.xo=new Zs,this.kh=[],this.uh=e,this.ts=t,this.Co=new _Qe(this);const r=t.N();this.Po=this.ko("left",r.leftPriceScale),this.yo=this.ko("right",r.rightPriceScale),this.Po.Al().i(this.To.bind(this,this.Po),this),this.yo.Al().i(this.To.bind(this,this.yo),this),this.Ro(r)}Ro(e){if(e.leftPriceScale&&this.Po.hr(e.leftPriceScale),e.rightPriceScale&&this.yo.hr(e.rightPriceScale),e.localization&&(this.Po.ga(),this.yo.ga()),e.overlayPriceScales){const t=Array.from(this.wo.values());for(const r of t){const i=Pt(r[0].Ft());i.hr(e.overlayPriceScales),e.localization&&i.ga()}}}Do(e){switch(e){case"left":return this.Po;case"right":return this.yo}return this.wo.has(e)?ml(this.wo.get(e))[0].Ft():null}m(){this.Qt().Vo().u(this),this.Po.Al().u(this),this.yo.Al().u(this),this.dl.forEach(e
8354=>{e.m&&e.m()}),this.kh=this.kh.filter(e=>{const t=e.oh();return t.detached&&t.detached(),!1}),this.xo.p()}Io(){return this.bo}Bo(e){this.bo=e}Qt(){return this.ts}Qi(){return this.Mo}$t(){return this.sl}Eo(e){this.Mo=e,this.Ao()}zl(e){this.sl=e,this.Po.zl(e),this.yo.zl(e),this.dl.forEach(t=>{if(this.Un(t)){const r=t.Ft();r!==null&&r.zl(e)}}),this.Ao()}zo(e){this.So=e}Lo(){return this.So}Oo(){return this.dl.filter(UQ)}ba(){return this.dl}Un(e){const t=e.Ft();return t===null||this.Po!==t&&this.yo!==t}Jl(e,t,r){this.No(e,t,r?e.hs():this.dl.length)}io(e,t){const r=this.dl.indexOf(e);oa(r!==-1,"removeDataSource: invalid data source"),this.dl.splice(r,1),t||this.dl.forEach((o,a)=>o.ls(a));const i=Pt(e.Ft()).wa();if(this.wo.has(i)){const o=ml(this.wo.get(i)),a=o.indexOf(e);a!==-1&&(o.splice(a,1),o.length===0&&this.wo.delete(i))}const s=e.Ft();s&&s.ba().indexOf(e)>=0&&(s.io(e),this.Fo(s)),this.pl=null}qn(e){return e===this.Po?"left":e===this.yo?"right":"overlay"}Wo(){return this.Po}Ho(){return this.yo}Uo(e,t){e.eo(t)}$o(e,t){e.ro(t),this.Ao()}qo(e){e.ho()}Yo(e,t){e.ao(t)}jo(e,t){e.lo(t),this.Ao()}Ko(e){e.oo()}Ao(){this.dl.forEach(e=>{e.Ns()})}ys(){let e=null;return this.ts.N().rightPriceScale.visible&&this.yo.ba().length!==0?e=this.yo:this.ts.N().leftPriceScale.visible&&this.Po.ba().length!==0?e=this.Po:this.dl.length!==0&&(e=this.dl[0].Ft()),e===null&&(e=this.yo),e}$n(){let e=null;return this.ts.N().rightPriceScale.visible?e=this.yo:this.ts.N().leftPriceScale.visible&&(e=this.Po),e}Fo(e){e!==null&&e.Rl()&&this.Xo(e)}Zo(e){const t=this.uh.Pe();e.yl({sn:!0}),t!==null&&e.fo(t),this.Ao()}Go(){this.Xo(this.Po),this.Xo(this.yo)}Jo(){this.Fo(this.Po),this.Fo(this.yo),this.dl.forEach(e=>{this.Un(e)&&this.Fo(e.Ft())}),this.Ao(),this.ts.ar()}Dt(){return this.pl===null&&(this.pl=Zce(this.dl)),this.pl}Qo(e,t){t=VS(t,0,this.dl.length-1);const r=this.dl.indexOf(e);oa(r!==-1,"setSeriesOrder: invalid data source"),this.dl.splice(r,1),this.dl.splice(t,0,e),this.dl.forEach((i,s)=>i.ls(s)),this.pl=null;for(const i of[this.Po,this.yo])i.Ql(),i.ga();this.ts.ar()}It(){return this.Dt().filter(UQ)}t_(){return this.xo}i_(){return this.Co}ua(e){this.kh.push(new hQe(e))}ca(e){this.kh=this.kh.filter(t=>t.oh()!==e),e.detached&&e.detached(),this.ts.ar()}s_(){return this.kh}sa(e,t){return this.kh.map(r=>r.jn(e,t)).filter(r=>r!==null)}Xo(e){const t=e.do();if(t&&t.length>0&&!this.uh.Ki()){const r=this.uh.Pe();r!==null&&e.fo(r)}e.Ns()}No(e,t,r){let i=this.Do(t);if(i===null&&(i=this.ko(t,this.ts.N().overlayPriceScales)),this.dl.splice(r,0,e),!nM(t)){const s=this.wo.get(t)||[];s.push(e),this.wo.set(t,s)}e.ls(r),i.Jl(e),e._s(i),this.Fo(i),this.pl=null}To(e,t,r){t.ie!==r.ie&&this.Xo(e)}ko(e,t){const r={visible:!0,autoScale:!0,...tg(t)},i=new IQe(e,r,this.ts.N().layout,this.ts.N().localization,this.ts.Xi());return i.zl(this.$t()),i}}function e6(n){return{n_:n.n_,e_:{Kn:n.r_.externalId},h_:n.r_.cursorStyle}}function NQe(n,e,t,r){for(const i of n){const s=i.Tt(r);if(s!==null&&s.jn){const o=s.jn(e,t);if(o!==null)return{a_:i,e_:o}}}return null}function RQe(n){return n.Fs!==void 0}function Qce(n,e,t){const r=[n,...n.Dt()],i=function(s,o,a){var m;let c,u;for(const w of s){const y=((m=w.sa)==null?void 0:m.call(w,o,a))??[];for(const b of y)d=b.zOrder,f=c==null?void 0:c.zOrder,(!f||d==="top"&&f!=="top"||d==="normal"&&f==="bottom")&&(c=b,u=w)}var d,f;return c&&u?{r_:c,n_:u}:null}(r,e,t);if((i==null?void 0:i.r_.zOrder)==="top")return e6(i);for(const s of r){if(i&&i.n_===s&&i.r_.zOrder!=="bottom"&&!i.r_.isBackground)return e6(i);if(RQe(s)){const o=NQe(s.Fs(n),e,t,n);if(o!==null)return{n_:s,a_:o.a_,e_:o.e_}}if(i&&i.n_===s&&i.r_.zOrder!=="bottom"&&i.r_.isBackground)return e6(i)}return i!=null&&i.r_?e6(i):null}class MQe{constructor(e,t,r=50){this.kn=0,this.yn=1,this.Tn=1,this.Dn=new Map,this.Rn=new Map,this.l_=e,this.o_=t,this.Vn=r}__(e){const t=e.time,r=this.o_.cacheKey(t),i=this.Dn.get(r);if(i!==void 0)return i.u_;if(this.kn===this.Vn){const o=this.Rn.get(this.Tn);this.Rn.delete(this.Tn),this.Dn.delete(ml(o)),this.Tn++,this.kn--}const s=this.l_(e);return this.Dn.set(r,{u_:s,An:this.yn}),this.Rn.set(this.yn,r),this.kn++,this.yn++,s}}class YS{constructor(e,t){oa(e<=t,"right should be >= left"),this.c_=e,this.d_=t}Uh(){return this.c_}bi(){return this.d_}f_(){return this.d_-this.c_+1}Te(e){return this.c_<=e&&e<=this.d_}He(e){return this.c_===e.Uh()&&this.d_===e.bi()}}function zQ(n,e){return n===null||e===null?n===e:n.He(e)}class kQe{constructor(){this.p_=new Map,this.Dn=null,this.v_=!1}m_(e){this.v_=e,this.Dn=null}w_(e,t){this.g_(t),this.Dn=null;for(let r=t;r<e.length;++r){const i=e[r];let s=this.p_.get(i.timeWeight);s===void 0&&(s=[],this.p_.set(i.timeWeight,s)),s.push({index:r,t
8354ime:i.time,weight:i.timeWeight,originalTime:i.originalTime})}}M_(e,t,r,i,s){const o=Math.ceil(t/e);return this.Dn!==null&&this.Dn.b_===o&&s===this.Dn.S_&&r===this.Dn.x_||(this.Dn={S_:s,x_:r,Va:this.C_(o,r,i),b_:o}),this.Dn.Va}g_(e){if(e===0)return void this.p_.clear();const t=[];this.p_.forEach((r,i)=>{e<=r[0].index?t.push(i):r.splice(Wx(r,e,s=>s.index<e),1/0)});for(const r of t)this.p_.delete(r)}C_(e,t,r){let i=[];const s=o=>!t||r.has(o.index);for(const o of Array.from(this.p_.keys()).sort((a,c)=>c-a)){if(!this.p_.get(o))continue;const a=i;i=[];const c=a.length;let u=0;const d=ml(this.p_.get(o)),f=d.length;let m=1/0,w=-1/0;for(let y=0;y<f;y++){const b=d[y],E=b.index;for(;u<c;){const T=a[u],N=T.index;if(!(N<E&&s(T))){m=N;break}u++,i.push(T),w=N,m=1/0}if(m-E>=e&&E-w>=e&&s(b))i.push(b),w=E;else if(this.v_)return a}for(;u<c;u++)s(a[u])&&i.push(a[u])}return i}}class ix{constructor(e){this.P_=e}k_(){return this.P_===null?null:new YS(Math.floor(this.P_.Uh()),Math.ceil(this.P_.bi()))}y_(){return this.P_}static T_(){return new ix(null)}}function OQe(n,e){return n.weight>e.weight?n:e}
8354class PQe{constructor(e,t,r,i){this.Mo=0,this.R_=null,this.D_=[],this.wl=null,this.ml=null,this.V_=new kQe,this.I_=new Map,this.B_=ix.T_(),this.E_=!0,this.A_=new Zs,this.z_=new Zs,this.L_=new Zs,this.O_=null,this.N_=null,this.F_=new Map,this.W_=-1,this.H_=[],this.Ps=t,this.Sl=r,this.U_=t.rightOffset,this.q_=t.barSpacing,this.ts=e,this.o_=i,this.Y_(),this.V_.m_(t.uniformDistribution),this.j_()}N(){return this.Ps}K_(e){tu(this.Sl,e),this.X_(),this.Y_()}hr(e,t){tu(this.Ps,e),this.Ps.fixLeftEdge&&this.Z_(),this.Ps.fixRightEdge&&this.G_(),e.barSpacing!==void 0&&this.ts.dn(e.barSpacing),e.rightOffset!==void 0&&this.ts.fn(e.rightOffset),e.minBarSpacing===void 0&&e.maxBarSpacing===void 0||this.ts.dn(e.barSpacing??this.q_),e.ignoreWhitespaceIndices!==void 0&&e.ignoreWhitespaceIndices!==this.Ps.ignoreWhitespaceIndices&&this.j_(),this.X_(),this.Y_(),this.L_.p()}Rs(e){var t;return((t=this.D_[e])==null?void 0:t.time)??null}ss(e){return this.D_[e]??null}J_(e,t){if(this.D_.length<1)return null;if(this.o_.key(e)>this.o_.key(this.D_[this.D_.length-1].time))return t?this.D_.length-1:null;const r=Wx(this.D_,this.o_.key(e),(i,s)=>this.o_.key(i.time)<s);return this.o_.key(e)<this.o_.key(this.D_[r].time)?t?r:null:r}Ki(){return this.Mo===0||this.D_.length===0||this.R_===null}Q_(){return this.D_.length>0}Pe(){return this.tu(),this.B_.k_()}iu(){return this.tu(),this.B_.y_()}su(){const e=this.Pe();if(e===null)return null;const t={from:e.Uh(),to:e.bi()};return this.nu(t)}nu(e){const t=Math.round(e.from),r=Math.round(e.to),i=Pt(this.eu()),s=Pt(this.ru());return{from:Pt(this.ss(Math.max(i,t))),to:Pt(this.ss(Math.min(s,r)))}}hu(e){return{from:Pt(this.J_(e.from,!0)),to:Pt(this.J_(e.to,!0))}}Qi(){return this.Mo}Eo(e){if(!isFinite(e)||e<=0||this.Mo===e)return;const t=this.iu(),r=this.Mo;if(this.Mo=e,this.E_=!0,this.Ps.lockVisibleTimeRangeOnResize&&r!==0){const i=this.q_*e/r;this.q_=i}if(this.Ps.fixLeftEdge&&t!==null&&t.Uh()<=0){const i=r-e;this.U_-=Math.round(i/this.q_)+1,this.E_=!0}this.au(),this.lu()}qt(e){if(this.Ki()||!CC(e))return 0;const t=this.ou()+this.U_-e;return this.Mo-(t+.5)*this.q_-1}_u(e,t){const r=this.ou(),i=t===void 0?0:t.from,s=t===void 0?e.length:t.to;for(let o=i;o<s;o++){const a=e[o].wt,c=r+this.U_-a,u=this.Mo-(c+.5)*this.q_-1;e[o]._t=u}}uu(e,t){const r=Math.ceil(this.cu(e));return t&&this.Ps.ignoreWhitespaceIndices&&!this.du(r)?this.fu(r):r}fn(e){this.E_=!0,this.U_=e,this.lu(),this.ts.pu(),this.ts.ar()}vu(){return this.q_}dn(e){this.mu(e),this.lu(),this.ts.pu(),this.ts.ar()}wu(){return this.U_}Va(){if(this.Ki())return null;if(this.N_!==null)return this.N_;const e=this.q_,t=5*(this.ts.N().layout.fontSize+4)/8*(this.Ps.tickMarkMaxCharacterLength||8),r=Math.round(t/e),i=Pt(this.Pe()),s=Math.max(i.Uh(),i.Uh()-r),o=Math.max(i.bi(),i.bi()-r),a=this.V_.M_(e,t,this.Ps.ignoreWhitespaceIndices,this.F_,this.W_),c=this.eu()+r,u=this.ru()-r,d=this.gu(),f=this.Ps.fixLeftEdge||d,m=this.Ps.fixRightEdge||d;let w=0;for(const y of a){if(!(s<=y.index&&y.index<=o))continue;let b;w<this.H_.length?(b=this.H_[w],b.coord=this.qt(y.index),b.label=this.Mu(y),b.weight=y.weight):(b={needAlignCoordinate:!1,coord:this.qt(y.index),label:this.Mu(y),weight:y.weight},this.H_.push(b)),this.q_>t/2&&!d?b.needAlignCoordinate=!1:b.needAlignCoordinate=f&&y.index<=c||m&&y.index>=u,w++}return this.H_.length=w,this.N_=this.H_,this.H_}bu(){this.E_=!0,this.dn(this.Ps.barSpacing),this.fn(this.Ps.rightOffset)}Su(e){this.E_=!0,this.R_=e,this.lu(),this.Z_()}xu(e,t){const r=this.cu(e),i=this.vu(),s=i+t*(i/10);this.dn(s),this.Ps.rightBarStaysOnScroll||this.fn(this.wu()+(r-this.cu(e)))}eo(e){this.wl&&this.oo(),this.ml===null&&this.O_===null&&(this.Ki()||(this.ml=e,this.Cu()))}ro(e){if(this.O_===null)return;const t=VS(this.Mo-e,0,this.Mo),r=VS(this.Mo-Pt(this.ml),0,this.Mo);t!==0&&r!==0&&this.dn(this.O_.vu*t/r)}ho(){this.ml!==null&&(this.ml=null,this.Pu())}ao(e){this.wl===null&&this.O_===null&&(this.Ki()||(this.wl=e,this.Cu()))}lo(e){if(this.wl===null)return;const t=(this.wl-e)/this.vu();this.U_=Pt(this.O_).wu+t,this.E_=!0,this.lu()}oo(){this.wl!==null&&(this.wl=null,this.Pu())}ku(){this.yu(this.Ps.rightOffset)}yu(e,t=400){if(!isFinite(e))throw new RangeError("offset is required and must be finite number");if(!isFinite(t)||t<=0)throw new RangeError("animationDuration (optional) must be finite positive number");const r=this.U_,i=performance.now();this.ts._n({Tu:s=>(s-i)/t>=1,Ru:s=>{const o=(s-i)/t;return o>=1?e:r+(e-r)*o}})}kt(e,t){this.E_=!0,this.D_=e,this.V_.w_(e,t),this.lu()}Du(){return this.A_}Vu(){return this.z_}Iu(){return this.L_}ou(){return this.R_||0}Bu(e){const t=e.f_();this.mu(this.Mo/t),this.U_=e.bi()-this.ou(),this.lu(),this.E_=!0,this.ts.pu(),this.ts.ar()}Eu(){const e=this.eu(),t=this.ru();e!==null&&t!==null&&this.Bu(new YS(e,t+this.Ps.rightOffset))}Au(e){const t=new YS(e.from,e.to);this.Bu(t)}ns(e){return this.Sl.timeFormatter!==void 0?this.Sl.timeFormatter(e.originalTime):this.o_.formatHorzItem(e.time)}j_(){if(!this.Ps.ignoreWhitespaceIndices)return;this.F_.clear();const e=this.ts.js();for(const t of e)for(const r of t.ma())this.F_.set(r,!0);this.W_++}gu(){const e=this.ts.N().handleScroll,t=this.ts.N().handleScale;return!(e.horzTouchDrag||e.mouseWheel||e.pressedMouseMove||e.vertTouchDrag||t.axisDoubleClickReset.time||t.axisPressedMouseMove.time||t.mouseWheel||t.pinch)}eu(){return this.D_.length===0?null:0}ru(){return this.D_.length===0?null:this.D_.length-1}zu(e){return(this.Mo-1-e)/this.q_}cu(e){const t=this.zu(e),r=this.ou()+this.U_-t;return Math.round(1e6*r)/1e6}mu(e){const t=this.q_;this.q_=e,this.au(),t!==this.q_&&(this.E_=!0,this.Lu())}tu(){if(!this.E_)return;if(this.E_=!1,this.Ki())return void this.Ou(ix.T_());const e=this.ou(),t=this.Mo/this.q_,r=this.U_+e,i=new YS(r-t+1,r);this.Ou(new ix(i))}au(){const e=VS(this.q_,this.Nu(),this.Fu());this.q_!==e&&(this.q_=e,this.E_=!0)}Fu(){return this.Ps.maxBarSpacing>0?this.Ps.maxBarSpacing:.5*this.Mo}Nu(){return this.Ps.fixLeftEdge&&this.Ps.fixRightEdge&&this.D_.length!==0?this.Mo/this.D_.length:this.Ps.minBarSpacing}lu(){const e=this.Wu();e!==null&&this.U_<e&&(this.U_=e,this.E_=!0);const t=this.Hu();this.U_>t&&(this.U_=t,this.E_=!0)}Wu(){const e=this.eu(),t=this.R_;return e===null||t===null?null:e-t-1+(this.Ps.fixLeftEdge?this.Mo/this.q_:Math.min(2,this.D_.length))}Hu(){return this.Ps.fixRightEdge?0:this.Mo/this.q_-Math.min(2,this.D_.length)}Cu(){this.O_={vu:this.vu(),wu:this.wu()}}Pu(){this.O_=null}Mu(e){let t=this.I_.get(e.weight);return t===void 0&&(t=new MQe(r=>this.Uu(r),this.o_),this.I_.set(e.weight,t)),t.__(e)}Uu(e){return this.o_.formatTickmark(e,this.Sl)}Ou(e){const t=this.B_;this.B_=e,zQ(t.k_(),this.B_.k_())||this.A_.p(),zQ(t.y_(),this.B_.y_())||this.z_.p(),this.Lu()}Lu(){this.N_=null}X_(){this.Lu(),this.I_.clear()}Y_(){this.o_.updateFormatter(this.Sl)}
8354Z_(){if(!this.Ps.fixLeftEdge)return;const e=this.eu();if(e===null)return;const t=this.Pe();if(t===null)return;const r=t.Uh()-e;if(r<0){const i=this.U_-r-1;this.fn(i)}this.au()}G_(){this.lu(),this.au()}du(e){return!this.Ps.ignoreWhitespaceIndices||this.F_.get(e)||!1}fu(e){const t=function*(i){const s=Math.round(i),o=s<i;let a=1;for(;;)o?(yield s+a,yield s-a):(yield s-a,yield s+a),a++}(e),r=this.ru();for(;r;){const i=t.next().value;if(this.F_.get(i))return i;if(i<0||i>r)break}return e}}var FQ,WQ,HQ,PL,VQ;(function(n){n[n.OnTouchEnd=0]="OnTouchEnd",n[n.OnNextTap=1]="OnNextTap"})(FQ||(FQ={}));class DQe{constructor(e,t,r){this.$u=[],this.qu=[],this.Mo=0,this.Yu=null,this.ju=new Zs,this.Ku=new Zs,this.Xu=null,this.Zu=e,this.Ps=t,this.o_=r,this.xl=new DZe(this.Ps.layout.colorParsers),this.Gu=new PZe(this),this.uh=new PQe(this,t.timeScale,this.Ps.localization,r),this.Ct=new qZe(this,t.crosshair),this.Ju=new EQe(t.crosshair),t.addDefaultPane&&(this.Qu(0),this.$u[0].Bo(2)),this.tc=this.sc(0),this.nc=this.sc(1)}Bh(){this.ec(Zo.gn())}ar(){this.ec(Zo.wn())}Zh(){this.ec(new Zo(1))}Eh(e){const t=this.rc(e);this.ec(t)}hc(){return this.Yu}ac(e){var r,i,s,o;if(((r=this.Yu)==null?void 0:r.n_)===(e==null?void 0:e.n_)&&((s=(i=this.Yu)==null?void 0:i.e_)==null?void 0:s.Kn)===((o=e==null?void 0:e.e_)==null?void 0:o.Kn))return;const t=this.Yu;this.Yu=e,t!==null&&this.Eh(t.n_),e!==null&&e.n_!==(t==null?void 0:t.n_)&&this.Eh(e.n_)}N(){return this.Ps}hr(e){tu(this.Ps,e),this.$u.forEach(t=>t.Ro(e)),e.timeScale!==void 0&&this.uh.hr(e.timeScale),e.localization!==void 0&&this.uh.K_(e.localization),(e.leftPriceScale||e.rightPriceScale)&&this.ju.p(),this.tc=this.sc(0),this.nc=this.sc(1),this.Bh()}lc(e,t,r=0){const i=this.$u[r];if(i===void 0)return;if(e==="left")return tu(this.Ps,{leftPriceScale:t}),i.Ro({leftPriceScale:t}),this.ju.p(),void this.Bh();if(e==="right")return tu(this.Ps,{rightPriceScale:t}),i.Ro({rightPriceScale:t}),this.ju.p(),void this.Bh();const s=this.oc(e,r);s!==null&&(s.Ft.hr(t),this.ju.p())}oc(e,t){const r=this.$u[t];if(r===void 0)return null;const i=r.Do(e);return i!==null?{Us:r,Ft:i}:null}Et(){return this.uh}$s(){return this.$u}_c(){return this.Ct}uc(){return this.Ku}cc(e,t){e.zl(t),this.pu()}Eo(e){this.Mo=e,this.uh.Eo(this.Mo),this.$u.forEach(t=>t.Eo(e)),this.pu()}dc(e){this.$u.length!==1&&(oa(e>=0&&e<this.$u.length,"Invalid pane index"),this.$u.splice(e,1),this.Bh())}fc(e,t){if(this.$u.length<2)return;oa(e>=0&&e<this.$u.length,"Invalid pane index");const r=this.$u[e],i=this.$u.reduce((f,m)=>f+m.Io(),0),s=this.$u.reduce((f,m)=>f+m.$t(),0),o=s-30*(this.$u.length-1);t=Math.min(o,Math.max(30,t));const a=i/s,c=r.$t();r.Bo(t*a);let u=t-c,d=this.$u.length-1;for(const f of this.$u)if(f!==r){const m=Math.min(o,Math.max(30,f.$t()-u/d));u-=f.$t()-m,d-=1;const w=m*a;f.Bo(w)}this.Bh()}vc(e,t){oa(e>=0&&e<this.$u.length&&t>=0&&t<this.$u.length,"Invalid pane index");const r=this.$u[e],i=this.$u[t];this.$u[e]=i,this.$u[t]=r,this.Bh()}mc(e,t){if(oa(e>=0&&e<this.$u.length&&t>=0&&t<this.$u.length,"Invalid pane index"),e===t)return;const[r]=this.$u.splice(e,1);this.$u.splice(t,0,r),this.Bh()}Uo(e,t,r){e.Uo(t,r)}$o(e,t,r){e.$o(t,r),this.Ah(),this.ec(this.wc(e,2))}qo(e,t){e.qo(t),this.ec(this.wc(e,2))}Yo(e,t,r){t.Rl()||e.Yo(t,r)}jo(e,t,r){t.Rl()||(e.jo(t,r),this.Ah(),this.ec(this.wc(e,2)))}Ko(e,t){t.Rl()||(e.Ko(t),this.ec(this.wc(e,2)))}Zo(e,t){e.Zo(t),this.ec(this.wc(e,2))}gc(e){this.uh.eo(e)}Mc(e,t){const r=this.Et();if(r.Ki()||t===0)return;const i=r.Qi();e=Math.max(1,Math.min(e,i)),r.xu(e,t),this.pu()}bc(e){this.Sc(0),this.xc(e),this.Cc()}Pc(e){this.uh.ro(e),this.pu()}kc(){this.uh.ho(),this.ar()}Sc(e){this.uh.ao(e)}xc(e){this.uh.lo(e),this.pu()}Cc(){this.uh.oo(),this.ar()}js(){return this.qu}yc(e,t,r,i,s){this.Ct.Vs(e,t);let o=NaN,a=this.uh.uu(e,!0);const c=this.uh.Pe();c!==null&&(a=Math.min(Math.max(c.Uh(),a),c.bi()));const u=i.ys(),d=u.zt();if(d!==null&&(o=u.Ts(t,d)),o=this.Ju.Ma(o,a,i),this.Ct.As(a,o,i),this.Zh(),!s){const f=Qce(i,e,t);this.ac(f&&{n_:f.n_,e_:f.e_,h_:f.h_||null}),this.Ku.p(this.Ct.Bt(),{x:e,y:t},r)}}Tc(e,t,r){const i=r.ys(),s=i.zt(),o=i.Nt(e,Pt(s)),a=this.uh.J_(t,!0),c=this.uh.qt(Pt(a));this.yc(c,o,null,r,!0)}Rc(e){this._c().Ls(),this.Zh(),e||this.Ku.p(null,null,null)}Ah(){const e=this.Ct.Us();if(e!==null){const t=this.Ct.Bs(),r=this.Ct.Es();this.yc(t,r,null,e)}this.Ct.Ns()}Dc(e,t,r){const i=this.uh.Rs(0);t!==void 0&&r!==void 0&&this.uh.kt(t,r);const s=this.uh.Rs(0),o=this.uh.ou(),a=this.uh.Pe();if(a!==null&&i!==null&&s!==null){const c=a.Te(o),u=this.o_.key(i)>this.o_.key(s),d=e!==null&&e>o&&!u,f=this.uh.N().allowShiftVisibleRangeOnWhitespaceReplacement,m=c&&(r!==void 0||f)&&this.uh.N().shiftVisibleRangeOnNewBar;if(d&&!m){const w=e-o;this.uh.fn(this.uh.wu()-w)}}this.uh.Su(e)}Lh(e){e!==null&&e.Jo()}Hn(e){if(function(r){return r instanceof jQ}(e))return e;const t=this.$u.find(r=>r.Dt().includes(e));return t===void 0?null:t}
vendor: 6,697 bytes, line 8354
8354pu(){this.$u.forEach(e=>e.Jo()),this.Ah()}m(){this.$u.forEach(e=>e.m()),this.$u.length=0,this.Ps.localization.priceFormatter=void 0,this.Ps.localization.percentageFormatter=void 0,this.Ps.localization.timeFormatter=void 0}Vc(){return this.Gu}Yn(){return this.Gu.N()}Vo(){return this.ju}Ic(e,t){const r=this.Qu(t);this.Bc(e,r),this.qu.push(e),this.qu.length===1?this.Bh():this.ar()}Ec(e){const t=this.Hn(e),r=this.qu.indexOf(e);oa(r!==-1,"Series not found");const i=Pt(t);this.qu.splice(r,1),i.io(e),e.m&&e.m(),this.uh.j_(),this.Ac(i)}Ih(e,t){const r=Pt(this.Hn(e));r.io(e,!0),r.Jl(e,t,!0)}Eu(){const e=Zo.wn();e.rn(),this.ec(e)}zc(e){const t=Zo.wn();t.ln(e),this.ec(t)}cn(){const e=Zo.wn();e.cn(),this.ec(e)}dn(e){const t=Zo.wn();t.dn(e),this.ec(t)}fn(e){const t=Zo.wn();t.fn(e),this.ec(t)}_n(e){const t=Zo.wn();t._n(e),this.ec(t)}hn(){const e=Zo.wn();e.hn(),this.ec(e)}Lc(){return this.Ps.rightPriceScale.visible?"right":"left"}Oc(e,t){if(oa(t>=0,"Index should be greater or equal to 0"),t===this.Nc(e))return;const r=Pt(this.Hn(e));r.io(e);const i=this.Qu(t);this.Bc(e,i),r.ba().length===0&&this.Ac(r),this.Bh()}Fc(){return this.nc}$(){return this.tc}Ut(e){const t=this.nc,r=this.tc;if(t===r)return t;if(e=Math.max(0,Math.min(100,Math.round(100*e))),this.Xu===null||this.Xu.mr!==r||this.Xu.wr!==t)this.Xu={mr:r,wr:t,Wc:new Map};else{const s=this.Xu.Wc.get(e);if(s!==void 0)return s}const i=this.xl.tt(r,t,e/100);return this.Xu.Wc.set(e,i),i}Hc(e){return this.$u.indexOf(e)}Xi(){return this.xl}Uc(){return this.$c()}$c(e){const t=new jQ(this.uh,this);this.$u.push(t);const r=e??this.$u.length-1,i=Zo.gn();return i.Qs(r,{tn:0,sn:!0}),this.ec(i),t}Qu(e){return oa(e>=0,"Index should be greater or equal to 0"),(e=Math.min(this.$u.length,e))<this.$u.length?this.$u[e]:this.$c(e)}Nc(e){return this.$u.findIndex(t=>t.Oo().includes(e))}wc(e,t){const r=new Zo(t);if(e!==null){const i=this.$u.indexOf(e);r.Qs(i,{tn:t})}return r}rc(e,t){return t===void 0&&(t=2),this.wc(this.Hn(e),t)}ec(e){this.Zu&&this.Zu(e),this.$u.forEach(t=>t.i_().lr().kt())}Bc(e,t){const r=e.N().priceScaleId,i=r!==void 0?r:this.Lc();t.Jl(e,i),nM(i)||e.hr(e.N())}sc(e){const t=this.Ps.layout;return t.background.type==="gradient"?e===0?t.background.topColor:t.background.bottomColor:t.background.color}Ac(e){!e.Lo()&&e.ba().length===0&&this.$u.length>1&&this.$u.splice(this.Hc(e),1)}}function DL(n){return!Fx(n)&&!N4(n)}function Xce(n){return Fx(n)}(function(n){n[n.Disabled=0]="Disabled",n[n.Continuous=1]="Continuous",n[n.OnDataUpdate=2]="OnDataUpdate"})(WQ||(WQ={})),function(n){n[n.LastBar=0]="LastBar",n[n.LastVisible=1]="LastVisible"}(HQ||(HQ={})),function(n){n.Solid="solid",n.VerticalGradient="gradient"}(PL||(PL={})),function(n){n[n.Year=0]="Year",n[n.Month=1]="Month",n[n.DayOfMonth=2]="DayOfMonth",n[n.Time=3]="Time",n[n.TimeWithSeconds=4]="TimeWithSeconds"}(VQ||(VQ={}));const qQ=n=>n.getUTCFullYear();function BQe(n,e,t){return e.replace(/yyyy/g,(r=>ng(qQ(r),4))(n)).replace(/yy/g,(r=>ng(qQ(r)%100,2))(n)).replace(/MMMM/g,((r,i)=>new Date(r.getUTCFullYear(),r.getUTCMonth(),1).toLocaleString(i,{month:"long"}))(n,t)).replace(/MMM/g,((r,i)=>new Date(r.getUTCFullYear(),r.getUTCMonth(),1).toLocaleString(i,{month:"short"}))(n,t)).replace(/MM/g,(r=>ng((i=>i.getUTCMonth()+1)(r),2))(n)).replace(/dd/g,(r=>ng((i=>i.getUTCDate())(r),2))(n))}class Jce{constructor(e="yyyy-MM-dd",t="default"){this.qc=e,this.Yc=t}__(e){return BQe(e,this.qc,this.Yc)}}class LQe{constructor(e){this.jc=e||"%h:%m:%s"}__(e){return this.jc.replace("%h",ng(e.getUTCHours(),2)).replace("%m",ng(e.getUTCMinutes(),2)).replace("%s",ng(e.getUTCSeconds(),2))}}const $Qe={Kc:"yyyy-MM-dd",Xc:"%h:%m:%s",Zc:" ",Gc:"default"};class UQe{constructor(e={}){const t={...$Qe,...e};this.Jc=new Jce(t.Kc,t.Gc),this.Qc=new LQe(t.Xc),this.td=t.Zc}__(e){return`${this.Jc.__(e)}${this.td}${this.Qc.__(e)}`}}function t6(n){return 60*n*60*1e3}function gD(n){return 60*n*1e3}const n6=[{sd:(KQ=1,1e3*KQ),nd:10},{sd:gD(1),nd:20},{sd:gD(5),nd:21},{sd:gD(30),nd:22},{sd:t6(1),nd:30},{sd:t6(3),nd:31},{sd:t6(6),nd:32},{sd:t6(12),nd:33}];var KQ;function YQ(n,e){if(n.getUTCFullYear()!==e.getUTCFullYear())return 70;if(n.getUTCMonth()!==e.getUTCMonth())return 60;if(n.getUTCDate()!==e.getUTCDate())return 50;for(let t=n6.length-1;t>=0;--t)if(Math.floor(e.getTime()/n6[t].sd)!==Math.floor(n.getTime()/n6[t].sd))return n6[t].nd;return 0}function mD(n){let e=n;if(N4(n)&&(e=fz(n)),!DL(e))throw new Error("time must be of type BusinessDay");const t=new Date(Date.UTC(e.year,e.month-1,e.day,0,0,0,0));return{ed:Math.round(t.getTime()/1e3),rd:e}}function GQ(n){if(!Xce(n))throw new Error("time must be of type isUTCTimestamp");return{ed:n}}function fz(n){const e=new Date(n);if(isNaN(e.getTime()))throw new Error(`Invalid date string=${n}, expected format=yyyy-mm-dd`);return{day:e.getUTCDate(),month:e.getUTCMonth()+1,year:e.getUTCFullYear()}}function ZQ(n){N4(n.time)&&(n.time=fz(n.time))}class QQ{options(){return this.Ps}setOptions(e){this.Ps=e,this.updateFormatter(e.localization)}preprocessData(e){Array.isArray(e)?function(t){t.forEach(ZQ)}(e):ZQ(e)}createConverterToInternalObj(e){return Pt(function(t){return t.length===0?null:DL(t[0].time)||N4(t[0].time)?mD:GQ}(e))}key(e){return typeof e=="object"&&"ed"in e?e.ed:this.key(this.convertHorzItemToInternal(e))}cacheKey(e){const t=e;return t.rd===void 0?new Date(1e3*t.ed).getTime():new Date(Date.UTC(t.rd.year,t.rd.month-1,t.rd.day)).getTime()}convertHorzItemToInternal(e){return Xce(t=e)?GQ(t):DL(t)?mD(t):mD(fz(t));var t}updateFormatter(e){if(!this.Ps)return;const t=e.dateFormat;this.Ps.timeScale.timeVisible?this.hd=new UQe({Kc:t,Xc:this.Ps.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",Zc:" ",Gc:e.locale}):this.hd=new Jce(t,e.locale)}formatHorzItem(e){const t=e;return this.hd.__(new Date(1e3*t.ed))}formatTickmark(e,t){const r=function(s,o,a){switch(s){case 0:case 10:return o?a?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return o?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(e.weight,this.Ps.timeScale.timeVisible,this.Ps.timeScale.secondsVisible),i=this.Ps.timeScale;if(i.tickMarkFormatter!==void 0){const s=i.tickMarkFormatter(e.originalTime,r,t.locale);if(s!==null)return s}return function(s,o,a){const c={};switch(o){case 0:c.year="numeric";break;case 1:c.month="short";break;case 2:c.day="numeric";break;case 3:c.hour12=!1,c.hour="2-digit",c.minute="2-digit";break;case 4:c.hour12=!1,c.hour="2-digit",c.minute="2-digit",c.second="2-digit"}const u=s.rd===void 0?new Date(1e3*s.ed):new Date(Date.UTC(s.rd.year,s.rd.month-1,s.rd.day));return new Date(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate(),u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()).toLocaleStr
8354ing(a,c)}(e.time,r,t.locale)}maxTickMarkWeight(e){let t=e.reduce(OQe,e[0]).weight;return t>30&&t<50&&(t=30),t}fillWeightsForPoints(e,t){(function(r,i=0){if(r.length===0)return;let s=i===0?null:r[i-1].time.ed,o=s!==null?new Date(1e3*s):null,a=0;for(let c=i;c<r.length;++c){const u=r[c],d=new Date(1e3*u.time.ed);o!==null&&(u.timeWeight=YQ(d,o)),a+=u.time.ed-(s||u.time.ed),s=u.time.ed,o=d}if(i===0&&r.length>1){const c=Math.ceil(a/(r.length-1)),u=new Date(1e3*(r[0].time.ed-c));r[0].timeWeight=YQ(new Date(1e3*r[0].time.ed),u)}})(e,t)}static ad(e){return tu({localization:{dateFormat:"dd MMM 'yy"}},e??{})}}const Hx=typeof window<"u";function XQ(){return!!Hx&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function wD(){return!!Hx&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function BL(n){return n+n%2}function jQe(n){Hx&&window.chrome!==void 0&&n.addEventListener("mousedown",e=>{if(e.button===1)return e.preventDefault(),!1})}class sM{constructor(e,t,r){this.ld=0,this.od=null,this._d={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.ud=0,this.dd=null,this.fd={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.pd=null,this.vd=!1,this.md=null,this.wd=null,this.gd=!1,this.Md=!1,this.bd=!1,this.Sd=null,this.xd=null,this.Cd=null,this.Pd=null,this.kd=null,this.yd=null,this.Td=null,this.Rd=0,this.Dd=!1,this.Vd=!1,this.Id=!1,this.Bd=0,this.Ed=null,this.Ad=!wD(),this.zd=i=>{this.Ld(i)},this.Od=i=>{if(this.Nd(i)){const s=this.Fd(i);if(++this.ud,this.dd&&this.ud>1){const{Wd:o}=this.Hd(lf(i),this.fd);o<30&&!this.bd&&this.Ud(s,this.qd.$d),this.Yd()}}else{const s=this.Fd(i);if(++this.ld,this.od&&this.ld>1){const{Wd:o}=this.Hd(lf(i),this._d);o<5&&!this.Md&&this.jd(s,this.qd.Kd),this.Xd()}}},this.Zd=e,this.qd=t,this.Ps=r,this.Gd()}m(){this.Sd!==null&&(this.Sd(),this.Sd=null),this.xd!==null&&(this.xd(),this.xd=null),this.Pd!==null&&(this.Pd(),this.Pd=null),this.kd!==null&&(this.kd(),this.kd=null),this.yd!==null&&(this.yd(),this.yd=null),this.Cd!==null&&(this.Cd(),this.Cd=null),this.Jd(),this.Xd()}Qd(e){this.Pd&&this.Pd();const t=this.tf.bind(this);if(this.Pd=()=>{this.Zd.removeEventListener("mousemove",t)},this.Zd.addEventListener("mousemove",t),this.Nd(e))return;const r=this.Fd(e);this.jd(r,this.qd.if),this.Ad=!0}Xd(){this.od!==null&&clearTimeout(this.od),this.ld=0,this.od=null,this._d={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Yd(){this.dd!==null&&clearTimeout(this.dd),this.ud=0,this.dd=null,this.fd={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}tf(e){if(this.Id||this.wd!==null||this.Nd(e))return;const t=this.Fd(e);this.jd(t,this.qd.sf),this.Ad=!0}nf(e){const t=yD(e.changedTouches,Pt(this.Ed));if(t===null||(this.Bd=r6(e),this.Td!==null)||this.Vd)return;this.Dd=!0;const r=this.Hd(lf(t),Pt(this.wd)),{ef:i,rf:s,Wd:o}=r;if(this.gd||!(o<5)){if(!this.gd){const a=.5*i,c=s>=a&&!this.Ps.hf(),u=a>s&&!this.Ps.af();c||u||(this.Vd=!0),this.gd=!0,this.bd=!0,this.Jd(),this.Yd()}if(!this.Vd){const a=this.Fd(e,t);this.Ud(a,this.qd.lf),m2(e)}}}_f(e){if(e.button!==0)return;const t=this.Hd(lf(e),Pt(this.md)),{Wd:r}=t;if(r>=5&&(this.Md=!0,this.Xd()),this.Md){const i=this.Fd(e);this.jd(i,this.qd.uf)}}Hd(e,t){const r=Math.abs(t._t-e._t),i=Math.abs(t.ut-e.ut);return{ef:r,rf:i,Wd:r+i}}cf(e){let t=yD(e.changedTouches,Pt(this.Ed));if(t===null&&e.touches.length===0&&(t=e.changedTouches[0]),t===null)return;this.Ed=null,this.Bd=r6(e),this.Jd(),this.wd=null,this.yd&&(this.yd(),this.yd=null);const r=this.Fd(e,t);if(this.Ud(r,this.qd.df),++this.ud,this.dd&&this.ud>1){const{Wd:i}=this.Hd(lf(t),this.fd);i<30&&!this.bd&&this.Ud(r,this.qd.$d),this.Yd()}else this.bd||(this.Ud(r,this.qd.ff),this.qd.ff&&m2(e));this.ud===0&&m2(e),e.touches.length===0&&this.vd&&(this.vd=!1,m2(e))}Ld(e){if(e.button!==0)return;const t=this.Fd(e);if(this.md=null,this.Id=!1,this.kd&&(this.kd(),this.kd=null),XQ()&&this.Zd.ownerDocument.documentElement.removeEventListener("mouseleave",this.zd),!this.Nd(e))if(this.jd(t,this.qd.pf),++this.ld,this.od&&this.ld>1){const{Wd:r}=this.Hd(lf(e),this._d);r<5&&!this.Md&&this.jd(t,this.qd.Kd),this.Xd()}else this.Md||this.jd(t,this.qd.vf)}Jd(){this.pd!==null&&(clearTimeout(this.pd),this.pd=null)}mf(e){if(this.Ed!==null)return;const t=e.changedTouches[0];this.Ed=t.identifier,this.Bd=r6(e);const r=this.Zd.ownerDocument.documentElement;this.bd=!1,this.gd=!1,this.Vd=!1,this.wd=lf(t),this.yd&&(this.yd(),this.yd=null);{const s=this.nf.bind(this),o=this.cf.bind(this);this.yd=()=>{r.removeEventListener("touchmove",s),r.removeEventListener("touchend",o)},r.addEventListener("touchmove",s,{passive:!1}),r.addEventListener("touchend",o,{passive:!1}),this.Jd(),this.pd=setTimeout(this.wf.bind(this,e),240)}const i=this.Fd(e,t);this.Ud(i,this.qd.gf),this.dd||(this.ud=0,this.dd=setTimeout(this.Yd.bind(this),500),this.fd=lf(t))}Mf(e){if(e.button!==0)return;const t=this.Zd.ownerDocument.documentElement;XQ()&&t.addEventListener("mouseleave",this.zd),this.Md=!1,this.md=lf(e),this.kd&&(this.kd(),this.kd=null);{const i=this._f.bind(this),s=this.Ld.bind(this);this.kd=()=>{t.removeEventListener("mousemove",i),t.removeEventListener("mouseup",s)},t.addEventListener("mousemove",i),t.addEventListener("mouseup",s)}if(this.Id=!0,this.Nd(e))return;const r=this.Fd(e);this.jd(r,this.qd.bf),this.od||(this.ld=0,this.od=setTimeout(this.Xd.bind(this),500),this._d=lf(e))}Gd(){this.Zd.addEventListener("mouseenter",this.Qd.bind(this)),this.Zd.addEventListener("touchcancel",this.Jd.bind(this));{const e=this.Zd.ownerDocument,t=r=>{this.qd.Sf&&(r.composed&&this.Zd.contains(r.composedPath()[0])||r.target&&this.Zd.contains(r.target)||this.qd.Sf())};this.xd=()=>{e.removeEventListener("touchstart",t)},this.Sd=()=>{e.removeEventListener("mousedown",t)},e.addEventListener("mousedown",t),e.addEventListener("touchstart",t,{passive:!0})}wD()&&(this.Cd=()=>{this.Zd.removeEventListener("dblclick",this.Od)},this.Zd.addEventListener("dblclick",this.Od)),this.Zd.addEventListener("mouseleave",this.xf.bind(this)),this.Zd.addEventListener("touchstart",this.mf.bind(this),{passive:!0}),jQe(this.Zd),this.Zd.addEventListener("mousedown",this.Mf.bind(this)),this.Cf(),this.Zd.addEventListener("touchmove",()=>{},{passive:!1})}Cf(){this.qd.Pf===void 0&&this.qd.kf===void 0&&this.qd.yf===void 0||(this.Zd.addEventListener("touchstart",e=>this.Tf(e.touches),{passive:!0}),this.Zd.addEventListener("touchmove",e=>{if(e.touches.length===2&&this.Td!==null&&this.qd.kf!==void 0){const t=JQ(e.touches[0],e.touches[1])/this.Rd;this.qd.kf(this.Td,t),m2(e)}},{passive:!1}),this.Zd.addEventListener("touchend",e=>{this.Tf(e.touches)}))}Tf(e){e.length===1&&(this.Dd=!1),e.length!==2||this.Dd||this.vd?this.Rf():this.Df(e)}Df(e){const t=this.Zd.getBoundingClientRect()||{left:0,top:0};this.Td={_t:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,ut:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this.Rd=JQ(e[0],e[1]),this.qd.Pf!==void 0&&this.qd.Pf(),this.Jd()}Rf(){this.Td!==null&&(this.Td=null,this.qd.yf!==void 0&&this.qd.yf())}xf(e){if(this.Pd&&this.Pd(),this.Nd(e)||!this.Ad)return;const t=this.Fd(e);this.jd(t,this.qd.Vf),this.Ad=!wD()}wf(e){const t=yD(e.touches,Pt(this.Ed));if(t===null)return;const r=this.Fd(e,t);this.Ud(r,this.qd.If),this.bd=!0,this.vd=!0}Nd(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents!==void 0?e.sourceCapabilities.firesTouchEvents:r6(e)<this.Bd+500}Ud(e,t){t&&t.call(this.qd,e)}jd(e,t){t&&t.call(this.qd,e)}Fd(e,t){const r=t||e,i=this.Zd.getBoundingClientRect()||{left:0,top:0};return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY,screenX:r.screenX,screenY:r.screenY,localX:r.clientX-i.left,localY:r.clientY-i.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,Bf:!e.type.startsWith("mouse")&&e.type!=="contextmenu"&&e.type!=="click",Ef:e.type,Af:r.target,a_:e.view,zf:()=>{e.type!=="touchstart"&&m2(e)}}}}function JQ(n,e){const t=n.clientX-e.clientX,r=n.clientY-e.clientY;return Math.sqrt(t*t+r*r)}
8354function m2(n){n.cancelable&&n.preventDefault()}function lf(n){return{_t:n.pageX,ut:n.pageY}}function r6(n){return n.timeStamp||performance.now()}function yD(n,e){for(let t=0;t<n.length;++t)if(n[t].identifier===e)return n[t];return null}class zQe{constructor(e,t,r){this.Lf=null,this.Of=null,this.Nf=!0,this.Ff=null,this.Wf=e,this.Hf=e.Uf()[t],this.$f=e.Uf()[r],this.qf=document.createElement("tr"),this.qf.style.height="1px",this.Yf=document.createElement("td"),this.Yf.style.position="relative",this.Yf.style.padding="0",this.Yf.style.margin="0",this.Yf.setAttribute("colspan","3"),this.jf(),this.qf.appendChild(this.Yf),this.Nf=this.Wf.N().layout.panes.enableResize,this.Nf?this.Kf():(this.Lf=null,this.Of=null)}m(){this.Of!==null&&this.Of.m()}Xf(){return this.qf}Zf(){return Fi({width:this.Hf.Zf().width,height:1})}Gf(){return Fi({width:this.Hf.Gf().width,height:1*window.devicePixelRatio})}Jf(e,t,r){const i=this.Gf();e.fillStyle=this.Wf.N().layout.panes.separatorColor,e.fillRect(t,r,i.width,i.height)}kt(){this.jf(),this.Wf.N().layout.panes.enableResize!==this.Nf&&(this.Nf=this.Wf.N().layout.panes.enableResize,this.Nf?this.Kf():(this.Lf!==null&&(this.Yf.removeChild(this.Lf.Qf),this.Yf.removeChild(this.Lf.tp),this.Lf=null),this.Of!==null&&(this.Of.m(),this.Of=null)))}Kf(){const e=document.createElement("div"),t=e.style;t.position="fixed",t.display="none",t.zIndex="49",t.top="0",t.left="0",t.width="100%",t.height="100%",t.cursor="row-resize",this.Yf.appendChild(e);const r=document.createElement("div"),i=r.style;i.position="absolute",i.zIndex="50",i.top="-4px",i.height="9px",i.width="100%",i.backgroundColor="",i.cursor="row-resize",this.Yf.appendChild(r);const s={if:this.ip.bind(this),Vf:this.sp.bind(this),bf:this.np.bind(this),gf:this.np.bind(this),uf:this.ep.bind(this),lf:this.ep.bind(this),pf:this.rp.bind(this),df:this.rp.bind(this)};this.Of=new sM(r,s,{hf:()=>!1,af:()=>!0}),this.Lf={tp:r,Qf:e}}jf(){this.Yf.style.background=this.Wf.N().layout.panes.separatorColor}ip(e){this.Lf!==null&&(this.Lf.tp.style.backgroundColor=this.Wf.N().layout.panes.separatorHoverColor)}sp(e){this.Lf!==null&&this.Ff===null&&(this.Lf.tp.style.backgroundColor="")}np(e){if(this.Lf===null)return;const t=this.Hf.hp().Io()+this.$f.hp().Io(),r=t/(this.Hf.Zf().height+this.$f.Zf().height),i=30*r;t<=2*i||(this.Ff={ap:e.pageY,lp:this.Hf.hp().Io(),op:t-i,_p:t,up:r,cp:i},this.Lf.Qf.style.display="block")}ep(e){const t=this.Ff;if(t===null)return;const r=(e.pageY-t.ap)*t.up,i=VS(t.lp+r,t.cp,t.op);this.Hf.hp().Bo(i),this.$f.hp().Bo(t._p-i),this.Wf.Qt().Bh()}rp(e){this.Ff!==null&&this.Lf!==null&&(this.Ff=null,this.Lf.Qf.style.display="none")}}function bD(n,e){return n.dp-e.dp}function vD(n,e,t){const r=(n.dp-e.dp)/(n.wt-e.wt);return Math.sign(r)*Math.min(Math.abs(r),t)}
8354class FQe{constructor(e,t,r,i){this.fp=null,this.pp=null,this.vp=null,this.mp=null,this.wp=null,this.gp=0,this.Mp=0,this.bp=e,this.Sp=t,this.xp=r,this.Mn=i}Cp(e,t){if(this.fp!==null){if(this.fp.wt===t)return void(this.fp.dp=e);if(Math.abs(this.fp.dp-e)<this.Mn)return}this.mp=this.vp,this.vp=this.pp,this.pp=this.fp,this.fp={wt:t,dp:e}}le(e,t){if(this.fp===null||this.pp===null||t-this.fp.wt>50)return;let r=0;const i=vD(this.fp,this.pp,this.Sp),s=bD(this.fp,this.pp),o=[i],a=[s];if(r+=s,this.vp!==null){const u=vD(this.pp,this.vp,this.Sp);if(Math.sign(u)===Math.sign(i)){const d=bD(this.pp,this.vp);if(o.push(u),a.push(d),r+=d,this.mp!==null){const f=vD(this.vp,this.mp,this.Sp);if(Math.sign(f)===Math.sign(i)){const m=bD(this.vp,this.mp);o.push(f),a.push(m),r+=m}}}}let c=0;for(let u=0;u<o.length;++u)c+=a[u]/r*o[u];Math.abs(c)<this.bp||(this.wp={dp:e,wt:t},this.Mp=c,this.gp=function(u,d){const f=Math.log(d);return Math.log(1*f/-u)/f}(Math.abs(c),this.xp))}Ru(e){const t=Pt(this.wp),r=e-t.wt;return t.dp+this.Mp*(Math.pow(this.xp,r)-1)/Math.log(this.xp)}Tu(e){return this.wp===null||this.Pp(e)===this.gp}Pp(e){const t=e-Pt(this.wp).wt;return Math.min(t,this.gp)}}class WQe{constructor(e,t){this.kp=void 0,this.yp=void 0,this.Tp=void 0,this.ps=!1,this.Rp=e,this.Dp=t,this.Vp()}kt(){this.Vp()}Ip(){this.kp&&this.Rp.removeChild(this.kp),this.yp&&this.Rp.removeChild(this.yp),this.kp=void 0,this.yp=void 0}Bp(){return this.ps!==this.Ep()||this.Tp!==this.Ap()}Ap(){return this.Dp.Qt().Xi().J(this.Dp.N().layout.textColor)>160?"dark":"light"}Ep(){return this.Dp.N().layout.attributionLogo}zp(){const e=new URL(location.href);return e.hostname?"&utm_source="+e.hostname+e.pathname:""}Vp(){this.Bp()&&(this.Ip(),this.ps=this.Ep(),this.ps&&(this.Tp=this.Ap(),this.yp=document.createElement("style"),this.yp.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.kp=document.createElement("a"),this.kp.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.zp()}`,this.kp.title="Charting by TradingView",this.kp.id="tv-attr-logo",this.kp.target="_blank",this.kp.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>',this.kp.toggleAttribute("data-dark",this.Tp==="dark"),this.Rp.appendChild(this.yp),this.Rp.appendChild(this.kp)))}}function B1(n,e){const t=Pt(n.ownerDocument).createElement("canvas");n.appendChild(t);const r=IZe(t,{options:{allowResizeObserver:!0},transform:(i,s)=>({width:Math.max(i.width,s.width),height:Math.max(i.height,s.height)})});return r.resizeCanvasElement(e),r}function L1(n){var e;n.width=1,n.height=1,(e=n.getContext("2d"))==null||e.clearRect(0,0,1,1)}function LL(n,e,t,r){n.ih&&n.ih(e,t,r)}function B6(n,e,t,r){n.nt(e,t,r)}function $L(n,e,t,r){const i=n(t,r);for(const s of i){const o=s.Tt(r);o!==null&&e(o)}}function xD(n,e){return t=>{var r,i;return function(s){return s.Ft!==void 0}(t)?(((r=t.Ft())==null?void 0:r.wa())??"")!==e?[]:((i=t.ta)==null?void 0:i.call(t,n))??[]:[]}}function eX(n,e,t,r){if(!n.length)return;let i=0;const s=n[0].$t(r,!0);let o=e===1?t/2-(n[0].Fi()-s/2):n[0].Fi()-s/2-t/2;o=Math.max(0,o);for(let a=1;a<n.length;a++){const c=n[a],u=n[a-1],d=u.$t(r,!1),f=c.Fi(),m=u.Fi();if(e===1?f>m-d:f<m+d){const w=m-d*e;c.Wi(w);const y=w-e*d/2;if((e===1?y<0:y>t)&&o>0){const b=e===1?-1-y:y-t,E=Math.min(b,o);for(let T=i;T<n.length;T++)n[T].Wi(n[T].Fi()+e*E);o-=E}}else i=a,o=e===1?m-d-f:f-(m+d)}}
8354class tX{constructor(e,t,r,i){this.Yi=null,this.Lp=null,this.Op=!1,this.Np=new _8(200),this.Fp=null,this.Wp=0,this.Hp=!1,this.Up=()=>{this.Hp||this.Pt.$p().Qt().ar()},this.qp=()=>{this.Hp||this.Pt.$p().Qt().ar()},this.Pt=e,this.Ps=t,this.bl=t.layout,this.Gu=r,this.Yp=i==="left",this.jp=xD("normal",i),this.Kp=xD("top",i),this.Xp=xD("bottom",i),this.Yf=document.createElement("div"),this.Yf.style.height="100%",this.Yf.style.overflow="hidden",this.Yf.style.width="25px",this.Yf.style.left="0",this.Yf.style.position="relative",this.Zp=B1(this.Yf,Fi({width:16,height:16})),this.Zp.subscribeSuggestedBitmapSizeChanged(this.Up);const s=this.Zp.canvasElement;s.style.position="absolute",s.style.zIndex="1",s.style.left="0",s.style.top="0",this.Gp=B1(this.Yf,Fi({width:16,height:16})),this.Gp.subscribeSuggestedBitmapSizeChanged(this.qp);const o=this.Gp.canvasElement;o.style.position="absolute",o.style.zIndex="2",o.style.left="0",o.style.top="0";const a={bf:this.np.bind(this),gf:this.np.bind(this),uf:this.ep.bind(this),lf:this.ep.bind(this),Sf:this.Jp.bind(this),pf:this.rp.bind(this),df:this.rp.bind(this),Kd:this.Qp.bind(this),$d:this.Qp.bind(this),if:this.tv.bind(this),Vf:this.sp.bind(this)};this.Of=new sM(this.Gp.canvasElement,a,{hf:()=>!this.Ps.handleScroll.vertTouchDrag,af:()=>!0})}m(){this.Of.m(),this.Gp.unsubscribeSuggestedBitmapSizeChanged(this.qp),L1(this.Gp.canvasElement),this.Gp.dispose(),this.Zp.unsubscribeSuggestedBitmapSizeChanged(this.Up),L1(this.Zp.canvasElement),this.Zp.dispose(),this.Yi!==null&&this.Yi.no().u(this),this.Yi=null}Xf(){return this.Yf}P(){return this.bl.fontSize}iv(){const e=this.Gu.N();return this.Fp!==e.k&&(this.Np.In(),this.Fp=e.k),e}sv(){if(this.Yi===null)return 0;let e=0;const t=this.iv(),r=Pt(this.Zp.canvasElement.getContext("2d",{colorSpace:this.Pt.$p().N().layout.colorSpace}));r.save();const i=this.Yi.Va();r.font=this.nv(),i.length>0&&(e=Math.max(this.Np.Vi(r,i[0].Ga),this.Np.Vi(r,i[i.length-1].Ga)));const s=this.ev();for(let u=s.length;u--;){const d=this.Np.Vi(r,s[u].ri());d>e&&(e=d)}const o=this.Yi.zt();if(o!==null&&this.Lp!==null&&(a=this.Ps.crosshair).mode!==2&&a.horzLine.visible&&a.horzLine.labelVisible){const u=this.Yi.Ts(1,o),d=this.Yi.Ts(this.Lp.height-2,o);e=Math.max(e,this.Np.Vi(r,this.Yi.Zi(Math.floor(Math.min(u,d))+.11111111111111,o)),this.Np.Vi(r,this.Yi.Zi(Math.ceil(Math.max(u,d))-.11111111111111,o)))}var a;r.restore();const c=e||34;return BL(Math.ceil(t.S+t.C+t.I+t.B+5+c))}rv(e){this.Lp!==null&&n1(this.Lp,e)||(this.Lp=e,this.Hp=!0,this.Zp.resizeCanvasElement(e),this.Gp.resizeCanvasElement(e),this.Hp=!1,this.Yf.style.width=`${e.width}px`,this.Yf.style.height=`${e.height}px`)}hv(){return Pt(this.Lp).width}_s(e){this.Yi!==e&&(this.Yi!==null&&this.Yi.no().u(this),this.Yi=e,e.no().i(this.ul.bind(this),this))}Ft(){return this.Yi}In(){const e=this.Pt.hp();this.Pt.$p().Qt().Zo(e,Pt(this.Ft()))}av(e){if(this.Lp===null)return;const t={colorSpace:this.Pt.$p().N().layout.colorSpace};if(e!==1){this.lv(),this.Zp.applySuggestedBitmapSize();const i=D1(this.Zp,t);i!==null&&(i.useBitmapCoordinateSpace(s=>{this.ov(s),this._v(s)}),this.Pt.uv(i,this.Xp),this.cv(i),this.Pt.uv(i,this.jp),this.dv(i))}this.Gp.applySuggestedBitmapSize();const r=D1(this.Gp,t);r!==null&&(r.useBitmapCoordinateSpace(({context:i,bitmapSize:s})=>{i.clearRect(0,0,s.width,s.height)}),this.fv(r),this.Pt.uv(r,this.Kp))}Gf(){return this.Zp.bitmapSize}Jf(e,t,r){const i=this.Gf();i.width>0&&i.height>0&&e.drawImage(this.Zp.canvasElement,t,r)}kt(){var e;(e=this.Yi)==null||e.Va()}np(e){if(this.Yi===null||this.Yi.Ki()||!this.Ps.handleScale.axisPressedMouseMove.price)return;const t=this.Pt.$p().Qt(),r=this.Pt.hp();this.Op=!0,t.Uo(r,this.Yi,e.localY)}ep(e){if(this.Yi===null||!this.Ps.handleScale.axisPressedMouseMove.price)return;const t=this.Pt.$p().Qt(),r=this.Pt.hp(),i=this.Yi;t.$o(r,i,e.localY)}Jp(){if(this.Yi===null||!this.Ps.handleScale.axisPressedMouseMove.price)return;const e=this.Pt.$p().Qt(),t=this.Pt.hp(),r=this.Yi;this.Op&&(this.Op=!1,e.qo(t,r))}rp(e){if(this.Yi===null||!this.Ps.handleScale.axisPressedMouseMove.price)return;const t=this.Pt.$p().Qt(),r=this.Pt.hp();this.Op=!1,t.qo(r,this.Yi)}Qp(e){this.Ps.handleScale.axisDoubleClickReset.price&&this.In()}tv(e){this.Yi!==null&&(!this.Pt.$p().Qt().N().handleScale.axisPressedMouseMove.price||this.Yi.Le()||this.Yi.Vl()||this.pv(1))}sp(e){this.pv(0)}ev(){const e=[],t=this.Yi===null?void 0:this.Yi;return(r=>{for(let i=0;i<r.length;++i){const s=r[i].Ws(this.Pt.hp(),t);for(let o=0;o<s.length;
8354o++)e.push(s[o])}})(this.Pt.hp().Dt()),e}ov({context:e,bitmapSize:t}){const{width:r,height:i}=t,s=this.Pt.hp().Qt(),o=s.$(),a=s.Fc();o===a?eM(e,0,0,r,i,o):jce(e,0,0,r,i,o,a)}_v({context:e,bitmapSize:t,horizontalPixelRatio:r}){if(this.Lp===null||this.Yi===null||!this.Yi.N().borderVisible)return;e.fillStyle=this.Yi.N().borderColor;const i=Math.max(1,Math.floor(this.iv().S*r));let s;s=this.Yp?t.width-i:0,e.fillRect(s,0,i,t.height)}cv(e){if(this.Lp===null||this.Yi===null)return;const t=this.Yi.Va(),r=this.Yi.N(),i=this.iv(),s=this.Yp?this.Lp.width-i.C:0;r.borderVisible&&r.ticksVisible&&e.useBitmapCoordinateSpace(({context:o,horizontalPixelRatio:a,verticalPixelRatio:c})=>{o.fillStyle=r.borderColor;const u=Math.max(1,Math.floor(c)),d=Math.floor(.5*c),f=Math.round(i.C*a);o.beginPath();for(const m of t)o.rect(Math.floor(s*a),Math.round(m.ka*c)-d,f,u);o.fill()}),e.useMediaCoordinateSpace(({context:o})=>{o.font=this.nv(),o.fillStyle=r.textColor??this.bl.textColor,o.textAlign=this.Yp?"right":"left",o.textBaseline="middle";const a=this.Yp?Math.round(s-i.I):Math.round(s+i.C+i.I),c=t.map(u=>this.Np.Di(o,u.Ga));for(let u=t.length;u--;){const d=t[u];o.fillText(d.Ga,a,d.ka+c[u])}})}lv(){if(this.Lp===null||this.Yi===null)return;let e=this.Lp.height/2;const t=[],r=this.Yi.Dt().slice(),i=this.Pt.hp(),s=this.iv();this.Yi===i.$n()&&this.Pt.hp().Dt().forEach(c=>{i.Un(c)&&r.push(c)});const o=this.Yi.ba()[0],a=this.Yi;r.forEach(c=>{const u=c.Ws(i,a);u.forEach(d=>{d.Wi(null),d.Hi()&&t.push(d)}),o===c&&u.length>0&&(e=u[0].Bi())}),t.forEach(c=>c.Wi(c.Bi())),this.Yi.N().alignLabels&&this.vv(t,s,e)}vv(e,t,r){if(this.Lp===null)return;const i=e.filter(o=>o.Bi()<=r),s=e.filter(o=>o.Bi()>r);i.sort((o,a)=>a.Bi()-o.Bi()),i.length&&s.length&&s.push(i[0]),s.sort((o,a)=>o.Bi()-a.Bi());for(const o of e){const a=Math.floor(o.$t(t)/2),c=o.Bi();c>-a&&c<a&&o.Wi(a),c>this.Lp.height-a&&c<this.Lp.height+a&&o.Wi(this.Lp.height-a)}eX(i,1,this.Lp.height,t),eX(s,-1,this.Lp.height,t)}dv(e){if(this.Lp===null)return;const t=this.ev(),r=this.iv(),i=this.Yp?"right":"left";t.forEach(s=>{s.Ui()&&s.Tt(Pt(this.Yi)).nt(e,r,this.Np,i)})}fv(e){if(this.Lp===null||this.Yi===null)return;const t=this.Pt.$p().Qt(),r=[],i=this.Pt.hp(),s=t._c().Ws(i,this.Yi);s.length&&r.push(s);const o=this.iv(),a=this.Yp?"right":"left";r.forEach(c=>{c.forEach(u=>{u.Tt(Pt(this.Yi)).nt(e,o,this.Np,a)})})}pv(e){this.Yf.style.cursor=e===1?"ns-resize":"default"}ul(){const e=this.sv();this.Wp<e&&this.Pt.$p().Qt().Bh(),this.Wp=e}nv(){return S8(this.bl.fontSize,this.bl.fontFamily)}}function HQe(n,e){var t;return((t=n.Jh)==null?void 0:t.call(n,e))??[]}function nX(n,e){var t;return((t=n.Fs)==null?void 0:t.call(n,e))??[]}function rX(n,e){var t;return((t=n.us)==null?void 0:t.call(n,e))??[]}function VQe(n,e){var t;return((t=n.Xh)==null?void 0:t.call(n,e))??[]}class pz{constructor(e,t){this.Lp=Fi({width:0,height:0}),this.mv=null,this.wv=null,this.gv=null,this.Mv=null,this.bv=!1,this.Sv=new Zs,this.xv=new Zs,this.Cv=0,this.Pv=!1,this.kv=null,this.yv=!1,this.Tv=null,this.Rv=null,this.Hp=!1,this.Up=()=>{this.Hp||this.Dv===null||this.ts().ar()},this.qp=()=>{this.Hp||this.Dv===null||this.ts().ar()},this.Dp=e,this.Dv=t,this.Dv.t_().i(this.Vv.bind(this),this,!0),this.Iv=document.createElement("td"),this.Iv.style.padding="0",this.Iv.style.position="relative";const r=document.createElement("div");r.style.width="100%",r.style.height="100%",r.style.position="relative",r.style.overflow="hidden",this.Bv=document.createElement("td"),this.Bv.style.padding="0",this.Ev=document.createElement("td"),this.Ev.style.padding="0",this.Iv.appendChild(r),this.Zp=B1(r,Fi({width:16,height:16})),this.Zp.subscribeSuggestedBitmapSizeChanged(this.Up);const i=this.Zp.canvasElement;i.style.position="absolute",i.style.zIndex="1",i.style.left="0",i.style.top="0",this.Gp=B1(r,Fi({width:16,height:16})),this.Gp.subscribeSuggestedBitmapSizeChanged(this.qp);const s=this.Gp.canvasElement;s.style.position="absolute",s.style.zIndex="2",s.style.left="0",s.style.top="0",this.qf=document.createElement("tr"),this.qf.appendChild(this.Bv),this.qf.appendChild(this.Iv),this.qf.appendChild(this.Ev),this.Av(),this.Of=new sM(this.Gp.canvasElement,this,{hf:()=>this.kv===null&&!this.Dp.N().handleScroll.vertTouchDrag,af:()=>this.kv===null&&!this.Dp.N().handleScroll.horzTouchDrag})}m(){this.mv!==null&&this.mv.m(),this.wv!==null&&this.wv.m(),this.gv=null,this.Gp.unsubscribeSuggestedBitmapSizeChanged(this.qp),L1(this.Gp.canvasElement),this.Gp.dispose(),this.Zp.unsubscribeSuggestedBitmapSizeChanged(this.Up),L1(this.Zp.canvasElement),this.Zp.dispose(),this.Dv!==null&&(this.Dv.t_().u(this),this.Dv.m()),this.Of.m()}hp(){return Pt(this.Dv)}zv(e){var t;this.Dv!==null&&this.Dv.t_().u(this),this.Dv=e,this.Dv!==null&&this.Dv.t_().i(pz.prototype.Vv.bind(this),this,!0),this.Av(),this.Dp.Uf().indexOf(this)===this.Dp.Uf().length-1?(this.gv=this.gv??new WQe(this.Iv,this.Dp),this.gv.kt()):((t=this.gv)==null||t.Ip(),this.gv=null)}$p(){return this.Dp}Xf(){return this.qf}Av(){if(this.Dv!==null&&(this.Lv(),this.ts().js().length!==0)){if(this.mv!==null){const e=this.Dv.Wo();this.mv._s(Pt(e))}if(this.wv!==null){const e=this.Dv.Ho();this.wv._s(Pt(e))}}}Ov(){this.mv!==null&&this.mv.kt(),this.wv!==null&&this.wv.kt()}Io(){return this.Dv!==null?this.Dv.Io():0}Bo(e){this.Dv&&this.Dv.Bo(e)}if(e){if(!this.Dv)return;this.Nv();const t=e.localX,r=e.localY;this.Fv(t,r,e)}bf(e){this.Nv(),this.Wv(),this.Fv(e.localX,e.localY,e)}sf(e){if(!this.Dv)return;this.Nv();const t=e.localX,r=e.localY;this.Fv(t,r,e)}vf(e){this.Dv!==null&&(this.Nv(),this.Hv(e))}Kd(e){this.Dv!==null&&this.Uv(this.xv,e)}$d(e){this.Kd(e)}uf(e){this.Nv(),this.$v(e),this.Fv(e.localX,e.localY,e)}pf(e){this.Dv!==null&&(this.Nv(),this.Pv=!1,this.qv(e))}ff(e){this.Dv!==null&&this.Hv(e)}If(e){if(this.Pv=!0,this.kv===null){const t={x:e.localX,y:e.localY};this.Yv(t,t,e)}}Vf(e){this.Dv!==null&&(this.Nv(),this.Dv.Qt().ac(null),this.jv())}Kv(){return this.Sv}Xv(){return this.xv}Pf(){this.Cv=1,this.ts().hn()}kf(e,t){if(!this.Dp.N().handleScale.pinch)return;const r=5*(t-this.Cv);this.Cv=t,this.ts().Mc(e._t,r)}gf(e){this.Pv=!1,this.yv=this.kv!==null,this.Wv();const t=this.ts()._c();this.kv!==null&&t.Vt()&&(this.Tv={x:t.si(),y:t.ni()},this.kv={x:e.localX,y:e.localY})}lf(e){if(this.Dv===null)return;const t=e.localX,r=e.localY;if(this.kv===null)this.$v(e);else{this.yv=!1;const i=Pt(this.Tv),s=i.x+(t-this.kv.x),o=i.y+(r-this.kv.y);this.Fv(s,o,e)}}df(e){this.$p().N().trackingMode.exitMode===0&&(this.yv=!0),this.Zv(),this.qv(e)}jn(e,t){const r=this.Dv;return r===null?null:Qce(r,e,t)}Gv(e,t){Pt(t==="left"?this.mv:this.wv).rv(Fi({width:e,height:this.Lp.height}))}Zf(){return this.Lp}rv(e){n1(this.Lp,e)||(this.Lp=e,this.Hp=!0,this.Zp.resizeCanvasElement(e),this.Gp.resizeCanvasElement(e),this.Hp=!1,this.Iv.style.width=e.width+"px",this.Iv.style.height=e.height+"px")}Jv(){const e=Pt(this.Dv);e.Fo(e.Wo()),e.Fo(e.Ho());for(const t of e.ba())if(e.Un(t)){const r=t.Ft();
8354r!==null&&e.Fo(r),t.Ns()}for(const t of e.s_())t.Ns()}Gf(){return this.Zp.bitmapSize}Jf(e,t,r){const i=this.Gf();i.width>0&&i.height>0&&e.drawImage(this.Zp.canvasElement,t,r)}av(e){if(e===0||this.Dv===null)return;e>1&&this.Jv(),this.mv!==null&&this.mv.av(e),this.wv!==null&&this.wv.av(e);const t={colorSpace:this.Dp.N().layout.colorSpace};if(e!==1){this.Zp.applySuggestedBitmapSize();const i=D1(this.Zp,t);i!==null&&(i.useBitmapCoordinateSpace(s=>{this.ov(s)}),this.Dv&&(this.Qv(i,HQe),this.tm(i),this.Qv(i,nX),this.Qv(i,rX)))}this.Gp.applySuggestedBitmapSize();const r=D1(this.Gp,t);r!==null&&(r.useBitmapCoordinateSpace(({context:i,bitmapSize:s})=>{i.clearRect(0,0,s.width,s.height)}),this.im(r),this.Qv(r,VQe),this.Qv(r,rX))}sm(){return this.mv}nm(){return this.wv}uv(e,t){this.Qv(e,t)}Vv(){this.Dv!==null&&this.Dv.t_().u(this),this.Dv=null}Hv(e){this.Uv(this.Sv,e)}Uv(e,t){const r=t.localX,i=t.localY;e.v()&&e.p(this.ts().Et().uu(r),{x:r,y:i},t)}ov({context:e,bitmapSize:t}){const{width:r,height:i}=t,s=this.ts(),o=s.$(),a=s.Fc();o===a?eM(e,0,0,r,i,a):jce(e,0,0,r,i,o,a)}tm(e){const t=Pt(this.Dv),r=t.i_().lr().Tt(t);r!==null&&r.nt(e,!1)}im(e){this.rm(e,nX,B6,this.ts()._c())}Qv(e,t){const r=Pt(this.Dv),i=r.Dt(),s=r.s_();for(const o of s)this.rm(e,t,LL,o);for(const o of i)this.rm(e,t,LL,o);for(const o of s)this.rm(e,t,B6,o);for(const o of i)this.rm(e,t,B6,o)}rm(e,t,r,i){const s=Pt(this.Dv),o=s.Qt().hc(),a=o!==null&&o.n_===i,c=o!==null&&a&&o.e_!==void 0?o.e_.Xn:void 0;$L(t,u=>r(u,e,a,c),i,s)}Lv(){if(this.Dv===null)return;const e=this.Dp,t=this.Dv.Wo().N().visible,r=this.Dv.Ho().N().visible;t||this.mv===null||(this.Bv.removeChild(this.mv.Xf()),this.mv.m(),this.mv=null),r||this.wv===null||(this.Ev.removeChild(this.wv.Xf()),this.wv.m(),this.wv=null);const i=e.Qt().Vc();t&&this.mv===null&&(this.mv=new tX(this,e.N(),i,"left"),this.Bv.appendChild(this.mv.Xf())),r&&this.wv===null&&(this.wv=new tX(this,e.N(),i,"right"),this.Ev.appendChild(this.wv.Xf()))}hm(e){return e.Bf&&this.Pv||this.kv!==null}am(e){return Math.max(0,Math.min(e,this.Lp.width-1))}lm(e){return Math.max(0,Math.min(e,this.Lp.height-1))}Fv(e,t,r){this.ts().yc(this.am(e),this.lm(t),r,Pt(this.Dv))}jv(){this.ts().Rc()}Zv(){this.yv&&(this.kv=null,this.jv())}Yv(e,t,r){this.kv=e,this.yv=!1,this.Fv(t.x,t.y,r);const i=this.ts()._c();this.Tv={x:i.si(),y:i.ni()}}ts(){return this.Dp.Qt()}qv(e){if(!this.bv)return;const t=this.ts(),r=this.hp();if(t.Ko(r,r.ys()),this.Mv=null,this.bv=!1,t.Cc(),this.Rv!==null){const i=performance.now(),s=t.Et();this.Rv.le(s.wu(),i),this.Rv.Tu(i)||t._n(this.Rv)}}Nv(){this.kv=null}Wv(){if(this.Dv){if(this.ts().hn(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)Pt(document.activeElement).blur();else{const e=document.getSelection();e!==null&&e.removeAllRanges()}!this.Dv.ys().Ki()&&this.ts().Et().Ki()}}$v(e){if(this.Dv===null)return;const t=this.ts(),r=t.Et();if(r.Ki())return;const i=this.Dp.N(),s=i.handleScroll,o=i.kineticScroll;if((!s.pressedMouseMove||e.Bf)&&(!s.horzTouchDrag&&!s.vertTouchDrag||!e.Bf))return;const a=this.Dv.ys(),c=performance.now();if(this.Mv!==null||this.hm(e)||(this.Mv={x:e.clientX,y:e.clientY,ed:c,om:e.localX,_m:e.localY}),this.Mv!==null&&!this.bv&&(this.Mv.x!==e.clientX||this.Mv.y!==e.clientY)){if(e.Bf&&o.touch||!e.Bf&&o.mouse){const u=r.vu();this.Rv=new FQe(.2/u,7/u,.997,15/u),this.Rv.Cp(r.wu(),this.Mv.ed)}else this.Rv=null;a.Ki()||t.Yo(this.Dv,a,e.localY),t.Sc(e.localX),this.bv=!0}this.bv&&(a.Ki()||t.jo(this.Dv,a,e.localY),t.xc(e.localX),this.Rv!==null&&this.Rv.Cp(r.wu(),c))}}class iX{constructor(e,t,r,i,s){this.xt=!0,this.Lp=Fi({width:0,height:0}),this.Up=()=>this.av(3),this.Yp=e==="left",this.Gu=r.Vc,this.Ps=t,this.um=i,this.dm=s,this.Yf=document.createElement("div"),this.Yf.style.width="25px",this.Yf.style.height="100%",this.Yf.style.overflow="hidden",this.Zp=B1(this.Yf,Fi({width:16,height:16})),this.Zp.subscribeSuggestedBitmapSizeChanged(this.Up)}m(){this.Zp.unsubscribeSuggestedBitmapSizeChanged(this.Up),L1(this.Zp.canvasElement),this.Zp.dispose()}Xf(){return this.Yf}Zf(){return this.Lp}rv(e){n1(this.Lp,e)||(this.Lp=e,this.Zp.resizeCanvasElement(e),this.Yf.style.width=`${e.width}px`,this.Yf.style.height=`${e.height}px`,this.xt=!0)}av(e){if(e<3&&!this.xt||this.Lp.width===0||this.Lp.height===0)return;this.xt=!1,this.Zp.applySuggestedBitmapSize();const t=D1(this.Zp,{colorSpace:this.Ps.layout.colorSpace});t!==null&&t.useBitmapCoordinateSpace(r=>{this.ov(r),this._v(r)})}Gf(){return this.Zp.bitmapSize}Jf(e,t,r){const i=this.Gf();i.width>0&&i.height>0&&e.drawImage(this.Zp.canvasElement,t,r)}_v({context:e,bitmapSize:t,horizontalPixelRatio:r,verticalPixelRatio:i}){if(!this.um())return;e.fillStyle=this.Ps.timeScale.borderColor;const s=Math.floor(this.Gu.N().S*r),o=Math.floor(this.Gu.N().S*i),a=this.Yp?t.width-s:0;e.fillRect(a,0,s,o)}ov({context:e,bitmapSize:t}){eM(e,0,0,t.width,t.height,this.dm())}}function gz(n){return e=>{var t;return((t=e.ia)==null?void 0:t.call(e,n))??[]}}const qQe=gz("normal"),KQe=gz("top"),YQe=gz("bottom");class GQe{constructor(e,t){this.fm=null,this.pm=null,this.M=null,this.vm=!1,this.Lp=Fi({width:0,height:0}),this.wm=new Zs,this.Np=new _8(5),this.Hp=!1,this.Up=()=>{this.Hp||this.Dp.Qt().ar()},this.qp=()=>{this.Hp||this.Dp.Qt().ar()},this.Dp=e,this.o_=t,this.Ps=e.N().layout,this.kp=document.createElement("tr"),this.gm=document.createElement("td"),this.gm.style.padding="0",this.Mm=document.createElement("td"),this.Mm.style.padding="0",this.Yf=document.createElement("td"),this.Yf.style.height="25px",this.Yf.style.padding="0",this.bm=document.createElement("div"),this.bm.style.width="100%",this.bm.style.height="100%",this.bm.style.position="relative",this.bm.style.overflow="hidden",this.Yf.appendChild(this.bm),this.Zp=B1(this.bm,Fi({width:16,height:16})),this.Zp.subscribeSuggestedBitmapSizeChanged(this.Up);const r=this.Zp.canvasElement;r.style.position="absolute",r.style.zIndex="1",r.style.left="0",r.style.top="0",this.Gp=B1(this.bm,Fi({width:16,height:16})),this.Gp.subscribeSuggestedBitmapSizeChanged(this.qp);const i=this.Gp.canvasElement;i.style.position="absolute",i.style.zIndex="2",i.style.left="0",i.style.top="0",this.kp.appendChild(this.gm),this.kp.appendChild(this.Yf),this.kp.appendChild(this.Mm),this.Sm(),this.Dp.Qt().Vo().i(this.Sm.bind(this),this),this.Of=new sM(this.Gp.canvasElement,this,{hf:()=>!0,af:()=>!this.Dp.N().handleScroll.horzTouchDrag})}m(){this.Of.m(),this.fm!==null&&this.fm.m(),this.pm!==null&&this.pm.m(),this.Gp.unsubscribeSuggestedBitmapSizeChanged(this.qp),L1(this.Gp.canvasElement),this.Gp.dispose(),this.Zp.unsubscribeSuggestedBitmapSizeChanged(this.Up),L1(this.Zp.canvasElement),this.Zp.dispose()}Xf(){return this.kp}xm(){return this.fm}Cm(){return this.pm}bf(e){if(this.vm)return;this.vm=!0;const t=this.Dp.Qt();!t.Et().Ki()&&this.Dp.N().handleScale.axisPressedMouseMove.time&&t.gc(e.localX)}gf(e){this.bf(e)}Sf(){const e=this.Dp.Qt();!e.Et().Ki()&&this.vm&&(this.vm=!1,this.Dp.N().handleScale.axisPressedMouseMove.time&&e.kc())}uf(e){const t=this.Dp.Qt();!t.Et().Ki()&&this.Dp.N().handleScale.axisPressedMouseMove.time&&t.Pc(e.localX)}lf(e){this.uf(e)}pf(){this.vm=!1;const e=this.Dp.Qt();e.Et().Ki()&&!this.Dp.N().handleScale.axisPressedMouseMove.time||e.kc()}df(){this.pf()}Kd(){this.Dp.N().handleScale.axisDoubleClickReset.time&&this.Dp.Qt().cn()}$d(){this.Kd()}if(){this.Dp.Qt().N().handleScale.axisPressedMouseMove.time&&this.pv(1)}Vf(){this.pv(0)}Zf(){return this.Lp}Pm(){return this.wm}km(e,t,r){n1(this.Lp,e)||(this.Lp=e,this.Hp=!0,this.Zp.resizeCanvasElement(e),this.Gp.resizeCanvasElement(e),this.Hp=!1,this.Yf.style.width=`${e.width}px`,this.Yf.style.height=`${e.height}px`,this.wm.p(e)),this.fm!==null&&this.fm.rv(Fi({width:t,height:e.height})),this.pm!==null&&this.pm.rv(Fi({width:r,height:e.height}))}ym(){const e=this.Tm();return Math.ceil(e.S+e.C+e.P+e.A+e.V+e.Rm)}kt(){this.Dp.Qt().Et().Va()}Gf(){return this.Zp.bitmapSize}Jf(e,t,r){const i=this.Gf();i.width>0&&i.height>0&&e.drawImage(this.Zp.canvasElement,t,r)}av(e){if(e===0)return;const t={colorSpace:this.Ps.colorSpace};if(e!==1){this.Zp.applySuggestedBitmapSize();const i=D1(this.Zp,t);i!==null&&(i.useBitmapCoordinateSpace(s=>{this.ov(s),this._v(s),this.Dm(i,YQe)}),this.cv(i),this.Dm(i,qQe)),this.fm!==null&&this.fm.av(e),this.pm!==null&&this.pm.av(e)}this.Gp.applySuggestedBitmapSize();const r=D1(this.Gp,t);r!==null&&(r.useBitmapCoordinateSpace(({context:i,bitmapSize:s})=>{i.clearRect(0,0,s.width,s.height)}),this.Vm([...this.Dp.Qt().js(),this.Dp.Qt()._c()],r),this.Dm(r,KQe))}Dm(e,t){const r=this.Dp.Qt().js();for(const i of r)$L(t,s=>LL(s,e,!1,void 0),i,void 0);for(const i of r)$L(t,s=>B6(s,e,!1,void 0),i,void 0)}ov({context:e,bitmapSize:t}){eM(e,0,0,t.width,t.height,this.Dp.Qt().Fc())}_v({context:e,bitmapSize:t,verticalPixelRatio:r}){if(this.Dp.N().timeScale.borderVisible){e.fillStyle=this.Im();const i=Math.max(1,Math.floor(this.Tm().S*r));e.fillRect(0,0,t.width,i)}}cv(e){const t=this.Dp.Qt().Et(),r=t.Va();if(!r||r.length===0)return;const i=this.o_.maxTickMarkWeight(r),s=this.Tm(),o=t.N();o.borderVisible&&o.ticksVisible&&e.useBitmapCoordinateSpace(({context:a,horizontalPixelRatio:c,verticalPixelRatio:u})=>{a.strokeStyle=this.Im(),a.fillStyle=this.Im();const d=Math.max(1,Math.floor(c)),f=Math.floor(.5*c);a.beginPath();const m=Math.round(s.C*u);for(let w=r.length;w--;){const y=Math.round(r[w].coord*c);a.rect(y-f,0,d,m)}a.fill()}),e.useMediaCoordinateSpace(({context:a})=>{const c=s.S+s.C+s.A+s.P/2;a.textAlign="center",a.textBaseline="middle",a.fillStyle=this.H(),a.font=this.nv();for(const u of r)if(u.weight<i){const d=u.needAlignCoordinate?this.Bm(a,u.coord,u.label):u.coord;a.fillText(u.label,d,c)}this.Dp.N().timeScale.allowBoldLabels&&(a.font=this.Em());for(const u of r)if(u.weight>=i){const d=u.needAlignCoordinate?this.Bm(a,u.coord,u.label):u.coord;a.fillText(u.label,d,c)}})}Bm(e,t,r){const i=this.Np.Vi(e,r),s=i/2,o=Math.floor(t-s)+.5;return o<0?t+=Math.abs(0-o):o+i>this.Lp.width&&(t-=Math.abs(this.Lp.width-(o+i))),t}Vm(e,t){const r=this.Tm();for(const i of e)for(const s of i.cs())s.Tt().nt(t,r)}Im(){return this.Dp.N().timeScale.borderColor}H(){return this.Ps.textColor}F(){return this.Ps.fontSize}nv(){return S8(this.F(),this.Ps.fontFamily)}Em(){return S8(this.F(),this.Ps.fontFamily,"bold")}Tm(){this.M===null&&(this.M={S:1,L:NaN,A:NaN,V:NaN,Ji:NaN,C:5,P:NaN,k:"",Gi:new _8,Rm:0});const e=this.M,t=this.nv();if(e.k!==t){const r=this.F();e.P=r,e.k=t,e.A=3*r/12,e.V=3*r/12,e.Ji=9*r/12,e.L=0,e.Rm=4*r/12,e.Gi.In()}return this.M}pv(e){this.Yf.style.cursor=e===1?"ew-resize":"default"}Sm(){const e=this.Dp.Qt(),t=e.N();t.leftPriceScale.visible||this.fm===null||(this.gm.removeChild(this.fm.Xf()),this.fm.m(),this.fm=null),t.rightPriceScale.visible||this.pm===null||(this.Mm.removeChild(this.pm.Xf()),this.pm.m(),this.pm=null);const r={Vc:this.Dp.Qt().Vc()},i=()=>t.leftPriceScale.borderVisible&&e.Et().N().borderVisible,s=()=>e.Fc();t.leftPriceScale.visible&&this.fm===null&&(this.fm=new iX("left",t,r,i,s),this.gm.appendChild(this.fm.Xf())),t.rightPriceScale.visible&&this.pm===null&&(this.pm=new iX("right",t,r,i,s),this.Mm.appendChild(this.pm.Xf()))}}var mX;const ZQe=!!Hx&&!!navigator.userAgentData&&navigator.userAgentData.brands.some(n=>n.brand.includes("Chromium"))&&!!Hx&&((mX=navigator==null?void 0:navigator.userAgentData)!=null&&mX.platform?navigator.userAgentData.platform==="Windows":navigator.userAgent.toLowerCase().indexOf("win")>=0);class QQe{constructor(e,t,r){var i;this.Am=[],this.zm=[],this.Lm=0,this.sl=0,this.Mo=0,this.Om=0,this.Nm=0,this.Fm=null,this.Wm=!1,this.Sv=new Zs,this.xv=new Zs,this.Ku=new Zs,this.Hm=null,this.Um=null,this.Rp=e,this.Ps=t,this.o_=r,this.kp=document.createElement("div"),this.kp.classList.add("tv-lightweight-charts"),this.kp.style.overflow="hidden",this.kp.style.direction="ltr",this.kp.style.width="100%",this.kp.style.height="100%",(i=this.kp).style.userSelect="none",i.style.webkitUserSelect="none",i.style.msUserSelect="none",i.style.MozUserSelect="none",i.style.webkitTapHighlightColor="transparent",this.$m=document.createElement("table"),this.$m.setAttribute("cellspacing","0"),this.kp.appendChild(this.$m),this.qm=this.Ym.bind(this),ED(this.Ps)&&this.jm(!0),this.ts=new DQe(this.Zu.b
8354ind(this),this.Ps,r),this.Qt().uc().i(this.Km.bind(this),this),this.Xm=new GQe(this,this.o_),this.$m.appendChild(this.Xm.Xf());const s=t.autoSize&&this.Zm();let o=this.Ps.width,a=this.Ps.height;if(s||o===0||a===0){const c=e.getBoundingClientRect();o=o||c.width,a=a||c.height}this.Gm(o,a),this.Jm(),e.appendChild(this.kp),this.Qm(),this.ts.Et().Iu().i(this.ts.Bh.bind(this.ts),this),this.ts.Vo().i(this.ts.Bh.bind(this.ts),this)}Qt(){return this.ts}N(){return this.Ps}Uf(){return this.Am}tw(){return this.Xm}m(){this.jm(!1),this.Lm!==0&&window.cancelAnimationFrame(this.Lm),this.ts.uc().u(this),this.ts.Et().Iu().u(this),this.ts.Vo().u(this),this.ts.m();for(const e of this.Am)this.$m.removeChild(e.Xf()),e.Kv().u(this),e.Xv().u(this),e.m();this.Am=[];for(const e of this.zm)this.iw(e);this.zm=[],Pt(this.Xm).m(),this.kp.parentElement!==null&&this.kp.parentElement.removeChild(this.kp),this.Ku.m(),this.Sv.m(),this.xv.m(),this.sw()}Gm(e,t,r=!1){if(this.sl===t&&this.Mo===e)return;const i=function(a){const c=Math.floor(a.width),u=Math.floor(a.height);return Fi({width:c-c%2,height:u-u%2})}(Fi({width:e,height:t}));this.sl=i.height,this.Mo=i.width;const s=this.sl+"px",o=this.Mo+"px";Pt(this.kp).style.height=s,Pt(this.kp).style.width=o,this.$m.style.height=s,this.$m.style.width=o,r?this.nw(Zo.gn(),performance.now()):this.ts.Bh()}av(e){e===void 0&&(e=Zo.gn());for(let t=0;t<this.Am.length;t++)this.Am[t].av(e.en(t).tn);this.Ps.timeScale.visible&&this.Xm.av(e.nn())}hr(e){var i;const t=ED(this.Ps);this.ts.hr(e);const r=ED(this.Ps);r!==t&&this.jm(r),(i=e.layout)!=null&&i.panes&&this.ew(),this.Qm(),this.rw(e)}Kv(){return this.Sv}Xv(){return this.xv}uc(){return this.Ku}hw(){this.Fm!==null&&(this.nw(this.Fm,performance.now()),this.Fm=null);const e=this.aw(null),t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=Pt(t.getContext("2d"));return this.aw(r),t}lw(e){return e==="left"&&!this.ow()||e==="right"&&!this._w()||this.Am.length===0?0:Pt(e==="left"?this.Am[0].sm():this.Am[0].nm()).hv()}uw(){return this.Ps.autoSize&&this.Hm!==null}tp(){return this.kp}cw(e){this.Um=e,this.Um?this.tp().style.setProperty("cursor",e):this.tp().style.removeProperty("cursor")}dw(){return this.Um}fw(e){return ml(this.Am[e]).Zf()}ew(){this.zm.forEach(e=>{e.kt()})}rw(e){(e.autoSize!==void 0||!this.Hm||e.width===void 0&&e.height===void 0)&&(e.autoSize&&!this.Hm&&this.Zm(),e.autoSize===!1&&this.Hm!==null&&this.sw(),e.autoSize||e.width===void 0&&e.height===void 0||this.Gm(e.width||this.Mo,e.height||this.sl))}aw(e){let t=0,r=0;const i=this.Am[0],s=(a,c)=>{let u=0;for(let d=0;d<this.Am.length;d++){const f=this.Am[d],m=Pt(a==="left"?f.sm():f.nm()),w=m.Gf();if(e!==null&&m.Jf(e,c,u),u+=w.height,d<this.Am.length-1){const y=this.zm[d],b=y.Gf();e!==null&&y.Jf(e,c,u),u+=b.height}}};this.ow()&&(s("left",0),t+=Pt(i.sm()).Gf().width);for(let a=0;a<this.Am.length;a++){const c=this.Am[a],u=c.Gf();if(e!==null&&c.Jf(e,t,r),r+=u.height,a<this.Am.length-1){const d=this.zm[a],f=d.Gf();e!==null&&d.Jf(e,t,r),r+=f.height}}t+=i.Gf().width,this._w()&&(s("right",t),t+=Pt(i.nm()).Gf().width);const o=(a,c,u)=>{Pt(a==="left"?this.Xm.xm():this.Xm.Cm()).Jf(Pt(e),c,u)};if(this.Ps.timeScale.visible){const a=this.Xm.Gf();if(e!==null){let c=0;this.ow()&&(o("left",c,r),c=Pt(i.sm()).Gf().width),this.Xm.Jf(e,c,r),c+=a.width,this._w()&&o("right",c,r)}r+=a.height}return Fi({width:t,height:r})}pw(){let e=0,t=0,r=0;for(const E of this.Am)this.ow()&&(t=Math.max(t,Pt(E.sm()).sv(),this.Ps.leftPriceScale.minimumWidth)),this._w()&&(r=Math.max(r,Pt(E.nm()).sv(),this.Ps.rightPriceScale.minimumWidth)),e+=E.Io();t=BL(t),r=BL(r);const i=this.Mo,s=this.sl,o=Math.max(i-t-r,0),a=1*this.zm.length,c=this.Ps.timeScale.visible;let u=c?Math.max(this.Xm.ym(),this.Ps.timeScale.minimumHeight):0;var d;u=(d=u)+d%2;const f=a+u,m=s<f?0:s-f,w=m/e;let y=0;const b=window.devicePixelRatio||1;for(let E=0;E<this.Am.length;++E){const T=this.Am[E];T.zv(this.ts.$s()[E]);let N=0,I=0;I=E===this.Am.length-1?Math.ceil((m-y)*b)/b:Math.round(T.Io()*w*b)/b,N=Math.max(I,2),y+=N,T.rv(Fi({width:o,height:N})),this.ow()&&T.Gv(t,"left"),this._w()&&T.Gv(r,"right"),T.hp()&&this.ts.cc(T.hp(),N)}this.Xm.km(Fi({width:c?o:0,height:u}),c?t:0,c?r:0),this.ts.Eo(o),this.Om!==t&&(this.Om=t),this.Nm!==r&&(this.Nm=r)}jm(e){e?this.kp.addEventListener("wheel",this.qm,{passive:!1}):this.kp.removeEventListener("wheel",this.qm)}mw(e){switch(e.deltaMode){case e.DOM_DELTA_PAGE:return 120;case e.DOM_DELTA_LINE:return 32}return ZQe?1/window.devicePixelRatio:1}Ym(e){if(!(e.deltaX!==0&&this.Ps.handleScroll.mouseWheel||e.deltaY!==0&&this.Ps.handleScale.mouseWheel))return;const t=this.mw(e),r=t*e.deltaX/100,i=-t*e.deltaY/100;if(e.cancelable&&e.preventDefault(),i!==0&&this.Ps.handleScale.mouseWheel){const s=Math.sign(i)*Math.min(1,Math.abs(i)),o=e.clientX-this.kp.getBoundingClientRect().left;this.Qt().Mc(o,s)}r!==0&&this.Ps.handleScroll.mouseWheel&&this.Qt().bc(-80*r)}nw(e,t){var i;const r=e.nn();r===3&&this.ww(),r!==3&&r!==2||(this.gw(e),this.Mw(e,t),this.Xm.kt(),this.Am.forEach(s=>{s.Ov()}),((i=this.Fm)==null?void 0:i.nn())===3&&(this.Fm.vn(e),this.ww(),this.gw(this.Fm),this.Mw(this.Fm,t),e=this.Fm,this.Fm=null)),this.av(e)}Mw(e,t){for(const r of e.pn())this.mn(r,t)}gw(e){const t=this.ts.$s();for(let r=0;r<t.length;r++)e.en(r).sn&&t[r].Go()}mn(e,t){const r=this.ts.Et();switch(e.an){case 0:r.Eu();break;case 1:r.Au(e.Wt);break;case 2:r.dn(e.Wt);break;case 3:r.fn(e.Wt);break;case 4:r.bu();break;case 5:e.Wt.Tu(t)||r.fn(e.Wt.Ru(t))}}Zu(e){this.Fm!==null?this.Fm.vn(e):this.Fm=e,this.Wm||(this.Wm=!0,this.Lm=window.requestAnimationFrame(t=>{if(this.Wm=!1,this.Lm=0,this.Fm!==null){const r=this.Fm;this.Fm=null,this.nw(r,t);for(const i of r.pn())if(i.an===5&&!i.Wt.Tu(t)){this.Qt()._n(i.Wt);break}}}))}ww(){this.Jm()}iw(e){this.$m.removeChild(e.Xf()),e.m()}Jm(){const e=this.ts.$s(),t=e.length,r=this.Am.length;for(let i=t;i<r;i++){const s=ml(this.Am.pop());this.$m.removeChild(s.Xf()),s.Kv().u(this),s.Xv().u(this),s.m();const o=this.zm.pop();o!==void 0&&this.iw(o)}for(let i=r;i<t;i++){const s=new pz(this,e[i]);if(s.Kv().i(this.bw.bind(this,s),this),s.Xv().i(this.Sw.bind(this,s),this),this.Am.push(s),i>0){const o=new zQe(this,i-1,i);this.zm.push(o),this.$m.insertBefore(o.Xf(),this.Xm.Xf())}this.$m.insertBefore(s.Xf(),this.Xm.Xf())}for(let i=0;i<t;i++){const s=e[i],o=this.Am[i];o.hp()!==s?o.zv(s):o.Av()}this.Qm(),this.pw()}xw(e,t,r,i){var f;const s=new Map;
8354e!==null&&this.ts.js().forEach(m=>{const w=m.Xs().Fr(e);w!==null&&s.set(m,w)});let o;if(e!==null){const m=(f=this.ts.Et().ss(e))==null?void 0:f.originalTime;m!==void 0&&(o=m)}const a=this.Qt().hc(),c=a!==null&&a.n_ instanceof iM?a.n_:void 0,u=a!==null&&a.e_!==void 0?a.e_.Kn:void 0,d=this.Cw(i);return{Pw:o,Re:e??void 0,kw:t??void 0,yw:d!==-1?d:void 0,Tw:c,Rw:s,Dw:u,Vw:r??void 0}}Cw(e){let t=-1;if(e)t=this.Am.indexOf(e);else{const r=this.Qt()._c().Us();r!==null&&(t=this.Qt().$s().indexOf(r))}return t}bw(e,t,r,i){this.Sv.p(()=>this.xw(t,r,i,e))}Sw(e,t,r,i){this.xv.p(()=>this.xw(t,r,i,e))}Km(e,t,r){var i;this.cw(((i=this.Qt().hc())==null?void 0:i.h_)??null),this.Ku.p(()=>this.xw(e,t,r))}Qm(){const e=this.Ps.timeScale.visible?"":"none";this.Xm.Xf().style.display=e}ow(){return this.Am[0].hp().Wo().N().visible}_w(){return this.Am[0].hp().Ho().N().visible}Zm(){return"ResizeObserver"in window&&(this.Hm=new ResizeObserver(e=>{const t=e[e.length-1];t&&this.Gm(t.contentRect.width,t.contentRect.height)}),this.Hm.observe(this.Rp,{box:"border-box"}),!0)}sw(){this.Hm!==null&&this.Hm.disconnect(),this.Hm=null}}function ED(n){return!!(n.handleScroll.mouseWheel||n.handleScale.mouseWheel)}function XQe(n){return n.open===void 0&&n.value===void 0}function JQe(n){return function(e){return e.open!==void 0}(n)||function(e){return e.value!==void 0}(n)}function sX(n,e,t,r){const i=t.value,s={Re:e,wt:n,Wt:[i,i,i,i],Pw:r};return t.color!==void 0&&(s.R=t.color),s}function eXe(n,e,t,r){const i=t.value,s={Re:e,wt:n,Wt:[i,i,i,i],Pw:r};return t.lineColor!==void 0&&(s.vt=t.lineColor),t.topColor!==void 0&&(s.mr=t.topColor),t.bottomColor!==void 0&&(s.wr=t.bottomColor),s}function tXe(n,e,t,r){const i=t.value,s={Re:e,wt:n,Wt:[i,i,i,i],Pw:r};return t.topLineColor!==void 0&&(s.gr=t.topLineColor),t.bottomLineColor!==void 0&&(s.Mr=t.bottomLineColor),t.topFillColor1!==void 0&&(s.br=t.topFillColor1),t.topFillColor2!==void 0&&(s.Sr=t.topFillColor2),t.bottomFillColor1!==void 0&&(s.Cr=t.bottomFillColor1),t.bottomFillColor2!==void 0&&(s.Pr=t.bottomFillColor2),s}function nXe(n,e,t,r){const i={Re:e,wt:n,Wt:[t.open,t.high,t.low,t.close],Pw:r};return t.color!==void 0&&(i.R=t.color),i}function rXe(n,e,t,r){const i={Re:e,wt:n,Wt:[t.open,t.high,t.low,t.close],Pw:r};return t.color!==void 0&&(i.R=t.color),t.borderColor!==void 0&&(i.Ht=t.borderColor),t.wickColor!==void 0&&(i.vr=t.wickColor),i}function iXe(n,e,t,r,i){const s=ml(i)(t),o=Math.max(...s),a=Math.min(...s),c=s[s.length-1],u=[c,o,a,c],{time:d,color:f,...m}=t;return{Re:e,wt:n,Wt:u,Pw:r,se:m,R:f}}function YA(n){return n.Wt!==void 0}function oX(n,e){return e.customValues!==void 0&&(n.Iw=e.customValues),n}function dy(n){return(e,t,r,i,s,o)=>function(a,c){return c?c(a):XQe(a)}(r,o)?oX({wt:e,Re:t,Pw:i},r):oX(n(e,t,r,i,s),r)}function aX(n){return{Candlestick:dy(rXe),Bar:dy(nXe),Area:dy(eXe),Baseline:dy(tXe),Histogram:dy(sX),Line:dy(sX),Custom:dy(iXe)}[n]}function cX(n){return{Re:0,Bw:new Map,Hh:n}}function lX(n,e){if(n!==void 0&&n.length!==0)return{Ew:e.key(n[0].wt),Aw:e.key(n[n.length-1].wt)}}function uX(n){let e;return n.forEach(t=>{e===void 0&&(e=t.Pw)}),ml(e)}class sXe{constructor(e){this.zw=new Map,this.Lw=new Map,this.Ow=new Map,this.Nw=[],this.o_=e}m(){this.zw.clear(),this.Lw.clear(),this.Ow.clear(),this.Nw=[]}Fw(e,t){let r=this.zw.size!==0,i=!1;const s=this.Lw.get(e);if(s!==void 0)if(this.Lw.size===1)r=!1,i=!0,this.zw.clear();else for(const c of this.Nw)c.pointData.Bw.delete(e)&&(i=!0);let o=[];if(t.length!==0){const c=t.map(w=>w.time),u=this.o_.createConverterToInternalObj(t),d=aX(e.Rr()),f=e.da(),m=e.pa();o=t.map((w,y)=>{const b=u(w.time),E=this.o_.key(b);let T=this.zw.get(E);T===void 0&&(T=cX(b),this.zw.set(E,T),i=!0);const N=d(b,T.Re,w,c[y],f,m);return T.Bw.set(e,N),N})}r&&this.Ww(),this.Hw(e,o);let a=-1;if(i){const c=[];this.zw.forEach(u=>{c.push({timeWeight:0,time:u.Hh,pointData:u,originalTime:uX(u.Bw)})}),c.sort((u,d)=>this.o_.key(u.time)-this.o_.key(d.time)),a=this.Uw(c)}return this.$w(e,a,function(c,u,d){const f=lX(c,d),m=lX(u,d);if(f!==void 0&&m!==void 0)return{qw:!1,zh:f.Aw>=m.Aw&&f.Ew>=m.Ew}}(this.Lw.get(e),s,this.o_))}Ec(e){return this.Fw(e,[])}Yw(e,t,r){const i=t;(function(E){E.Pw===void 0&&(E.Pw=E.time)})(i),this.o_.preprocessData(t);const s=this.o_.createConverterToInternalObj([t])(t.time),o=this.Ow.get(e);if(!r&&o!==void 0&&this.o_.key(s)<this.o_.key(o))throw new Error(`Cannot update oldest data, last time=${o}, new time=${s}`);let a=this.zw.get(this.o_.key(s));if(r&&a===void 0)throw new Error("Cannot update non-existing data point when historicalUpdate is true");const c=a===void 0;a===void 0&&(a=cX(s),this.zw.set(this.o_.key(s),a));const u=aX(e.Rr()),d=e.da(),f=e.pa(),m=u(s,a.Re,t,i.Pw,d,f);a.Bw.set(e,m),r?this.jw(e,m,a.Re):this.Kw(e,m);const w={zh:YA(m),qw:r};if(!c)return this.$w(e,-1,w);const y={timeWeight:0,time:a.Hh,pointData:a,originalTime:uX(a.Bw)},b=Wx(this.Nw,this.o_.key(y.time),(E,T)=>this.o_.key(E.time)<T);this.Nw.splice(b,0,y);for(let E=b;E<this.Nw.length;++E)AD(this.Nw[E].pointData,E);return this.o_.fillWeightsForPoints(this.Nw,b),this.$w(e,b,w)}Kw(e,t){let r=this.Lw.get(e);r===void 0&&(r=[],this.Lw.set(e,r));const i=r.length!==0?r[r.length-1]:null;i===null||this.o_.key(t.wt)>this.o_.key(i.wt)?YA(t)&&r.push(t):YA(t)?r[r.length-1]=t:r.splice(-1,1),this.Ow.set(e,t.wt)}jw(e,t,r){const i=this.Lw.get(e);if(i===void 0)return;const s=Wx(i,r,(o,a)=>o.Re<a);YA(t)?i[s]=t:i.splice(s,1)}Hw(e,t){t.length!==0?(this.Lw.set(e,t.filter(YA)),this.Ow.set(e,t[t.length-1].wt)):(this.Lw.delete(e),this.Ow.delete(e))}Ww(){for(const e of this.Nw)e.pointData.Bw.size===0&&this.zw.delete(this.o_.key(e.time))}Uw(e){let t=-1;for(let r=0;r<this.Nw.length&&r<e.length;++r){const i=this.Nw[r],s=e[r];if(this.o_.key(i.time)!==this.o_.key(s.time)){t=r;break}s.timeWeight=i.timeWeight,AD(s.pointData,r)}if(t===-1&&this.Nw.length!==e.length&&(t=Math.min(this.Nw.length,e.length)),t===-1)return-1;for(let r=t;r<e.length;++r)AD(e[r].pointData,r);return this.o_.fillWeightsForPoints(e,t),this.Nw=e,t}Xw(){if(this.Lw.size===0)return null;let e=0;return this.Lw.forEach(t=>{t.length!==0&&(e=Math.max(e,t[t.length-1].Re))}),e}$w(e,t,r){const i={Oo:new Map,Et:{ou:this.Xw()}};if(t!==-1)this.Lw.forEach((s,o)=>{i.Oo.set(o,{se:s,Zw:o===e?r:void 0})}),this.Lw.has(e)||i.Oo.set(e,{se:[],Zw:r}),i.Et.Gw=this.Nw,i.Et.Jw=t;else{const s=this.Lw.get(e);i.Oo.set(e,{se:s||[],Zw:r})}return i}}function AD(n,e){n.Re=e,n.Bw.forEach(t=>{t.Re=e})}function oXe(n,e){return n.wt<e}function aXe(n,e){return e<n.wt}function cXe(n,e,t){const r=e.Uh(),i=e.bi(),s=Wx(n,r,oXe),o=Kce(n,i,aXe);if(!t)return{from:s,to:o};let a=s,c=o;return s>0&&s<n.length&&n[s].wt>=r&&(a=s-1),o>0&&o<n.length&&n[o-1].wt<=i&&(c=o+1),{from:a,to:c}}class lXe{constructor(e,t,r){this.Qw=!0,this.tg=!0,this.ig=!0,this.sg=[],this.ng=null,this.Jn=e,this.Qn=t,this.eg=r}kt(e){this.Qw=!0,e==="data"&&(this.tg=!0),e==="options"&&(this.ig=!0)}Tt(){return this.Jn.Vt()?(this.rg(),this.ng===null?null:this.hg):null}ag(){this.sg=this.sg.map(e=>({...e,...this.Jn.Rh().Dr(e.wt)}
8354))}lg(){this.ng=null}rg(){this.tg&&(this.og(),this.tg=!1),this.ig&&(this.ag(),this.ig=!1),this.Qw&&(this._g(),this.Qw=!1)}_g(){const e=this.Jn.Ft(),t=this.Qn.Et();if(this.lg(),t.Ki()||e.Ki())return;const r=t.Pe();if(r===null||this.Jn.Xs().zr()===0)return;const i=this.Jn.zt();i!==null&&(this.ng=cXe(this.sg,r,this.eg),this.ug(e,t,i.Wt),this.cg())}}class uXe{constructor(e,t){this.dg=e,this.Yi=t}nt(e,t,r){this.dg.draw(e,this.Yi,t,r)}}class dXe extends lXe{constructor(e,t,r){super(e,t,!1),this.sh=r,this.hg=new uXe(this.sh.renderer(),i=>{const s=e.zt();return s===null?null:e.Ft().Nt(i,s.Wt)})}fa(e){return this.sh.priceValueBuilder(e)}va(e){return this.sh.isWhitespace(e)}og(){const e=this.Jn.Rh();this.sg=this.Jn.Xs().Hr().map(t=>({wt:t.Re,_t:NaN,...e.Dr(t.Re),fg:t.se}))}ug(e,t){t._u(this.sg,OZe(this.ng))}cg(){this.sh.update({bars:this.sg.map(hXe),barSpacing:this.Qn.Et().vu(),visibleRange:this.ng},this.Jn.N())}}function hXe(n){return{x:n._t,time:n.wt,originalData:n.fg,barColor:n.cr}}const fXe={color:"#2196f3"},pXe=(n,e,t)=>{const r=r0(t);return new dXe(n,e,r)};function mz(n){const e={value:n.Wt[3],time:n.Pw};return n.Iw!==void 0&&(e.customValues=n.Iw),e}function dX(n){const e=mz(n);return n.R!==void 0&&(e.color=n.R),e}function gXe(n){const e=mz(n);return n.vt!==void 0&&(e.lineColor=n.vt),n.mr!==void 0&&(e.topColor=n.mr),n.wr!==void 0&&(e.bottomColor=n.wr),e}function mXe(n){const e=mz(n);return n.gr!==void 0&&(e.topLineColor=n.gr),n.Mr!==void 0&&(e.bottomLineColor=n.Mr),n.br!==void 0&&(e.topFillColor1=n.br),n.Sr!==void 0&&(e.topFillColor2=n.Sr),n.Cr!==void 0&&(e.bottomFillColor1=n.Cr),n.Pr!==void 0&&(e.bottomFillColor2=n.Pr),e}function ele(n){const e={open:n.Wt[0],high:n.Wt[1],low:n.Wt[2],close:n.Wt[3],time:n.Pw};return n.Iw!==void 0&&(e.customValues=n.Iw),e}function wXe(n){const e=ele(n);return n.R!==void 0&&(e.color=n.R),e}function yXe(n){const e=ele(n),{R:t,Ht:r,vr:i}=n;return t!==void 0&&(e.color=t),r!==void 0&&(e.borderColor=r),i!==void 0&&(e.wickColor=i),e}function UL(n){return{Area:gXe,Line:dX,Baseline:mXe,Histogram:dX,Bar:wXe,Candlestick:yXe,Custom:bXe}[n]}function bXe(n){const e=n.Pw;return{...n.se,time:e}}const vXe={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},xXe={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},EXe={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:Uce,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},SD={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0,ensureEdgeTickMarksVisible:!1},AXe={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1};function hX(){return{addDefaultPane:!0,width:0,height:0,autoSize:!1,layout:EXe,crosshair:vXe,grid:xXe,overlayPriceScales:{...SD},leftPriceScale:{...SD,visible:!1},rightPriceScale:{...SD,visible:!0},timeScale:AXe,localization:{locale:Hx?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class tle{constructor(e,t,r){this.Wf=e,this.pg=t,this.vg=r??0}applyOptions(e){this.Wf.Qt().lc(this.pg,e,this.vg)}options(){return this.Yi().N()}width(){return nM(this.pg)?this.Wf.lw(this.pg):0}setVisibleRange(e){this.setAutoScale(!1),this.Yi().Wl(new Ec(e.from,e.to))}getVisibleRange(){const e=this.Yi().Qe();return e===null?null:{from:e.$e(),to:e.qe()}}setAutoScale(e){this.applyOptions({autoScale:e})}Yi(){return Pt(this.Wf.Qt().oc(this.pg,this.vg)).Ft}}
8354class SXe{constructor(e,t,r,i){this.Wf=e,this.Pt=r,this.mg=t,this.wg=i}getHeight(){return this.Pt.$t()}setHeight(e){const t=this.Wf.Qt(),r=t.Hc(this.Pt);t.fc(r,e)}getStretchFactor(){return this.Pt.Io()}setStretchFactor(e){this.Pt.Bo(e),this.Wf.Qt().Bh()}paneIndex(){return this.Wf.Qt().Hc(this.Pt)}moveTo(e){const t=this.paneIndex();t!==e&&(oa(e>=0&&e<this.Wf.Uf().length,"Invalid pane index"),this.Wf.Qt().mc(t,e))}getSeries(){return this.Pt.Oo().map(e=>this.mg(e))??[]}getHTMLElement(){const e=this.Wf.Uf();return e&&e.length!==0&&e[this.paneIndex()]?e[this.paneIndex()].Xf():null}attachPrimitive(e){this.Pt.ua(e),e.attached&&e.attached({chart:this.wg,requestUpdate:()=>this.Pt.Qt().Bh()})}detachPrimitive(e){this.Pt.ca(e)}priceScale(e){if(this.Pt.Do(e)===null)throw new Error(`Cannot find price scale with id: ${e}`);return new tle(this.Wf,e,this.paneIndex())}setPreserveEmptyPane(e){this.Pt.zo(e)}preserveEmptyPane(){return this.Pt.Lo()}addCustomSeries(e,t={},r=0){return this.wg.addCustomSeries(e,t,r)}addSeries(e,t={}){return this.wg.addSeries(e,t,this.paneIndex())}}const _Xe={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class fX{constructor(e){this.ir=e}applyOptions(e){this.ir.hr(e)}options(){return this.ir.N()}gg(){return this.ir}}class CXe{constructor(e,t,r,i,s,o){this.Mg=new Zs,this.Jn=e,this.bg=t,this.Sg=r,this.o_=s,this.wg=i,this.xg=o}m(){this.Mg.m()}priceFormatter(){return this.Jn.ra()}priceToCoordinate(e){const t=this.Jn.zt();return t===null?null:this.Jn.Ft().Nt(e,t.Wt)}coordinateToPrice(e){const t=this.Jn.zt();return t===null?null:this.Jn.Ft().Ts(e,t.Wt)}barsInLogicalRange(e){if(e===null)return null;const t=new ix(new YS(e.from,e.to)).k_(),r=this.Jn.Xs();if(r.Ki())return null;const i=r.Fr(t.Uh(),1),s=r.Fr(t.bi(),-1),o=Pt(r.Lr()),a=Pt(r.Ks());if(i!==null&&s!==null&&i.Re>s.Re)return{barsBefore:e.from-o,barsAfter:a-e.to};const c={barsBefore:i===null||i.Re===o?e.from-o:i.Re-o,barsAfter:s===null||s.Re===a?a-e.to:a-s.Re};return i!==null&&s!==null&&(c.from=i.Pw,c.to=s.Pw),c}setData(e){this.o_,this.Jn.Rr(),this.bg.Cg(this.Jn,e),this.Pg("full")}update(e,t=!1){this.Jn.Rr(),this.bg.kg(this.Jn,e,t),this.Pg("update")}dataByIndex(e,t){const r=this.Jn.Xs().Fr(e,t);return r===null?null:UL(this.seriesType())(r)}data(){const e=UL(this.seriesType());return this.Jn.Xs().Hr().map(t=>e(t))}subscribeDataChanged(e){this.Mg.i(e)}unsubscribeDataChanged(e){this.Mg._(e)}applyOptions(e){this.Jn.hr(e)}options(){return tg(this.Jn.N())}priceScale(){return this.Sg.priceScale(this.Jn.Ft().wa(),this.getPane().paneIndex())}createPriceLine(e){const t=tu(tg(_Xe),e),r=this.Jn.Oh(t);return new fX(r)}removePriceLine(e){this.Jn.Nh(e.gg())}priceLines(){return this.Jn.Fh().map(e=>new fX(e))}seriesType(){return this.Jn.Rr()}attachPrimitive(e){this.Jn.ua(e),e.attached&&e.attached({chart:this.wg,series:this,requestUpdate:()=>this.Jn.Qt().Bh(),horzScaleBehavior:this.o_})}detachPrimitive(e){this.Jn.ca(e),e.detached&&e.detached(),this.Jn.Qt().Bh()}getPane(){const e=this.Jn,t=Pt(this.Jn.Qt().Hn(e));return this.xg(t)}moveToPane(e){this.Jn.Qt().Oc(this.Jn,e)}seriesOrder(){const e=this.Jn.Qt().Hn(this.Jn);return e===null?-1:e.Oo().indexOf(this.Jn)}setSeriesOrder(e){const t=this.Jn.Qt().Hn(this.Jn);t!==null&&t.Qo(this.Jn,e)}Pg(e){this.Mg.v()&&this.Mg.p(e)}}class TXe{constructor(e,t,r){this.yg=new Zs,this.z_=new Zs,this.wm=new Zs,this.ts=e,this.uh=e.Et(),this.Xm=t,this.uh.Du().i(this.Tg.bind(this)),this.uh.Vu().i(this.Rg.bind(this)),this.Xm.Pm().i(this.Dg.bind(this)),this.o_=r}m(){this.uh.Du().u(this),this.uh.Vu().u(this),this.Xm.Pm().u(this),this.yg.m(),this.z_.m(),this.wm.m()}scrollPosition(){return this.uh.wu()}scrollToPosition(e,t){t?this.uh.yu(e,1e3):this.ts.fn(e)}scrollToRealTime(){this.uh.ku()}getVisibleRange(){const e=this.uh.su();return e===null?null:{from:e.from.originalTime,to:e.to.originalTime}}setVisibleRange(e){const t={from:this.o_.convertHorzItemToInternal(e.from),to:this.o_.convertHorzItemToInternal(e.to)},r=this.uh.hu(t);this.ts.zc(r)}getVisibleLogicalRange(){const e=this.uh.iu();return e===null?null:{from:e.Uh(),to:e.bi()}}setVisibleLogicalRange(e){oa(e.from<=e.to,"The from index cannot be after the to index."),this.ts.zc(e)}resetTimeScale(){this.ts.cn()}fitContent(){this.ts.Eu()}logicalToCoordinate(e){const t=this.ts.Et();return t.Ki()?null:t.qt(e)}coordinateToLogical(e){return this.uh.Ki()?null:this.uh.uu(e)}timeToIndex(e,t){const r=this.o_.convertHorzItemToInternal(e);return this.uh.J_(r,t)}timeToCoordinate(e){const t=this.timeToIndex(e,!1);return t===null?null:this.uh.qt(t)}coordinateToTime(e){const t=this.ts.Et(),r=t.uu(e),i=t.ss(r);return i===null?null:i.originalTime}width(){return this.Xm.Zf().width}height(){return this.Xm.Zf().height}subscribeVisibleTimeRangeChange(e){this.yg.i(e)}unsubscribeVisibleTimeRangeChange(e){this.yg._(e)}subscribeVisibleLogicalRangeChange(e){this.z_.i(e)}unsubscribeVisibleLogicalRangeChange(e){this.z_._(e)}subscribeSizeChange(e){this.wm.i(e)}unsubscribeSizeChange(e){this.wm._(e)}
8354applyOptions(e){this.uh.hr(e)}options(){return{...tg(this.uh.N()),barSpacing:this.uh.vu()}}Tg(){this.yg.v()&&this.yg.p(this.getVisibleRange())}Rg(){this.z_.v()&&this.z_.p(this.getVisibleLogicalRange())}Dg(e){this.wm.p(e.width,e.height)}}function IXe(n){if(n===void 0||n.type==="custom")return;const e=n;e.minMove!==void 0&&e.precision===void 0&&(e.precision=function(t){if(t>=1)return 0;let r=0;for(;r<8;r++){const i=Math.round(t);if(Math.abs(i-t)<1e-8)return r;t*=10}return r}(e.minMove))}function pX(n){return function(e){if(QI(e.handleScale)){const r=e.handleScale;e.handleScale={axisDoubleClickReset:{time:r,price:r},axisPressedMouseMove:{time:r,price:r},mouseWheel:r,pinch:r}}else if(e.handleScale!==void 0){const{axisPressedMouseMove:r,axisDoubleClickReset:i}=e.handleScale;QI(r)&&(e.handleScale.axisPressedMouseMove={time:r,price:r}),QI(i)&&(e.handleScale.axisDoubleClickReset={time:i,price:i})}const t=e.handleScroll;QI(t)&&(e.handleScroll={horzTouchDrag:t,vertTouchDrag:t,mouseWheel:t,pressedMouseMove:t})}(n),n}class NXe{constructor(e,t,r){this.Vg=new Map,this.Ig=new Map,this.Bg=new Zs,this.Eg=new Zs,this.Ag=new Zs,this.$u=new WeakMap,this.zg=new sXe(t);const i=r===void 0?tg(hX()):tu(tg(hX()),pX(r));this.Lg=t,this.Wf=new QQe(e,i,t),this.Wf.Kv().i(o=>{this.Bg.v()&&this.Bg.p(this.Og(o()))},this),this.Wf.Xv().i(o=>{this.Eg.v()&&this.Eg.p(this.Og(o()))},this),this.Wf.uc().i(o=>{this.Ag.v()&&this.Ag.p(this.Og(o()))},this);const s=this.Wf.Qt();this.Ng=new TXe(s,this.Wf.tw(),this.Lg)}remove(){this.Wf.Kv().u(this),this.Wf.Xv().u(this),this.Wf.uc().u(this),this.Ng.m(),this.Wf.m(),this.Vg.clear(),this.Ig.clear(),this.Bg.m(),this.Eg.m(),this.Ag.m(),this.zg.m()}resize(e,t,r){this.autoSizeActive()||this.Wf.Gm(e,t,r)}addCustomSeries(e,t={},r=0){const i=(s=>({type:"Custom",isBuiltIn:!1,defaultOptions:{...fXe,...s.defaultOptions()},Fg:pXe,Wg:s}))(r0(e));return this.Hg(i,t,r)}addSeries(e,t={},r=0){return this.Hg(e,t,r)}removeSeries(e){const t=ml(this.Vg.get(e)),r=this.zg.Ec(t);this.Wf.Qt().Ec(t),this.Ug(r),this.Vg.delete(e),this.Ig.delete(t)}Cg(e,t){this.Ug(this.zg.Fw(e,t))}kg(e,t,r){this.Ug(this.zg.Yw(e,t,r))}subscribeClick(e){this.Bg.i(e)}unsubscribeClick(e){this.Bg._(e)}subscribeCrosshairMove(e){this.Ag.i(e)}unsubscribeCrosshairMove(e){this.Ag._(e)}subscribeDblClick(e){this.Eg.i(e)}unsubscribeDblClick(e){this.Eg._(e)}priceScale(e,t=0){return new tle(this.Wf,e,t)}timeScale(){return this.Ng}applyOptions(e){this.Wf.hr(pX(e))}options(){return this.Wf.N()}takeScreenshot(){return this.Wf.hw()}addPane(e=!1){const t=this.Wf.Qt().Uc();return t.zo(e),this.$g(t)}removePane(e){this.Wf.Qt().dc(e)}swapPanes(e,t){this.Wf.Qt().vc(e,t)}autoSizeActive(){return this.Wf.uw()}chartElement(){return this.Wf.tp()}panes(){return this.Wf.Qt().$s().map(e=>this.$g(e))}paneSize(e=0){const t=this.Wf.fw(e);return{height:t.height,width:t.width}}setCrosshairPosition(e,t,r){const i=this.Vg.get(r);if(i===void 0)return;const s=this.Wf.Qt().Hn(i);s!==null&&this.Wf.Qt().Tc(e,t,s)}clearCrosshairPosition(){this.Wf.Qt().Rc(!0)}horzBehaviour(){return this.Lg}Hg(e,t={},r=0){oa(e.Fg!==void 0),IXe(t.priceFormat),e.type==="Candlestick"&&function(c){c.borderColor!==void 0&&(c.borderUpColor=c.borderColor,c.borderDownColor=c.borderColor),c.wickColor!==void 0&&(c.wickUpColor=c.wickColor,c.wickDownColor=c.wickColor)}(t);const i=tu(tg(Lce),tg(e.defaultOptions),t),s=e.Fg,o=new iM(this.Wf.Qt(),e.type,i,s,e.Wg);this.Wf.Qt().Ic(o,r);const a=new CXe(o,this,this,this,this.Lg,c=>this.$g(c));return this.Vg.set(a,o),this.Ig.set(o,a),a}Ug(e){const t=this.Wf.Qt();t.Dc(e.Et.ou,e.Et.Gw,e.Et.Jw),e.Oo.forEach((r,i)=>i.ht(r.se,r.Zw)),t.Et().j_(),t.pu()}qg(e){return ml(this.Ig.get(e))}Og(e){const t=new Map;e.Rw.forEach((i,s)=>{const o=s.Rr(),a=UL(o)(i);if(o!=="Custom")oa(JQe(a));else{const c=s.pa();oa(!c||c(a)===!1)}t.set(this.qg(s),a)});const r=e.Tw!==void 0&&this.Ig.has(e.Tw)?this.qg(e.Tw):void 0;return{time:e.Pw,logical:e.Re,point:e.kw,paneIndex:e.yw,hoveredSeries:r,hoveredObjectId:e.Dw,seriesData:t,sourceEvent:e.Vw}}$g(e){let t=this.$u.get(e);return t||(t=new SXe(this.Wf,r=>this.qg(r),e,this),this.$u.set(e,t)),t}}function RXe(n){if(N4(n)){const e=document.getElementById(n);return oa(e!==null,`Cannot find element in DOM with id=${n}`),e}return n}function MXe(n,e,t){const r=RXe(n),i=new NXe(r,e,t);return e.setOptions(i.options()),i}function kXe(n,e){return MXe(n,new QQ,QQ.ad(e))}({...Lce});const OXe=()=>{const n="4cp9JPLZBEAvw6KQbfxnQEEVHVd7wne1gD8FEZKupump",e="So11111111111111111111111111111111111111112",t=X.useRef(null),[r,i]=X.useState([]),[s,o]=X.useState(null),[a,c]=X.useState(null),[u,d]=X.useState(!0);return X.useEffect(()=>{(async()=>{var m;try{d(!0);const w=Math.floor(Date.now()/1e3)-86400*30,y=Math.floor(Date.now()/1e3),b=await fetch(`https://api.birdeye.so/public/history_price?address=${n}&type=1D&time_from=${w}&time_to=${y}`,{headers:{"Content-Type":"application/json"}});if(!b.ok)throw new Error("Failed to fetch data");const E=await b.json();if((m=E.data)!=null&&m.items){const T=E.data.items.map(N=>({time:N.unixTime,value:N.value}));if(i(T),T.length>=2){const N=T[T.length-1].value,I=T[0].value,H=(N-I)/I*100;o(N),c(H)}}}catch(w){console.error("Error fetching price data:",w)}finally{d(!1)}})()},[n]),X.useEffect(()=>{if(!t.current||r.length===0)return;const f=kXe(t.current,{layout:{background:{type:PL.Solid,color:"#2C2F36"},textColor:"#FFFFFF"},grid:{vertLines:{color:"#3A3E46"},horzLines:{color:"#3A3E46"}},crosshair:{mode:OL.Normal},width:t.current.clientWidth,height:500});f.addAreaSeries({topColor:"rgba(126, 186, 255, 0.4)",bottomColor:"rgba(126, 186, 255, 0.1)",lineColor:"rgba(126, 186, 255, 1)",lineWidth:2}).setData(r);const w=()=>{f.applyOptions({width:t.current.clientWidth}
8354)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),f.remove()}},[r]),S.jsxs("div",{className:"dragon-container",children:[S.jsx("h1",{className:"text-yellow-300 text-xl sm:text-4xl font-bold text-center mb-3 sm:mb-8",children:"YUPFUN Token Chart. Real-time price chart and trading information for YUPFUN"}),u?S.jsx("div",{className:"flex justify-center items-center h-64",children:S.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-[#7EBAFF]"})}):S.jsx("div",{className:"w-full px-4",children:S.jsxs("section",{className:"mb-4 sm:mb-8",children:[S.jsxs("div",{className:"bg-[#2C2F36] rounded-xl p-4",children:[S.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center mb-4",children:[S.jsxs("div",{className:"text-white",children:[S.jsx("span",{className:"text-sm text-gray-400",children:"Current Price"}),S.jsxs("div",{className:"text-2xl font-bold",children:["$",(s==null?void 0:s.toFixed(6))||"--"]})]}),S.jsxs("div",{className:`text-right ${a>=0?"text-green-400":"text-red-400"}`,children:[S.jsx("span",{className:"text-sm text-gray-400",children:"24h Change"}),S.jsx("div",{className:"text-xl font-bold",children:a?`${a.toFixed(2)}%`:"--"})]})]}),S.jsx("div",{ref:t,className:"w-full h-[500px] rounded-lg overflow-hidden"})]}),S.jsx("div",{className:"mt-6 text-center",children:S.jsx("a",{href:`https://yup.fun/swap/sol/${n}/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-block bg-[#7EBAFF] hover:bg-[#6BA8FF] text-[#1A1C24] font-medium px-6 py-3 rounded-lg transition-colors duration-200",children:"Trade YUPFUN"})})]})})]})};function PXe(n){return Ss({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.5765 11.92c-.0488.8906.6316 1.653 1.5219 1.7056h.0934c.8928-.0006 1.6161-.725 1.6155-1.6178-.0006-.8928-.725-1.6161-1.6178-1.6155-.8578.0006-1.5658.6711-1.613 1.5277Zm-6.025-.416c-.288-.0161-.5345.2042-.5507.4922-.0161.288.2042.5345.4922.5507.2878.0161.5343-.204.5506-.4918.0167-.2876-.2029-.5343-.4905-.5509H.5514Zm5.9226-8.9645c.257-.1309.3593-.4453.2284-.7024-.1309-.257-.4453-.3593-.7024-.2284-.2558.1302-.3585.4424-.2301.6991.13.2582.4448.3622.703.2322.0003-.0002.0007-.0003.001-.0005Zm1.6397 2.8589c.398-.2006.558-.6859.3573-1.0839-.2006-.398-.6859-.558-1.0839-.3573-.3978.2006-.5579.6856-.3575 1.0835.2007.398.686.5581 1.0842.3578ZM2.597 7.3645c.3072.2013.7194.1154.9206-.1918.2013-.3072.1154-.7194-.1918-.9206-.3072-.2013-.7194-.1154-.9206.1918 0 .0001-.0001.0002-.0002.0003-.201.3072-.1151.7191.192.9203Zm.9824 3.8515c-.4453-.0254-.827.3149-.8524.7603s.3149.827.7603.8524c.4453.0254.827-.3149.8524-.7603v-.0006c.0251-.4451-.3152-.8264-.7603-.8518Zm-.8915 5.4221c-.328.1652-.46.565-.2948.893.1652.328.565.46.893.2948.328-.1652.46-.565.2948-.893l-.0002-.0004c-.1645-.3276-.5633-.4598-.8909-.2954-.0006.0003-.0013.0006-.0019.001Zm3.136-7.0931c.4386.2876 1.0274.1653 1.315-.2734.2876-.4386.1653-1.0274-.2734-1.315-.4386-.2876-1.0273-.1653-1.3149.2732-.2878.4381-.166 1.0266.2721 1.3144.0004.0003.0008.0005.0012.0008Zm9.9501-4.2106c.3729.2447.8737.1408 1.1184-.2321.2447-.3729.1408-.8737-.2321-1.1184-.3729-.2447-.8737-.1408-1.1184.2321 0 .0001-.0001.0002-.0002.0003-.2447.3726-.141.8729.2316 1.1176.0003.0002.0005.0003.0008.0005Zm1.6563-2.8499c.2413.1579.565.0904.723-.151s.0904-.565-.151-.723c-.241-.1577-.5642-.0906-.7224.1501-.1584.241-.0915.5648.1495.7233l.0009.0006Zm-1.5296 7.8938c-.8911-.0507-1.6546.6305-1.7053 1.5216-.0507.8911.6305 1.6546 1.5216 1.7053h.0928c.8925 0 1.616-.7235 1.616-1.616 0-.8572-.6693-1.5652-1.5251-1.6134v.0026ZM8.645 9.433c.2737.5459.8331.8896 1.4438.887.8925-.0002 1.6159-.7238 1.6157-1.6163 0-.2526-.0593-.5018-.1731-.7273-.4017-.7971-1.3735-1.1176-2.1706-.7158-.7971.4017-1.1176 1.3735-.7158 2.1706v.0019Zm12.6669-2.0704c.3273-.1666.4575-.567.2909-.8943-.1666-.3273-.567-.4575-.8943-.2909-.3259.1659-.4567.5639-.2927.8908.1652.3284.5653.4607.8937.2956.0008-.0004.0015-.0008.0023-.0012Zm-4.096.5146c-.4683.2362-.6565.8074-.4203 1.2757.2362.4683.8074.6565 1.2757.4203.468-.2361.6563-.8066.4207-1.2749-.2364-.4683-.8074-.6568-1.2762-.4211Zm-5.2768-5.6365c.3667.0205.6806-.2601.7011-.6267s-.2601-.6806-.6267-.7011c-.3655-.0205-.6789.2584-.7009.6238-.0225.3662.2562.6813.6224.7038.0014 0 .0028.0002.0042.0002Zm-.0077 4.1837c.5237.0288.9717-.3724 1.0006-.8961.0288-.5237-.3723-.9717-.8961-1.0006-.5231-.0288-.9707.3714-1.0005.8944-.0298.5237.3706.9724.8943 1.0021h.0017Zm-5.1475 9.6992c.4685-.2359.657-.807.421-1.2755-.2359-.4685-.807-.657-1.2755-.421-.4684.2359-.6569.8069-.4211 1.2754.2362.4682.807.6567 1.2755.4211Zm5.76-8.313c-.4881.7459-.2792 1.7463.4667 2.2344s1.7463.2792 2.2344-.4667.2792-1.7463-.4667-2.2344c-.262-.1715-.5683-.263-.8815-.2635-.5452-.0001-1.0538.2744-1.353.7302Zm2.8109 6.7571c-.4015-.7975-1.3735-1.1185-2.171-.7169-.7975.4015-1.1185 1.3735-.7169 2.171.4015.7975 1.3735 1.1185 2.171.7169.0005-.0002.0009-.0005.0014-.0007.7947-.3952 1.1186-1.3598.7235-2.1545-.0026-.0053-.0053-.0105-.0079-.0158Zm2.8211-.112c-.4386-.2876-1.0274-.1653-1.315.2734-.2876.4386-.1653 1.0274.2734 1.315.4386.2876 1.0273.1653 1.3149-.2732.2877-.4386.1654-1.0274-.2731-1.3151h-.0002Zm3.0963-2.4282c.0254-.4453-.3149-.827-.7603-.8524-.4453-.0254-.827.3149-.8524.7603-.0254.4453.3149.827.7603.8524h.0006c.4451.0251.8264-.3152.8518-.7603Zm2.2349-.5741c-.288-.0161-.5345.2042-.5507.4922s.2042.5345.4922.5507c.2878.0161.5343-.204.5506-.4918.016-.288-.2042-.5345-.4922-.551Zm-2.1043 5.1821c-.3073-.2011-.7194-.115-.9205.1923-.2011.3073-.115.7194.1923.9205.3071.201.719.1151.9202-.1918.2013-.3071.1156-.7193-.1916-.9207l-.0004-.0003ZM6.5695 21.5161c-.2411-.1584-.5649-.0913-.7232.1497-.1584.2411-.0913.5649.1497.7232.2411.
83541584.5649.0913.7232-.1497.158-.2411.091-.5646-.1498-.7232Zm10.9555-.055c-.257.1309-.3593.4453-.2284.7024.1309.257.4453.3593.7023.2284.2558-.1302.3585-.4424.2301-.6991-.1291-.2579-.4428-.3624-.7007-.2333-.0011.0005-.0022.0011-.0033.0016Zm-6.0691-5.2717c.4892-.7465.2806-1.7482-.4659-2.2374-.7465-.4892-1.7482-.2806-2.2374.4659s-.2806 1.7482.4659 2.2374c.2628.1722.5702.2641.8844.2644.5458.0022 1.0553-.2728 1.353-.7302Zm-3.2301 2.4768c-.3729-.2447-.8737-.1408-1.1184.2321-.2447.3729-.1408.8737.2321 1.1184s.8737.1408 1.1184-.2321c0-.0001.0001-.0002.0002-.0003.2445-.3729.1405-.8734-.2323-1.1181Zm3.7664 3.0931c-.3667-.0209-.6808.2594-.7017.6261s.2594.6808.6261.7017c.3658.0208.6795-.2581.7016-.6238.0222-.3666-.2571-.6817-.6236-.7039-.0008 0-.0015 0-.0023-.0001Zm.007-4.1837c-.5237-.0288-.9717.3724-1.0005.8961-.0288.5237.3724.9717.8961 1.0005.5228.0288.9703-.371 1.0004-.8938.0298-.524-.3709-.973-.8949-1.0028h-.0011Zm3.8861 1.0259c-.3976.2022-.556.6884-.3539 1.086.2022.3976.6884.556 1.086.3539.3961-.2014.5551-.685.3558-1.0821-.2-.3987-.6854-.5598-1.0841-.3597-.0013.0007-.0026.0013-.0039.002Z"},child:[]}]})(n)}function DXe(n){return Ss({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.288 7.908h-1.715v3.38h2.697v1.415h-2.697v3.38h1.799c.462 0 3.794.052 3.789-3.933-.005-3.984-3.232-4.242-3.873-4.242zM12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm.472 18.481H8.126v-5.778H6.594v-1.415h1.532V5.511h3.73c.882 0 6.727-.183 6.727 6.594-.001 6.888-6.111 6.376-6.111 6.376z"},child:[]}]})(n)}function BXe(n){return Ss({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12,0c2.39,0,4.328,1.127,4.328,2.517S14.39,5.034,12,5.034,7.672,3.907,7.672,2.517,9.61,0,12,0Zm0,18.966c2.39,0,4.328,1.127,4.328,2.517S14.39,24,12,24s-4.328-1.127-4.328-2.517S9.61,18.966,12,18.966ZM1.606,6C2.8,3.93,4.747,2.816,5.952,3.511s1.212,2.937.017,5.007S2.828,11.7,1.624,11.007.411,8.07,1.606,6Zm16.427,9.483c1.2-2.07,3.139-3.184,4.343-2.489s1.211,2.936.016,5.006-3.14,3.185-4.344,2.49S16.837,17.553,18.033,15.483ZM1.624,12.993c1.205-.7,3.15.419,4.346,2.489s1.187,4.311-.018,5.007S2.8,20.07,1.607,18,.42,13.689,1.624,12.993ZM18.049,3.512c1.2-.695,3.149.419,4.344,2.489s1.188,4.311-.016,5.007-3.148-.42-4.343-2.49S16.846,4.207,18.049,3.512Z"},child:[]}]})(n)}function LXe(n){return Ss({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m23.8764 18.0313-3.962 4.1393a.9201.9201 0 0 1-.306.2106.9407.9407 0 0 1-.367.0742H.4599a.4689.4689 0 0 1-.2522-.0733.4513.4513 0 0 1-.1696-.1962.4375.4375 0 0 1-.0314-.2545.4438.4438 0 0 1 .117-.2298l3.9649-4.1393a.92.92 0 0 1 .3052-.2102.9407.9407 0 0 1 .3658-.0746H23.54a.4692.4692 0 0 1 .2523.0734.4531.4531 0 0 1 .1697.196.438.438 0 0 1 .0313.2547.4442.4442 0 0 1-.1169.2297zm-3.962-8.3355a.9202.9202 0 0 0-.306-.2106.941.941 0 0 0-.367-.0742H.4599a.4687.4687 0 0 0-.2522.0734.4513.4513 0 0 0-.1696.1961.4376.4376 0 0 0-.0314.2546.444.444 0 0 0 .117.2297l3.9649 4.1394a.9204.9204 0 0 0 .3052.2102c.1154.049.24.0744.3658.0746H23.54a.469.469 0 0 0 .2523-.0734.453.453 0 0 0 .1697-.1961.4382.4382 0 0 0 .0313-.2546.4444.4444 0 0 0-.1169-.2297zM.46 6.7225h18.7815a.9411.9411 0 0 0 .367-.0742.9202.9202 0 0 0 .306-.2106l3.962-4.1394a.4442.4442 0 0 0 .117-.2297.4378.4378 0 0 0-.0314-.2546.453.453 0 0 0-.1697-.196.469.469 0 0 0-.2523-.0734H4.7596a.941.941 0 0 0-.3658.0745.9203.9203 0 0 0-.3052.2102L.1246 5.9687a.4438.4438 0 0 0-.1169.2295.4375.4375 0 0 0 .0312.2544.4512.4512 0 0 0 .1692.196.4689.4689 0 0 0 .2518.0739z"},child:[]}]})(n)}function $Xe(n){return Ss({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M11 15a4 4 0 1 0 0-8 4 4 0 0 0 0 8m5-4a5 5 0 1 1-10 0 5 5 0 0 1 10 0"},child:[]},{tag:"path",attr:{d:"M9.438 11.944c.047.596.518 1.06 1.363 1.116v.44h.375v-.443c.875-.061 1.386-.529 1.386-1.207 0-.618-.39-.936-1.09-1.1l-.296-.07v-1.2c.376.043.614.248.671.532h.658c-.047-.575-.54-1.024-1.329-1.073V8.5h-.375v.45c-.747.073-1.255.522-1.255 1.158 0 .562.378.92 1.007 1.066l.248.061v1.272c-.384-.058-.639-.27-.696-.563h-.668zm1.36-1.354c-.369-.085-.569-.26-.569-.522 0-.294.216-.514.572-.578v1.1zm.432.746c.449.104.655.272.655.569 0 .339-.257.571-.709.614v-1.195z"},child:[]},{tag:"path",attr:{d:"M1 0a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h4.083q.088-.517.258-1H3a2 2 0 0 0-2-2V3a2 2 0 0 0 2-2h10a2 2 0 0 0 2 2v3.528c.38.34.717.728 1 1.154V1a1 1 0 0 0-1-1z"},child:[]},{tag:"path",attr:{d:"M9.998 5.083 10 5a2 2 0 1 0-3.132 1.65 6 6 0 0 1 3.13-1.567"},child:[]}]})(n)}function UXe(n){return Ss({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.5 9.511c.076.954.83 1.697 2.182 1.785V12h.6v-.709c1.4-.098 2.218-.846 2.218
8354-1.932 0-.987-.626-1.496-1.745-1.76l-.473-.112V5.57c.6.068.982.396 1.074.85h1.052c-.076-.919-.864-1.638-2.126-1.716V4h-.6v.719c-1.195.117-2.01.836-2.01 1.853 0 .9.606 1.472 1.613 1.707l.397.098v2.034c-.615-.093-1.022-.43-1.114-.9zm2.177-2.166c-.59-.137-.91-.416-.91-.836 0-.47.345-.822.915-.925v1.76h-.005zm.692 1.193c.717.166 1.048.435 1.048.91 0 .542-.412.914-1.135.982V8.518z"},child:[]},{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"},child:[]},{tag:"path",attr:{d:"M8 13.5a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11m0 .5A6 6 0 1 0 8 2a6 6 0 0 0 0 12"},child:[]}]})(n)}function jXe(n){return Ss({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3.1.7a.5.5 0 0 1 .4-.2h9a.5.5 0 0 1 .4.2l2.976 3.974c.149.185.156.45.01.644L8.4 15.3a.5.5 0 0 1-.8 0L.1 5.3a.5.5 0 0 1 0-.6zm11.386 3.785-1.806-2.41-.776 2.413zm-3.633.004.961-2.989H4.186l.963 2.995zM5.47 5.495 8 13.366l2.532-7.876zm-1.371-.999-.78-2.422-1.818 2.425zM1.499 5.5l5.113 6.817-2.192-6.82zm7.889 6.817 5.123-6.83-2.928.002z"},child:[]}]})(n)}const zXe=({showOnAllPages:n=!0})=>{const e=X.useRef(null),t=X.useRef([]),[r,i]=X.useState(!1),[s,o]=X.useState(""),[a,c]=X.useState(0),[u,d]=X.useState({x:10,y:10}),f=X.useMemo(()=>[{icon:S.jsx(RHe,{}),size:40,color:"#3A56C8"},{icon:S.jsx(LXe,{}),size:38,color:"#00CC88"},{icon:S.jsx(NHe,{}),size:36,color:"#D67A0A"},{icon:S.jsx(DXe,{}),size:34,color:"#B89F3A"},{icon:S.jsx(PXe,{}),size:32,color:"#002A8A"},{icon:S.jsx(BXe,{}),size:30,color:"#CC0077"},{icon:S.jsx(UXe,{}),size:28,color:"#D4B000"},{icon:S.jsx($Xe,{}),size:26,color:"#22AA22"},{icon:S.jsx(jXe,{}),size:24,color:"#CC00CC"},{icon:"ð",size:50,color:"#E04A4A"},{icon:"ð°",size:42,color:"#D4B000"},{icon:"ð¥",size:45,color:"#E07C00"},{icon:"ð",size:40,color:"#5C9EFF"},{icon:S.jsx(nZ,{}),size:48,color:"#CC00CC"},{icon:S.jsx(IHe,{}),size:44,color:"#D4B000"},{icon:S.jsx(THe,{}),size:42,color:"#5C9EFF"},{icon:S.jsx(kHe,{}),size:38,color:"#E04A00"},{icon:"ð¤ª",size:36,color:"#D64B9E"},{icon:"ð¤",size:34,color:"#D4B000"},{icon:"ð»",size:32,color:"#E6E6FA"},{icon:S.jsx(OHe,{}),size:30,color:"#C6C6D0"},{icon:"ð¤",size:28,color:"#898989"},{icon:S.jsx(PHe,{}),size:26,color:"#3A6EA5"},{icon:"ð¾",size:24,color:"#7A5CD6"},{icon:"ð¦",size:22,color:"#CC00CC"},{icon:"ð",size:20,color:"#E04A00"},{icon:"ð",size:18,color:"#E07C00"},{icon:"ð",size:16,color:"#E04A4A"},{icon:"ð¦",size:14,color:"#8CC6FF"},{icon:"ð©",size:12,color:"#8B4513"},{icon:"ð®",size:10,color:"#7A5CD6"},{icon:"ð²",size:8,color:"#E6E6FA"},{icon:"ð¶",size:36,color:"#A0522D"},{icon:S.jsx(MHe,{}),size:34,color:"#8B4513"},{icon:"ð±",size:32,color:"#D67A0A"},{icon:"ð",size:30,color:"#808080"},{icon:"ð¹",size:28,color:"#FFC0CB"},{icon:"ð°",size:26,color:"#E6E6FA"},{icon:"ð¦",size:24,color:"#E07C00"},{icon:"ð»",size:22,color:"#8B4513"},{icon:"ð¼",size:20,color:"#000000"},{icon:"ð¦",size:18,color:"#D4B000"},{icon:"ð®",size:16,color:"#E6E6FA"},{icon:"ð·",size:14,color:"#FFC0CB"},{icon:"ð½",size:36,color:"#22AA22"},{icon:"ð¸",size:34,color:"#3A6EA5"},{icon:S.jsx(DHe,{}),size:32,color:"#898989"},{icon:"ð ",size:30,color:"#E6E6FA"},{icon:"ð",size:28,color:"#3A3A8A"},{icon:"ðª",size:26,color:"#D67A0A"},{icon:"â¿",size:36,color:"#D67A0A"},{icon:"Î",size:34,color:"#3A56C8"},{icon:"â",size:32,color:"#00CC88"},{icon:"â",size:30,color:"#CC0077"},{icon:"â§",size:28,color:"#D4B000"}],[]),m=X.useMemo(()=>[...f].sort(()=>.5-Math.random()).slice(0,15),[f]),w=["YUPFUN detected! +1000 XP ð®","Dragon loot: 500 YUPFUN tokens! ð°","Secret swap route unlocked! ð","Slippage monster defeated! ð²","You found the dragon's treasure! ð","To the moon! ð","WAGMI! ðð","GM! âï¸","NGMI! ð
","LFG! ðââï¸","Ape in! ð¦","Based! ð","Fren detected! ð","Wen lambo? ð","Wen moon? ð","Diamond hands! ð","Paper hands! ð","This is the way! ð£ï¸","Not financial advice! ð¢","DYOR! ð"];X.useEffect(()=>{if(!n)return;const T=e.current,N=T.getContext("2d"),I=()=>{T.width=window.innerWidth,T.height=window.innerHeight};I();const H=()=>{I(),t.current=t.current.slice(0,Math.floor(window.innerWidth/50))};window.addEventListener("resize",H,{passive:!0}),t.current=Array.from({length:20},()=>({x:Math.random()*T.width,y:Math.random()*T.height,size:Math.random()*4+2,speed:Math.random()*.4+.1,color:`hsl(${Math.random()*60+20}, 100%, 40%)`,angle:Math.random()*Math.PI*2,isYUPFUN:Math.random()>.9}));let L,U=0;const K=1e3/30,Y=k=>{U||(U=k);const j=k-U;if(j>K){U=k-j%K,N.clearRect(0,0,T.width,T.height),N.strokeStyle="rgba(126, 186, 255, 0.1)";for(let V=0;V<t.current.length;V+=3){const W=t.current[V];for(let $=V+1;$<t.current.length;$+=3){const A=t.current[$],_=A.x-W.x,R=A.y-W.y;_*_+R*R<22500&&(N.beginPath(),N.moveTo(W.x,W.y),N.lineTo(A.x,A.y),N.stroke())}}t.current.forEach(V=>{V.x+=Math.cos(V.angle)*V.speed,V.y+=Math.sin(V.angle)*V.speed,V.x<0&&(V.x=T.width),V.x>T.width&&(V.x=0),V.y<0&&(V.y=T.height),V.y>T.height&&(V.y=0),N.beginPath(),N.arc(V.x,V.y,V.size,0,Math.PI*2),N.fillStyle=V.isYUPFUN?"#D4B000":V.color,N.fill()})}L=requestAnimationFrame(Y)};return L=requestAnimationFrame(Y),()=>{cancelAnimationFrame(L),window.removeEventListener("resize",H)}},[n]);const y=Qn.useCallback(T=>{n&&(Math.random()>.5&&(t.current.push({x:T.clientX,y:T.clientY,size:Math.random()*6+2,speed:Math.random()*2+.5,color:`hsl(${Math.random()*60+20}, 100%, 50%)`,angle:Math.random()*Math.PI*2,life:100}),t.current.length>50&&(t.current=t.current.slice(-50))),Math.random()>.97&&!r&&b())},[n,r]),b=Qn.useCallback(()=>{o(w[Math.floor(Math.random()*w.length)]),i(!0),setTimeout(()=>i(!1),3e3)},[]),E=Qn.useCallback(()=>{c(T=>T+1),o(`+${a+1} YUPFUN tokens! Keep going! ð`),i(!0),d({x:Math.random()*80+10,y:Math.random()*80+10}),setTimeout(()=>i(!1),2e3)},[a]);return S.jsxs(S.Fragment,{children:[n&&S.jsxs(S.Fragment,{children:[S.jsx("canvas",{ref:e,className:"fixed top-0 left-0 w-full h-full z-0 pointer-events-none",onMouseMove:y}),S.jsx("div",{className:"dragon-scale-overlay"})]}),m.map((T,N)=>S.jsx(qp.div,{initial:{x:Math.random()*100,y:Math.random()*100,rotate:Math.random()*360,scale:.8},animate:{x:[null,Math.random()*200-100],y:[null,Math.random()*200-100],rotate:Math.random()*720,scale:[null,Math.random()*.4+.6]},transition:{duration:20+Math.random()*40,repeat:1/0,repeatType:"reverse",ease:"linear"},className:"fixed text-4xl opacity-60 pointer-events-none z-0",style:{left:`${5+N*5%90}%`,top:`${5+N*7%90}%`,color:T.color,fontSize:`${T.size}px`,filter:"saturate(1.5)"},children:T.icon},`emoji-${N}`)),r&&S.jsx(qp.div,{initial:{opacity:0,y:20}
8354,animate:{opacity:1,y:0},exit:{opacity:0},className:"fixed bottom-10 left-1/2 transform -translate-x-1/2 bg-[#1A1C24] border-2 border-[#D4B000] text-[#D4B000] px-6 py-3 rounded-lg shadow-lg z-50",children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(nZ,{className:"text-xl"}),S.jsx("span",{children:s})]})}),S.jsx(qp.div,{className:"fixed text-4xl cursor-pointer z-50",style:{left:`${u.x}%`,top:`${u.y}%`,opacity:.3,fontSize:"3rem"},onClick:E,whileHover:{scale:1.3,opacity:1},whileTap:{scale:.8},transition:{type:"spring",stiffness:500},children:"ð"})]})},FXe=()=>{const n=["https://www.youtube.com/embed/qAbMQTwGqO0","https://www.youtube.com/embed/nXBcf-7Y1Go","https://www.youtube.com/embed/_8LUxsmHVHw","https://www.youtube.com/embed/3GlHUPKdI-g","https://www.youtube.com/embed/osoK6r2nVGc","https://www.youtube.com/embed/Pl3ZBQrWh-Q","https://www.youtube.com/embed/XTEgkzltrZ8","https://www.youtube.com/embed/hFV2jxiTwnU","https://www.youtube.com/embed/qf4IVO3VhBg","https://www.youtube.com/embed/mhCl2JU6lE4","https://www.youtube.com/embed/rfPAxQx7GmU","https://www.youtube.com/embed/xD8uWG_Swrk","https://www.youtube.com/embed/D57CZCOy7I0","https://www.youtube.com/embed/svisFpNvHgE","https://www.youtube.com/embed/cCP6-EawoFs"],[e,t]=X.useState("");return X.useEffect(()=>{const r=n[Math.floor(Math.random()*n.length)];t(r)},[]),S.jsx("div",{className:"dragon-container",children:S.jsxs("div",{className:"p-3 sm:p-6 rounded-2xl shadow-lg max-w-4xl mx-auto text-white",children:[S.jsx("h1",{className:"text-yellow-300 text-xl sm:text-4xl font-bold text-center mb-3 sm:mb-8",children:"ð¦ Why YUPFUN Stands Out in the Meme Coin Jungle ð"}),S.jsx("div",{className:"mb-6 sm:mb-10 aspect-w-16 aspect-h-9",children:e&&S.jsx("iframe",{className:"w-full h-64 sm:h-96 rounded-lg",src:e,title:"YUP.FUN - Anthem song",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),S.jsx("section",{className:"mb-6 sm:mb-10",children:S.jsxs("div",{className:"space-y-4",children:[S.jsxs("p",{className:"text-xs sm:text-base",children:[S.jsx("strong",{children:"Let's be real - most meme coins are all bark and no bite."})," YUPFUN is different. We combine the virality of memes with ",S.jsx("span",{className:"text-yellow-300",children:"actual utility"})," and a ",S.jsx("span",{className:"text-yellow-300",children:"sustainable ecosystem"}),`. Here's why we're not just another "wen moon" shitcoin:`]}),S.jsx("div",{className:"bg-yellow-100 p-3 rounded-lg",children:S.jsxs("p",{className:"text-[#1A1C24] text-xs sm:text-sm font-bold",children:["ð YUPFUN IS BUILT DIFFERENT ð",S.jsx("br",{}),"⢠Meme magic meets DeFi fundamentals",S.jsx("br",{}),"⢠No empty promises - just working products",S.jsx("br",{}),"⢠Community-driven with real governance (Soon)",S.jsx("br",{}),"⢠Multiple revenue streams beyond speculation (Soon)"]})})]})}),S.jsxs("section",{className:"mb-6 sm:mb-10",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-3 sm:mb-5",children:"The YUPFUN Difference (Why We're Not Just Another Meme)"}),S.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-6",children:[S.jsxs("div",{className:"p-4 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-lg font-bold mb-2",children:"ð ï¸ Actual Utility"}),S.jsxs("ul",{className:"text-xs sm:text-sm space-y-1 list-disc list-inside",children:[S.jsx("li",{children:"Native token for our DEX aggregator & cross-chain bridge"}),S.jsx("li",{children:"Fee discounts for YUPFUN holders"}),S.jsx("li",{children:"Governance rights for ecosystem decisions"}),S.jsx("li",{children:"Used in our e-commerce and gaming platforms"})]})]}),S.jsxs("div",{className:"p-4 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-lg font-bold mb-2",children:"ð° Sustainable Model"}),S.jsxs("ul",{className:"text-xs sm:text-sm space-y-1 list-disc list-inside",children:[S.jsx("li",{children:"Revenue from swap fees (0.001-0.015 SOL per transaction)"}),S.jsx("li",{children:"Bridge fees for cross-chain transfers"}),S.jsx("li",{children:"E-commerce transaction fees"}),S.jsx("li",{children:"Gaming platform monetization"})]})]}),S.jsxs("div",{className:"p-4 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-lg font-bold mb-2",children:"â¡ Solana Speed"}),S.jsxs("ul",{className:"text-xs sm:text-sm space-y-1 list-disc list-inside",children:[S.jsx("li",{children:"Near-instant transactions (no ETH gas wars)"}),S.jsx("li",{children:"Fees so low they're basically a rounding error"}
8354),S.jsx("li",{children:"Scalable infrastructure ready for mass adoption"}),S.jsx("li",{children:"Cross-chain compatibility for maximum flexibility"})]})]}),S.jsxs("div",{className:"p-4 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-lg font-bold mb-2",children:"ð¥ Community Power"}),S.jsxs("ul",{className:"text-xs sm:text-sm space-y-1 list-disc list-inside",children:[S.jsx("li",{children:"Real governance - holders vote on key decisions"}),S.jsx("li",{children:"Community-driven meme contests and events"}),S.jsx("li",{children:"Transparent development process"}),S.jsx("li",{children:"No VC backdoors - fair launch for all"})]})]})]})]}),S.jsxs("section",{className:"mb-6 sm:mb-10",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-3 sm:mb-5",children:"YUPFUN vs. Typical Meme Coins (Spoiler: We Win)"}),S.jsx("div",{className:"overflow-x-auto",children:S.jsxs("table",{className:"min-w-full bg-gray-800 rounded-xl",children:[S.jsx("thead",{children:S.jsxs("tr",{children:[S.jsx("th",{className:"px-4 py-2 text-left text-yellow-400 text-sm sm:text-base",children:"Feature"}),S.jsx("th",{className:"px-4 py-2 text-left text-yellow-400 text-sm sm:text-base",children:"Typical Meme Coin"}),S.jsx("th",{className:"px-4 py-2 text-left text-yellow-400 text-sm sm:text-base",children:"YUPFUN"})]})}),S.jsxs("tbody",{children:[S.jsxs("tr",{className:"border-b border-gray-700",children:[S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"Utility"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"None (just vibes)"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base text-yellow-300 font-bold",children:"DEX, Bridge, E-commerce, Gaming"})]}),S.jsxs("tr",{className:"border-b border-gray-700",children:[S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"Revenue Model"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"Pump & dump"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base text-yellow-300 font-bold",children:"Transaction fees, platform usage"})]}),S.jsxs("tr",{className:"border-b border-gray-700",children:[S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"Technology"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"ERC-20 copy/paste"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base text-yellow-300 font-bold",children:"Solana speed + cross-chain magic"})]}),S.jsxs("tr",{className:"border-b border-gray-700",children:[S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"Community"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"FOMO chasers"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base text-yellow-300 font-bold",children:"Builders, degens, and true believers"})]}),S.jsxs("tr",{className:"border-b border-gray-700",children:[S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"Longevity"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base",children:"Dead in 3 months"}),S.jsx("td",{className:"px-4 py-2 text-sm sm:text-base text-yellow-300 font-bold",children:"Sustainable ecosystem growth"})]})]})]})})]}),S.jsxs("section",{className:"mb-6 sm:mb-10",children:[S.jsx("h2",{className:"text-yellow-400 text-lg sm:text-2xl font-bold mb-3 sm:mb-5",children:"The YUPFUN Ecosystem (More Than Just a Token)"}),S.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[S.jsxs("div",{className:"p-3 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-md font-bold mb-1",children:"ð DEX Aggregator"}),S.jsx("p",{className:"text-xs sm:text-sm",children:"Best prices across multiple Solana DEXs with YUPFUN fee discounts"})]}),S.jsxs("div",{className:"p-3 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-md font-bold mb-1",children:"ð Cross-Chain Bridge"}),S.jsx("p",{className:"text-xs sm:text-sm",children:"Move assets between chains with YUPFUN-powered efficiency"})]}),S.jsxs("div",{className:"p-3 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-md font-bold mb-1",children:"ðï¸ E-Commerce"}),S.jsx("p",{className:"text-xs sm:text-sm",children:"Spend YUPFUN at partnered merchants for real-world goods (Soon)"})]}),S.jsxs("div",{className:"p-3 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-md font-bold mb-1",children:"ð® Gaming"}),S.jsx("p",{className:"text-xs sm:text-sm",children:"Play-to-earn games with YUPFUN rewards and in-game purchases (Soon)"})]}),S.jsxs("div",{className:"p-3 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-md font-bold mb-1",children:"ð± Mobile App"}),S.jsx("p",{className:"text-xs sm:text-sm",children:"Trade, bridge, shop, and game all from your phone (Soon)"})]}),S.jsxs("div",{className:"p-3 rounded-lg bg-gray-800 border border-yellow-400",children:[S.jsx("h3",{className:"text-yellow-300 text-sm sm:text-md font-bold mb-1",children:"ð³ï¸ Governance"}),S.jsx("p",{className:"text-xs sm:text-sm",children:"YUPFUN holders vote on ecosystem decisions and upgrades (Soon)"})]})]})]}),S.jsxs("section",{className:"text-center",children:[S.jsx("div",{className:"bg-yellow-400 text-black p-4 rounded-lg mb-4",children:S.jsx("p",{className:"font-bold text-sm sm:text-base",children:"ð YUPFUN isn't just a token - it's an entire ecosystem with real utility and sustainable growth ð"})}),S.jsx("a",{href:"https://yup.fun",className:"bg-yellow-400 hover:bg-yellow-300 text-black font-bold py-3 px-6 rounded-full text-sm sm:text-base inline-block",children:"ð¦ Join the YUPFUN Revolution ð¦"}),S.jsx("p",{className:"text-xs mt-2",children:"(This is your chance to get in before the normies find out)"})]})]})})},WXe=1800*1e3,HXe=11,VXe=11,qXe=0,KXe=9;function YXe(){const n=()=>{const y=new Date,b=y.getFullYear(),E=new Date(b,HXe,VXe),T=new Date(b+1+0,qXe,KXe+1);return y>=E&&y<T};X.useEffect(()=>{let y;if(n()){const b=Array.from({length:21},(T,N)=>`/backgrounds/holidays/christmas/${N+1}.png`),E=b[Math.floor(Math.random()*b.length)];y=E,console.log("ð Merry Christmas! Using holiday background:",E)}else{const b=Array.from({length:28},(T,N)=>`/backgrounds/${N+1}.png`);y=b[Math.floor(Math.random()*b.length)]}return document.body.classList.add("random-bg"),document.body.style.backgroundImage=`url('${y}')`,()=>{document.body.classList.remove("random-bg"),document.body.style.backgroundImage=""}}
8354,[]),uB.Mainnet;const e=["https://lb.drpc.org/ogrpc?network=solana&dkey=Al8w_HEX0EMKqmxQ82P-PDPHCCZgEqcR8JjeKjrWkQAY","https://solana-mainnet.core.chainstack.com/3bb57b4ad209081a6d5c9657e27534bb","https://solana-mainnet.g.alchemy.com/v2/EOwdJCIiGmdlRugnRg_o3yMnqjz3nqBS","https://proportionate-capable-borough.solana-mainnet.quiknode.pro/0c6469a083dc2a1fbcdc3984bc1db0fc899e392f/","https://rpc.hellomoon.io/fc7ab2ca-4f18-4e12-bc56-2b9f61ab1a5e","https://api.mainnet-beta.solana.com","https://rpc.ankr.com/solana"],[t,r]=X.useState(e[0]),[i,s]=X.useState(0),[o,a]=X.useState(Date.now()),[c,u]=X.useState(null),d=async y=>{try{const b=await fetch(y,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getHealth"}),timeout:5e3});return b.status===503?!1:(await b.json()).result==="ok"}catch(b){return console.error("Error checking endpoint:",b),!1}},f=async()=>{if(await d(e[0])){s(0),r(e[0]);return}const b=(i+1)%e.length,E=b===0?1:b;s(E),r(e[E])};X.useEffect(()=>{(window.location.search.includes("nightly_deeplink")||document.referrer.includes("nightly://"))&&setTimeout(()=>{window.location.href=window.location.href.split("?")[0]},300)},[]),X.useEffect(()=>{const b=setInterval(async()=>{await d(t)||(console.log(`Endpoint ${t} is unhealthy, rotating...`),await f())},3e4);return()=>clearInterval(b)},[t,i]),X.useEffect(()=>{typeof window<"u"&&(window.reown=window.reown||{},window.reown.autoConnect=!1,window.reown.enableMobile=!0);const y=()=>{a(Date.now())};return window.addEventListener("mousemove",y),window.addEventListener("keydown",y),window.addEventListener("click",y),window.addEventListener("scroll",y),window.addEventListener("touchstart",y),()=>{window.removeEventListener("mousemove",y),window.removeEventListener("keydown",y),window.removeEventListener("click",y),window.removeEventListener("scroll",y),window.removeEventListener("touchstart",y),c&&clearTimeout(c)}},[]),X.useEffect(()=>{const b=setInterval(()=>{Date.now()-o>=WXe&&(c&&clearTimeout(c),m())},6e4);return()=>clearInterval(b)},[o]);const m=async()=>{var y,b;try{localStorage.removeItem("walletName"),localStorage.removeItem("reown-session"),typeof window<"u"&&((y=window.reown)!=null&&y.disconnect)&&await window.reown.disconnect().catch(console.error),typeof window<"u"&&((b=window.solana)!=null&&b.disconnect)&&await window.solana.disconnect().catch(console.error),Va.custom(S.jsx("div",{className:"flex flex-col gap-2 p-3 bg-[#1A1C24] rounded-lg border border-[#2C2F36] min-w-[300px]",children:S.jsxs("div",{className:"flex items-center gap-2 text-[#7EBAFF]",children:[S.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),S.jsx("span",{children:"Session expired due to inactivity. Please reconnect."})]})}),{duration:5e3,position:"bottom-right"}),setTimeout(()=>window.location.reload(),1e3)}catch(E){console.error("Session timeout error:",E),window.location.reload()}},w=X.useMemo(()=>[new TU,new IU,new sse,new ose,new NU,new xie,new CU,new vie],[]);return S.jsx(pDe,{endpoint:t,config:{commitment:"confirmed",confirmTransactionInitialTimeout:9e4,disableRetryOnRateLimit:!1,httpHeaders:{"Content-Type":"application/json","x-api-key":"433d6f9c-0390-4c61-b2a9-f8cd84460376"},wsEndpoint:t.replace("https://","wss://")},children:S.jsx(M7e,{wallets:w,autoConnect:!1,onError:y=>{console.error("Wallet error:",y)},children:S.jsxs("div",{className:"relative min-h-screen overflow-hidden",children:[S.jsx(zXe,{showOnAllPages:!0}),S.jsx("div",{className:"relative z-10",children:S.jsx(iDe,{children:S.jsxs("div",{className:"min-h-screen flex flex-col",children:[S.jsxs(D9e,{children:[S.jsx(Xr,{path:"/swap/sol/:fromToken/:toToken",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(KI,{})]})}),S.jsx(Xr,{path:"/swap/*",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(KI,{})]})}),S.jsx(Xr,{path:"/sol/*",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(KI,{})]})}),S.jsx(Xr,{path:"/",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(KI,{})]})}),S.jsx(Xr,{path:"/dragonstory",element:S.jsx(fc,{to:"/meme",replace:!0})}),S.jsx(Xr,{path:"/dragon-story",element:S.jsx(fc,{to:"/meme",replace:!0})}),S.jsx(Xr,{path:"/meme",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(DGe,{})]})}),S.jsx(Xr,{path:"/whitepaper",element:S.jsx(fc,{to:"/white-paper",replace:!0})}),S.jsx(Xr,{path:"/white-paper",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(BGe,{})]})}),S.jsx(Xr,{path:"/faq",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(LGe,{})]})}),S.jsx(Xr,{path:"/terms",element:S.jsx(fc,{to:"/terms-of-service",replace:!0})}),S.jsx(Xr,{path:"/termsofservice",element:S.jsx(fc,{to:"/terms-of-service",replace:!0})}),S.jsx(Xr,{path:"/terms-of-service",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx($Ge,{})]})}),S.jsx(Xr,{path:"/privacy",element:S.jsx(fc,{to:"/privacy-policy",replace:!0})}),S.jsx(Xr,{path:"/privacypolicy",element:S.jsx(fc,{to:"/privacy-policy",replace:!0})}),S.jsx(Xr,{path:"/privacy-policy",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(UGe,{})]})}),S.jsx(Xr,{path:"/aboutus",element:S.jsx(fc,{to:"/about-us",replace:!0})}),S.jsx(Xr,{path:"/about-us",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(xZe,{})]})}),S.jsx(Xr,{path:"/howtoswap",element:S.jsx(fc,{to:"/how-to-swap",replace:!0})}),S.jsx(Xr,{path:"/how-to-swap",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(EZe,{})]})}),S.jsx(Xr,{path:"/howtobridge",element:S.jsx(fc,{to:"/how-to-bridge",replace:!0})}),S.jsx(Xr,{path:"/how-to-bridge",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(AZe,{})]})}),S.jsx(Xr,{path:"/chart",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(OXe,{})]})}),S.jsx(Xr,{path:"/road-map",element:S.jsx(fc,{to:"/roadmap",replace:!0})}),S.jsx(Xr,{path:"/road",element:S.jsx(fc,{to:"/roadmap",replace:!0})}),S.jsx(Xr,{path:"/roadmap",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(SZe,{})]})}),S.jsx(Xr,{path:"/why-yupfun",element:S.jsx(fc,{to:"/unique-value",replace:!0})}),S.jsx(Xr,{path:"/whyyupfun",element:S.jsx(fc,{to:"/unique-value",replace:!0})}),S.jsx(Xr,{path:"/uniquevalue",element:S.jsx(fc,{to:"/unique-value",replace:!0})}),S.jsx(Xr,{path:"/unique-value",element:S.jsxs(S.Fragment,{children:[S.jsx(gc,{}),S.jsx(FXe,{})]})}),S.jsx(Xr,{path:"/bridge",element:S.jsx(vZe,{})}),S.jsx(Xr,{path:"/buy",element:S.jsx(bZe,{})})]}),S.jsx(nVe,{}),S.jsx(ije,{position:"bottom-right",toastOptions:{style:{background:"#1A1C24",color:"#fff",borderRadius:"12px",border:"1px solid #2C2F36"},success:{duration:5e3,iconTheme:{primary:"#7EBAFF",secondary:"#1A1C24"}},error:{duration:5e3,iconTheme:{primary:"#ef4444",secondary:"#1A1C24"}},loading:{iconTheme:{primary:"#7EBAFF",secondary:"#1A1C24"}}}})]})})})]})})})}globalThis.Buffer=Ot;Du?Ule.createRoot(document.getElementById("root")).render(S.jsx(X.StrictMode,{children:S.jsx(Yle,{appKit:Du,children:S.jsx(YXe,{})})})):console.warn("appKit not initialized - running in non-browser environment");export{wt as $,_t as A,Vn as B,nt as C,bt as D,xn as E,Os as F,Wr as G,pn as H,$d as I,ax as J,MC as K,i$ as L,vo as M,$ue as N,t$ as O,Ha as P,Ue as Q,it as R,Ir as S,na as T,zi as U,w1 as V,fi as W,$7e as X,vee as Y,Gy as Z,Ry as _,ut as a,Qo as a0,Yn as a1,kX as a2,
8354jn as a3,kD as a4,Pn as a5,Ft as a6,ss as a7,Xp as a8,f4 as a9,hS as aa,p4 as ab,Wue as ac,Ii as ad,Fue as ae,xo as af,Fd as ag,qs as ah,Ey as ai,X$ as aj,dN as ak,UD as al,bo as am,al as an,J8 as ao,Net as ap,ii as aq,Ant as ar,Ent as as,Zl as at,Wi as b,ot as c,Be as d,ue as e,tt as f,Xs as g,yde as h,Mt as i,Fs as j,s$ as k,sr as l,$X as m,Ge as n,Qs as o,Mi as p,Jr as q,Dn as r,Eo as s,be as t,Hr as u,Nt as v,wl as w,le as x,qe as y,OPe as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.